Hi,
I would like to submit the following chart study code for intraday stock stats. I feel that this will be very helpful to investors as they can see the vital stock stats on the chart. Please pass this on! The code is attached below this.
Thanks,
Sonny
I would like to submit the following chart study code for intraday stock stats. I feel that this will be very helpful to investors as they can see the vital stock stats on the chart. Please pass this on! The code is attached below this.
Thanks,
Sonny
Code:
#Current Price
Addlabel (1, "Price: " + close, color.CYAN);
#Percent Change from yesterday close
def AP = AggregationPeriod.DAY;
def Priorclose = close(period = AP)[1];
def PctChange = (close - Priorclose) / Priorclose;
def PC1 = Round(PctChange,3);
Addlabel(1, "Ch: " + AsPercent(PC1), if PctChange > 0 then Createcolor(238,210,238) else Color.LIGHT_RED);
#Prior Close
Addlabel (1, "YC: " + Round(Priorclose,2), color.LIGHT_GREEN);
#Open price
def open1 = open(period = AP);
Addlabel (1, "O: " + Round(open1,2), createcolor(254,216,177));
#High of Day
def high1 = Highest(high(period = AP),1);
Addlabel (1, "Hi: " + Round(high1,2), color.CYAN);
#Low of Day
def low1 = Lowest(low(period = AP),1);
Addlabel (1, "Lo: " + Round(low1,2), createcolor(178,255,102));
#Volume Today
def today = volume(period = "DAY");
def L1 = RoundDown(lg(today),0);
Addlabel (L1 < 5, "Vol: " + today, createcolor(206,177,128));
Addlabel (L1 between 4.5 and 5.5, "Vol: " + Round((today/1000),0) + "K", createcolor(206,177,128));
Addlabel (L1 between 5.5 and 10, "Vol: " + Round((today/1000000),1) + "M", createcolor(206,177,128));
#Change From Open
def CFO = (close / open1)-1;
def CFO1 = Round(CFO,3);
Addlabel(1, "CFO: " + AsPercent(CFO1), if CFO >0 then Createcolor(0,255,128) else createcolor(255,153,153));
Last edited by a moderator: