I need help to know how to reference to a specific date which will be used for full next month?
Options expire of last Thursday of week and month (earlier if Thursday is a holiday). I need to pick closing value of this day, make calculations on it and use it for full next week / month respectively. New value will apply from Friday or next trading day for rest of the week / month respectively. I have been able to pick only the week / month but not able to specify / fix the date. How can I do it?
Visually, there will be a straight line for full week / month respectively as value is fixed / calculated for the full week / month.
Thank you
My code so far
//@version=4
study("Band", shorttitle="Band ", overlay=true)
TF = input("M", type=input.resolution)
CloseHTF = security(syminfo.tickerid, TF, close[1], lookahead=true)
Upper = CloseHTF+(stdev(close,20)*2)
Lower = CloseHTF-(stdev(close,20)*2)
plot(Upper,color = color.black, style = plot.style_line, title = "UB")
plot(Lower,color = color.blue, style = plot.style_line, title = "LB")