Hi, am trying to create an indicator which marks nth candle (usually 20th, 50th and 200th candle) with an arrow.
So far, tried DRAWARROWDOWN(barindex -20, close) and DRAWARROWDOWN(20, close) but mixed results….former marks all candles while latter marks all except last 20.
Please help
If BarIndex is, say, 780, the first one will mark the 20th candle before the current one, while the latter will mark just one candle, the 760th candle before the current one (barindex 20) not ALL candles.
Of course it depends where you use those instructions, whether inside a loop or not.
You could mark all candles on the tens boundary, you could write:
DRAWARROWDOWN((barindex mod 10) = 0, close)
If you add:
defparam drawonlastbaronly = true
to the top of your indicator then it will only draw the arrow at the n’th candle from the last one on the chart.