OPEN-SOURCE SCRIPT
تم تحديثه Historical Date Average Prediction

How it Works
Date Matching: The script attempts to find the bar where the month and dayofmonth match today’s date.
Offset Calculation: Since there are roughly 252 trading days in a year, the script looks back in increments of 252 (or uses timestamp functions) to find the price action from 1, 2, or 5 years ago today.
The Average: It sums the highs and lows of those specific historical days and divides them by the number of years found.
Date Matching: The script attempts to find the bar where the month and dayofmonth match today’s date.
Offset Calculation: Since there are roughly 252 trading days in a year, the script looks back in increments of 252 (or uses timestamp functions) to find the price action from 1, 2, or 5 years ago today.
The Average: It sums the highs and lows of those specific historical days and divides them by the number of years found.
ملاحظات الأخبار
I have also added a "Future Extension" logic to the labels. Since you noticed the labels "go off chart" or get messy when moving the price axis, this version anchors the label to the very last bar and ensures it only calculates for the high side.نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.