Hello,
I work in my intraday charts with an indicator, which gives me the results for the prior day high, low and close for the US Stocks main trading session (15:30-22:00 Berlin Time).
To get the right close, I restricted by the time (22:00) which works correct so far.
But I need a solution, that the indicator shows me the correct high and low of the main trading session.
At the moment, it shows me the high and low of the prior day , but he does not care about, if it is made in the pre opening sessions or in the main trading session.
Is there a way to restrict it like: give me the highest and lowest price between a time space 15:30 and 22:00?
(It should work in every time frame, so I can not go over the highest high/lowest low, regarding a specific number of candles/periods)
Thanks a lot for help,
Regards André
Hey Ringo, please post the code in text format with the appropriate button, it would be much easier to copy/paste the code into our platforms in order to try to do something with it 🙂 Thank you.
Hey Nicolas,
ok here we go.
// Open/High/Low/Close Vortag
defparam drawonlastbaronly = true
HighVT = DHigh(1)
LowVT = DLow(1)
IF TIME =220000 AND date=yesterday THEN
CloseVT = Close
Endif
//vertical offset to draw text correctly over horizontal lines
Voffset = 0*pipsize
//draw Open/High/Low/Close Vortag Text
DRAWTEXT("VT-Close",barindex-54,CloseVT+Voffset,SansSerif,Standard,10)coloured(153,51,255)
DRAWTEXT("VT-Hoch",barindex-54,HighVT+Voffset,SansSerif,Standard,10)coloured(0,204,51)
DRAWTEXT("VT-Tief",barindex-54,LowVT+Voffset,SansSerif,Standard,10)coloured(0,204,51)
//draw Open/High/Low/Close Vortag lines without extensions
DRAWSEGMENT(barindex-50,CloseVT,barindex,CloseVT) coloured(153,51,255)
DRAWSEGMENT(barindex-50,HighVT,barindex,HighVT) coloured(0,204,51)
DRAWSEGMENT(barindex-50,LowVT,barindex,LowVT) coloured(0,204,51)
RETURN