SuperStrater
New member
I am wondering if it's possible to add a bubble to this script to say "DAY" "WEEK" "MONTH"... on the plot line based on the aggregate period I choose?
Code:
input AggregationPeriod = AggregationPeriod.DAY;
def c = if !IsNaN(close) and IsNaN(close[-1]) then hl2(period = AggregationPeriod)[1] else c[1];
plot line = if isNaN(close[-2]) and !isnan(close[10]) then c[-1] else Double.NaN;
line.SetDefaultColor(Color.RED);
line.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
line.SetLineWeight(2);
def dU = if close > open then 1 else 0;
def dD = if close < open then 1 else 0;