This is were I am at with this atm.
For daily and weekly.
It displays perfectly on the 1 min timeframe but I cant see why it will not display on other timeframes.
I thought it was the below line of code so changed it but still no joy.
Any advice would be gratefully received.
Code: Select all
//@version=4
study("Market Opening Hours", overlay=true)
offset_val = input(title="Label Offset", type=input.integer, defval=15)
//--------------Asia Configuration
AsiaDOpenInput = input('2359-0000:234567', title="Asia Daily Open") //set the opening range you are interested in
AsiaWOpenInput = input('2359-0000:1', title="Asia Weekly Open") //set the opening range you are interested in
//AsiaDOpen = time("1", AsiaDOpenInput)
//AsiaWOpen = time("1", AsiaWOpenInput)
AsiaDOpen = time(timeframe.period, AsiaDOpenInput)
AsiaWOpen = time(timeframe.period, AsiaWOpenInput)
var AsiaDOpenPA = 0.0
if AsiaDOpen
if not AsiaDOpen[1]
AsiaDOpenPA := open
var AsiaWOpenPA = 0.0
if AsiaWOpen
if not AsiaWOpen[1]
AsiaWOpenPA := open
plot(not AsiaDOpen ? AsiaDOpenPA : na, title="Asia D Open", color=color.orange, linewidth=1, style=plot.style_linebr)
plotshape(AsiaDOpenPA, style=shape.labeldown, location=location.absolute, color=color.orange, textcolor=color.white, show_last=1, text="Asia D Open", offset = offset_val, transp=20, title="Asia D Open")
plot(not AsiaWOpen ? AsiaWOpenPA : na, title="Asia W Open", color=color.orange, linewidth=2, style=plot.style_linebr)
plotshape(AsiaWOpenPA, style=shape.labeldown, location=location.absolute, color=color.orange, textcolor=color.white, show_last=1, text="Asia W Open", offset = offset_val, transp=20, title="Asia W Open")
//--------------London Configuration
LonDOpenInput = input('0759-0800:134567', title="London Daily Open") //set the opening range you are interested in
LonWOpenInput = input('0759-0800:2', title="London Weekly Open") //set the opening range you are interested in
//LonDOpen = time("1", LonDOpenInput)
//LonWOpen = time("1", LonWOpenInput)
LonDOpen = time(timeframe.period, LonDOpenInput)
LonWOpen = time(timeframe.period, LonWOpenInput)
var LonDOpenPA = 0.0
if LonDOpen
if not LonDOpen[1]
LonDOpenPA := open
var LonWOpenPA = 0.0
if LonWOpen
if not LonWOpen[1]
LonWOpenPA := open
plot(not LonDOpen ? LonDOpenPA : na, title="London D Open", color=color.yellow, linewidth=1, style=plot.style_linebr)
plotshape(LonDOpenPA, style=shape.labeldown, location=location.absolute, color=color.yellow, textcolor=color.white, show_last=1, text="London D Open", offset = offset_val, transp=20, title="London D Open")
plot(not LonWOpen ? LonWOpenPA : na, title="London W Open", color=color.yellow, linewidth=2, style=plot.style_linebr)
plotshape(LonWOpenPA, style=shape.labeldown, location=location.absolute, color=color.yellow, textcolor=color.white, show_last=1, text="London W Open", offset = offset_val, transp=20, title="London W Open")
//--------------New York Configuration
NYDOpenInput = input('1429-1430:134567', title="New York Daily Open") //set the opening range you are interested in
NYWOpenInput = input('1429-1430:2', title="New York Weekly Open") //set the opening range you are interested in
//NYDOpen = time("1", NYDOpenInput)
//NYWOpen = time("1", NYWOpenInput)
NYDOpen = time(timeframe.period, NYDOpenInput)
NYWOpen = time(timeframe.period, NYWOpenInput)
var NYDOpenPA = 0.0
if NYDOpen
if not NYDOpen[1]
NYDOpenPA := open
var NYWOpenPA = 0.0
if NYWOpen
if not NYWOpen[1]
NYWOpenPA := open
plot(not NYDOpen ? NYDOpenPA : na, title="New York D Open", color=color.blue, linewidth=1, style=plot.style_linebr)
plotshape(NYDOpenPA, style=shape.labeldown, location=location.absolute, color=color.blue, textcolor=color.white, show_last=1, text="New York D Open", offset = offset_val, transp=20, title="New York D Open")
plot(not NYWOpen ? NYWOpenPA : na, title="New York W Open", color=color.blue, linewidth=2, style=plot.style_linebr)
plotshape(NYWOpenPA, style=shape.labeldown, location=location.absolute, color=color.blue, textcolor=color.white, show_last=1, text="New York W Open", offset = offset_val, transp=20, title="New York W Open")