Thank you
@JS
Looks simple but ?
Please could you plot this image. Because when I try with either of the following it doesn’t work
Many thanks in advance
N=200
xIndex=0
For i=0 to N-1
If Close[i] crosses over Average[20](Close[i]) then
$xClose[xIndex]=Close[i]
$xBarIndex[xIndex]=BarIndex[BarIndex-i]
xIndex=xIndex+1
EndIf
Next
DrawText("1",$xBarIndex[0],$Close[0]+10*pipsize,Serif,Italic,18)
DrawText("2",$xBarIndex[1],$Close[1]+10*pipsize,Serif,Italic,18)
DrawText("3",$xBarIndex[2],$Close[2]+10*pipsize,Serif,Italic,18)
Return $xClose[0], $xClose[1], $xClose[2], $xBarIndex[0], $xBarIndex[1], $xBarIndex[2]
N=200
xIndex=0
For i=0 to N-1
If Close[i] crosses over Average[20](Close[i]) then
$xClose[xIndex]=Close[i]
$xBarIndex[xIndex]=BarIndex[BarIndex-i]
xIndex=xIndex+1
EndIf
Next
DrawText("1",barindex[$xBarIndex[0]],Close[$Close[0]]+10*pipsize,Serif,Italic,18)
DrawText("2",barindex[$xBarIndex[1]],Close[$Close[1]]+10*pipsize,Serif,Italic,18)
DrawText("3",barindex[$xBarIndex[2]],Close[$Close[2]]+10*pipsize,Serif,Italic,18)
Return $xClose[0], $xClose[1], $xClose[2], $xBarIndex[0], $xBarIndex[1], $xBarIndex[2]