OPEN-SOURCE SCRIPT
已更新

Historical Date Average Prediction

338
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.
發行說明
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提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。