Make sure your column is set to an intraday aggregation and extended hours is checked on.
Code:
#begin
#Hint: Displays After Hours & Pre Market change as a percentage in custom column.
#WaterFrontTrader
#07/20/12: Initital Release
#08/13/12: Fixed to include pre-market and extended session
#"Show Extended Session" should be active on your chart
def Post = secondsFromTime(1600);
def Pre = secondsTillTime(930);
def Closed = Post >=0 or Pre>=0;
def DayClose = if (Post>=0,close(period = "Day"),close(period = "Day")[1]);
#NN note:modified close to use ask
def Change = close(priceType = "ASK") - DayClose;
def Percent = round(((close - DayClose)/DayClose)*100);
plot change1 = percent;
change1.assignValueColor (color.BLACK);
assignBackgroundColor(if close< dayclose then color.red else if close>dayclose then color.green else color.current);
#end
Last edited by a moderator: