Hello, the script is fine in regular trading hours.
How can I tweak to let it work outside RTH ? Thanks!
input period_Type = AggregationPeriod.DAY;
def begin = close(period = period_Type)[1];
def end = close(period = period_Type);
def NetChg = end - begin;
def PctChg = (end / begin) - 1;
AddLabel(yes, "" + (NetChg) + " " + AsPercent(PctChg), if NetChg > 0 then CreateColor(100,200,100) else if NetChg < 0 then CreateColor(255,125,125) else color.LIGHT_GRAY);
How can I tweak to let it work outside RTH ? Thanks!
input period_Type = AggregationPeriod.DAY;
def begin = close(period = period_Type)[1];
def end = close(period = period_Type);
def NetChg = end - begin;
def PctChg = (end / begin) - 1;
AddLabel(yes, "" + (NetChg) + " " + AsPercent(PctChg), if NetChg > 0 then CreateColor(100,200,100) else if NetChg < 0 then CreateColor(255,125,125) else color.LIGHT_GRAY);