Maximum range candle of last 5 candles
int index=0; double delta=0; for(int i=0;i<5;i++) { if (delta<High[i]-Low[i]) { delta=High[i]-Low[i]; index=i; } }
int index=0; double delta=0; for(int i=0;i<5;i++) { if (delta<High[i]-Low[i]) { delta=High[i]-Low[i]; index=i; } }
You agree to website policy and terms of use
Hello,
I want to identify the candle (in the last 5) that have maximum range (High[i]-Low[i]) .
I wrote this code but for fill an array with range size:
How can I retrieve the index in the array with maximum value?
I suppose to use ArrayMax fuction, is correct:
Thanks for help
Giovanni