Chart label with previous day close

zeek

zeek

Active member
2019 Donor
Looking for a chart label that displays the previous day close price. Can anyone help me create this?
 
G

GimmickFace

New member
Looking for a chart label that displays the previous day close price. Can anyone help me create this?
Here ya go:

declare hide_on_daily;

def active = GetTime() >= RegularTradingStart(GetYYYYMMDD());
plot PC = if active then close(period = AggregationPeriod.Day)[1] else Double.NaN;
PC.SetLineWeight(2);
PC.SetDefaultColor(Color.Yellow);
# End Close Previous Day
 
zeek

zeek

Active member
2019 Donor
Here ya go:

declare hide_on_daily;

def active = GetTime() >= RegularTradingStart(GetYYYYMMDD());
plot PC = if active then close(period = AggregationPeriod.Day)[1] else Double.NaN;
PC.SetLineWeight(2);
PC.SetDefaultColor(Color.Yellow);
# End Close Previous Day
Can you also add a chart label with the close price?
Thanks
 
haxen

haxen

New member
def bar = barNumber();
def BubbleX = bar == HighestAll(bar);

#then after your plot:
AddChartBubble(BubbleX, PC, " Prior Close ", Color.YELLOW, 0);
 
L

Len20

Member
Just one line should do it:
Code:
AddLabel(1,"Yesterday: $" + close(period = "day")[1], Color.YELLOW);
 

Similar threads

Top