Download MetaTrader 5

What will happen if use iClose this way?

To add comments, please log in or register
moonsboy
891
moonsboy  

What will happen if I use iClose(NULL, 0, i-k) for back testing while k>i in fact?

Keith Watford
Moderator
10617
Keith Watford  
jollydragon:

 

What will happen if I use iClose(NULL, 0, i-k) for back testing while k>i in fact?

 

 

 

 

It will probably return 0

Why don't you write a simple piece of code to test it yourself? 

Alain Verleyen
Moderator
33486
Alain Verleyen  
jollydragon:

 

What will happen if I use iClose(NULL, 0, i-k) for back testing while k>i in fact?

With #property strict, a fatal error "array out of range".

Without #property strict, 0 as mentioned by GumRai.

Keith Watford
Moderator
10617
Keith Watford  
angevoyageur:

With #property strict, a fatal error "array out of range".

 I think that MT4 detects the invalid parameter and the function is not executed, so no fatal error.
Alain Verleyen
Moderator
33486
Alain Verleyen  
GumRai:
 I think that MT4 detects the invalid parameter and the function is not executed, so no fatal error.
Checked. You are right. Thank you.
moonsboy
891
moonsboy  
Thank you both!
To add comments, please log in or register