SebParticipant
Average
Hi, I want to draw a line from the highest[20](high) to the highest[10](high) with the Drawline function. But for that I need the barindex of each highs. How to?
Try this one (not tested)
High1 = 0
FOR i = 0 TO 9
IF high[i] > High1 THEN
Bar1 = BarIndex
High1 = high[i]
ENDIF
NEXT
High2 = 0
FOR i = 0 TO 19
IF high[i] > High2 THEN
Bar2 = BarIndex
High2 = high[i]
ENDIF
NEXT
now you’ll have two bars and two prices to draw a line or a segment.
SebParticipant
Average
Thank you much, it works if I put [i] behind BarIndex! It’s not possible though to use a diagonal line in ProBacktest, as it seems to me.