Howdy and good am,
I have a script that I would like to place the indicies labels on a chart and do the following:
a.) Display the index: DJIA: 8888.88 (- 340.00 pts %23)
I would like for the DJIA to display the running stock price throughout the day. As you can see from the code below I am attempting to use the aggregation period to show the proper timeframe. i have deleted the code that wasn't pertinent to my inquiry.
I would like for the indicies numbers to stay the same regardless of which timeframe I am looking at.
I have a script that I would like to place the indicies labels on a chart and do the following:
a.) Display the index: DJIA: 8888.88 (- 340.00 pts %23)
I would like for the DJIA to display the running stock price throughout the day. As you can see from the code below I am attempting to use the aggregation period to show the proper timeframe. i have deleted the code that wasn't pertinent to my inquiry.
I would like for the indicies numbers to stay the same regardless of which timeframe I am looking at.
Code:
#*************************************************
# Dow Jones Aggregate Period and Last Price *
#*************************************************
def DoWLowPeriod = low(symbol = "$DJI", period = AggregationPeriod.DAY);
def DoWHighPeriod = high(symbol = "$DJI", period = AggregationPeriod.DAY);
def DoWClosePeriod = close(symbol = "$DJI", period = AggregationPeriod.DAY);
#Dow Open Close & Last Price
def DoW_LastPrice = close(symbol = "$DJI", period = AggregationPeriod.FIVE_MIN);
def Dow_ClosePrice = close(symbol = "$DJI", period = AggregationPeriod.DAY);
def Dow_OpenPrice = open(symbol = "$DJI", period = AggregationPeriod.DAY);
def Dow_Points = Dow_OpenPrice - DoW_LastPrice;
def Dow_Percentage = (Dow_Points / Dow_OpenPrice) * 100;
def Dow_Close = close (symbol = "$DJI");
#labels
AddLabel(yes, "DJIA: " + AsText(Dow_Close)+ " ( " + AsText(Dow_Points) + " ) ", (if DjiDMP > DjiDMM then Color.DARK_GREEN else Color.dark_RED));