OPEN-SOURCE SCRIPT

Historical Year Overlay

785
This script allows you to simply source any historical calendar year and overlay it over any other year (usually a historical year overlaying a year in the future). It was made using an LLM for coding help and logic.

It is great for working out potential pivots and it also maps the previous profit/loss from the source year over the plot year so that we can see the connection to price levels throughout the plot year and also with the yearly close (we get a horizontal line for the close).

It uses the year open as a price reference to plot the P&L over the plot year (if use plot year option is selected).

if the year has not started yet you can use the "manual opening price" OR it will auto set to the current price (great for "replay mode", it will catch the actual opening price once it happens).

The settings are self explanatory. Choose a source year and plot year.

Choose a multiplier if you'd like (it simply multiplies the plot year P&L by that number; ie: 1 means the same as it was, 0.5 means half of what is was, 2 means 2x the source P&L)

The resolution is max default 50 line segments but you can simplify if you'd like.

I've released the code open-source so you can see what it is doing.
Please update it with all the enhancements you can think of.
Please let me know if you do this as I will be very interested!

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。