High and low for the current day

pine

New member
I would like to plot retail hours high/low horizontal lines on the 1H chart. Here is what I have but doesn't seem to work properly. Please help! Thank you in advance!

Code:
def RH = SecondsFromTime(0900) >= 0 && SecondsTillTime(1600) > 0;
def h = if RH then highest(high) else h[1];
def l = if RH then lowest(low) else l[1];

plot hi = h;
hi.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);

plot lo = l;
lo.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);

Another code

Code:
def RH = SecondsFromTime(0900) >= 0 && SecondsTillTime(1600) > 0;
def h = if RH then high(period = "Day") else double.nan;
def l = if RH then low(period = "Day") else double.nan;

plot hi = h;
hi.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);

plot lo = l;
lo.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);


Edit: Thanks for moving my question here. The response from inthefutures plots the high/low of the whole day, not during retail hours.
 
Last edited:

Similar threads

Top