Hi,
I am trying to draw lines on smaller aggregation based on higher aggregation candles.
Basically i want to input bar number and aggregation on the study and it should draw the lines on smaller aggregation.
I tried the code below and it doesnt draw anything on any aggregation chart
def barnum = if BarNumber() == 4 then hl2("SPY", AggregationPeriod.HOUR)else double.nan;
plot x = barnum;
x.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
I also tried using below line with barnumber. it doesnt work .
secondsFromTime(1200) >= 0
&& secondsFromTime(1330) <= 0;#
Please correct the code. Thank you.
I am trying to draw lines on smaller aggregation based on higher aggregation candles.
Basically i want to input bar number and aggregation on the study and it should draw the lines on smaller aggregation.
I tried the code below and it doesnt draw anything on any aggregation chart
def barnum = if BarNumber() == 4 then hl2("SPY", AggregationPeriod.HOUR)else double.nan;
plot x = barnum;
x.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
I also tried using below line with barnumber. it doesnt work .
secondsFromTime(1200) >= 0
&& secondsFromTime(1330) <= 0;#
Please correct the code. Thank you.