Hello! I'm trying to identify when a ticker is above a high made between 8 am and 9:29 am.
This is what I have so far. It only works when I select the 30m watchlist timeframe and have Include Extended Hours Trading session checked.
#ABOVE PREMARKET HIGH#
input alertPeriodStart = 800;
input alertPeriodEnd = 929;
def startCounter = SecondsFromTime(alertPeriodStart);
def endCounter = SecondsTillTime(alertPeriodEnd);
def alertPeriod = if startCounter >= 0 and endCounter >= 0 then 1 else 0;
rec trackHigh = if alertPeriod and !alertPeriod[1] then high else if alertPeriod and high > trackHigh[1] then high else trackHigh[1];
rec trackLow = if alertPeriod and !alertPeriod[1] then low else if alertPeriod and low > 0 and low < trackLow[1] then low else trackLow[1];
plot x= (high>trackHigh);
x.assignValueColor( if x > 0.15 then color.green else color.black);
Is there something in my code that's limiting it 30 minutes? How can I see if this statement is true on a Daily timeframe via my watchlist?
Thanks!
This is what I have so far. It only works when I select the 30m watchlist timeframe and have Include Extended Hours Trading session checked.
#ABOVE PREMARKET HIGH#
input alertPeriodStart = 800;
input alertPeriodEnd = 929;
def startCounter = SecondsFromTime(alertPeriodStart);
def endCounter = SecondsTillTime(alertPeriodEnd);
def alertPeriod = if startCounter >= 0 and endCounter >= 0 then 1 else 0;
rec trackHigh = if alertPeriod and !alertPeriod[1] then high else if alertPeriod and high > trackHigh[1] then high else trackHigh[1];
rec trackLow = if alertPeriod and !alertPeriod[1] then low else if alertPeriod and low > 0 and low < trackLow[1] then low else trackLow[1];
plot x= (high>trackHigh);
x.assignValueColor( if x > 0.15 then color.green else color.black);
Is there something in my code that's limiting it 30 minutes? How can I see if this statement is true on a Daily timeframe via my watchlist?
Thanks!