You are checking iLowest starting from bar 0 for 1 bar.
It means you are calculating it only for one bar (the 0 shift).
It's obvious that returned value is always 0.
Your code should be:
Print("iLowest= ",IntegerToString(iLowest(Instrument,PERIOD_H1,MODE_LOW,2,0)));
Sure Fabio,
Thanks a lot. It's obvious indeed!
Thank you for taking me out of that fog!
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
result:
0 07:37:53.045 EA GBPUSD,H1: low 0 : 1.36055
0 07:37:53.045 EA GBPUSD,H1: low 1 : 1.36038
0 07:37:53.045 EA GBPUSD,H1: iLowest= 0
iLowest should be equal to 1 isn't it?
(the low 0 and low 1 are correct)
remark:
It seems ok with more bars from the 0 one:
here with 4 bars instead of 1 (lowest of the 4 last bars instead of the last 2)
result:
0 07:55:38.061 EA GBPUSD,H1: low 0 : 1.36055
0 07:55:38.061 EA GBPUSD,H1: low 1 : 1.36038
0 07:55:38.061 EA GBPUSD,H1: low 2 : 1.36074
0 07:55:38.061 EA GBPUSD,H1: low 3 : 1.36039
0 07:55:38.061 EA GBPUSD,H1: iLowest= 1