@Welkin My mistake Welkin. It does work. Sorry about it!
IF you are able to help, I do have one more issue. The code below doesn't work.
Code:
def YYYYMMDD = GetYYYYMMDD();
def yesterdaytest = if YYYYMMDD != YYYYMMDD[1] then YYYYMMDD[1] else yesterdaytest[1];
def yesterday = yesterdaytest;
def today = yesterday + 1;
def GlobeX = GetTime() > RegularTradingEnd(yesterday) and GetTime() < RegularTradingStart(today);
However if I enter the date manually it will work. Example below.
Code:
def YYYYMMDD = GetYYYYMMDD();
def yesterdaytest = if YYYYMMDD != YYYYMMDD[1] then YYYYMMDD[1] else yesterdaytest[1];
def yesterday = yesterdaytest;
def today = yesterday + 1;
def GlobeX = GetTime() > RegularTradingEnd(20200929) and GetTime() < RegularTradingStart(20200930);
I'm coding a previous after market high and low before the start of the next trading day. It's an adapted version of another code posted on this forum. I excluded the remainder to not make it messy. If you require the full code let me know. Thanks!