Stoynks
Member
Can't seem to make this work. I want my variable to only be triggered right after market opens and before it closes. so basically market open > x < market closes. I have this in the aggregation period of DAY. Without "rth" it works, but pre-market and after-hours still triggered my statement.
Code:
def rth = getTime() >= RegularTradingStart(getYYYYMMDD()) and getTime() <= RegularTradingEnd(getYYYYMMDD());
AddLabel (yes, " High: " + (high), (if
close crosses vwap and rth then color.white
else color.black));