Hi,
Thanks for any help.....
I would like to plot an arrow afer a condition has been met on any bars that meet this condition.
I can easily tweak either of the following pieces of code to plot an arrow a fixed number of bars to the right or left (Thanks for this code from the forum).
input numberOfBarsAgo = 20;
plot arrow = isNaN(close[-1 - numberOfBarsAgo]) and !isNaN(close[-numberOfBarsAgo]);
arrow.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
arrow.SetDefaultColor(Color.YELLOW);
def x = if isNaN(close[-1]) and !isNaN(close) then barnumber() - 20 else x[1];
plot data = if barNumber() == x[-20] then high else double.nan;
data.SetPaintingStrategy(PaintingStrategy.Arrow_DOWN);
Is there a way to do it for a variable number of bars offset. (The above code complains if I put a variable in the square brackets as the plot function requires a constant)
Any ideas very welcome please.
Thanks a lot
Doug
Thanks for any help.....
I would like to plot an arrow afer a condition has been met on any bars that meet this condition.
I can easily tweak either of the following pieces of code to plot an arrow a fixed number of bars to the right or left (Thanks for this code from the forum).
input numberOfBarsAgo = 20;
plot arrow = isNaN(close[-1 - numberOfBarsAgo]) and !isNaN(close[-numberOfBarsAgo]);
arrow.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
arrow.SetDefaultColor(Color.YELLOW);
def x = if isNaN(close[-1]) and !isNaN(close) then barnumber() - 20 else x[1];
plot data = if barNumber() == x[-20] then high else double.nan;
data.SetPaintingStrategy(PaintingStrategy.Arrow_DOWN);
Is there a way to do it for a variable number of bars offset. (The above code complains if I put a variable in the square brackets as the plot function requires a constant)
Any ideas very welcome please.
Thanks a lot
Doug