OPEN-SOURCE SCRIPT

Date Marker GPT

502
Date Marker GPT
By Jimmy Dimos (corrected by ChatGPT-o3)

Description
This overlay indicator automatically plots vertical lines at each weekly option-expiration timestamp (Friday at 3 PM CST) for both historical and upcoming periods, helping you visualize key expiration dates alongside your price action and regression tools. Shown is my Date Maker GPT vertical blue Lines, Linear Regression Channel(not part of my script) and zigzag++[LD] also not part of my script.



Key Features
• Past Expirations: Draws 12 past Friday markers at 3 PM CST
• Future Expirations: Projects 12 upcoming Friday markers at 3 PM CST
• Timezone Handling: Uses UTC internally (21:00 UTC = 3 PM CST)
• Customizable: num_fridays_past and num_fridays_future inputs let you adjust how many weeks to display



How It Works
1. Timestamp Calculation
• Uses Pine Script’s dayofweek() and timestamp() functions to find each Friday at the target hour.
• Two helper functions, get_previous_friday() and get_next_friday(), compute offsets in days/weeks based on the current bar’s date.
2. Drawing Lines
• Loops through the specified number of weeks in the past and future.
• Calls line.new() for each expiration timestamp, extending lines across the entire chart.



Usage Tips
• Overlay this script on any OHLC chart to see how price tends to cluster around option expirations.
• Combine with a linear regression or trend-channel indicator to anticipate likely trading ranges leading into expiration.
• Tweak the num_fridays_past and num_fridays_future parameters to focus on shorter or longer horizons.



Disclaimer: This tool is provided for educational and analytical purposes only. It is not financial advice. Always conduct your own research and risk management.

免責聲明

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