Hello! I have been working on a script/study that plots the current High/Low of the session at 11:30 AM. I am trying to figure out how to generate a label and buy/sell signal if a bar closes above or below the respective plotted line (after 11:30 AM. I have tried a couple of solutions but no luck. If anyone has any input I would appreciate it!
Thanks in advance!
Casper
This is what I have so far:
Also If possible for some insight on how to have the plots pmH and pmL start at 11:30 am (input Range End). I dont need to see them before that.
Thanks
Thanks in advance!
Casper
This is what I have so far:
Ruby:
input RangeBegin = 0930;
input RangeEnd = 1130;
input MarketOpen = 0930;
Def IsRangeActive = if secondstilltime(RangeEnd) > 0 && secondsfromtime(RangeBegin) >= 0 then 1 else 0;
Rec RangeHigh = if RangeHigh[1] == 0 or IsRangeActive[1] == 0 && IsRangeActive == 1 then high else if IsRangeActive && high > RangeHigh[1] then high else RangeHigh[1];
Rec RangeLow = if RangeLow[1] == 0 or IsRangeActive[1] == 0 && IsRangeActive == 1 then low else if IsRangeActive && low < RangeLow[1] then low else RangeLow[1];
plot pmH = RangeHigh;
plot pmL = RangeLow;
Also If possible for some insight on how to have the plots pmH and pmL start at 11:30 am (input Range End). I dont need to see them before that.
Thanks
Last edited by a moderator: