What will happen if use iClose this way?

 
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? 

 
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.

 
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.
 
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.
 
Thank you both!
Reason: