Weekly Options Expiry Candle

This script shows weekly expiry candle on daily chart . In weekly expiry, week starts on Friday and end on next Thursday.
How the candle is constructed:
Open= Open price of Friday, if Friday is a holiday, next available open price
High= Highest high price of Friday, Monday, Tuesday, Wednesday, Thursday
Low= Lowest low price of Friday, Monday, Tuesday, Wednesday, Thursday
Close=Close price of Thursday, if Thursday is a holiday, previously available close price
I am very new to Pine script, so waiting for your comments and review.

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.


The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?