What will happen if use iClose this way?

Back to topics list To post a new topic, please log in or register
avatar
228
jollydragon 2015.05.29 12:57
 

 

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

 

 

 

 

avatar
Moderator
3413
GumRai 2015.05.29 13:10 #
 
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? 

avatar
Moderator
3206
angevoyageur 2015.05.29 21:44 #
 
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.

avatar
Moderator
3413
GumRai 2015.05.29 22:17 #
 
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.
avatar
Moderator
3206
angevoyageur 2015.05.30 09:40 #
 
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.
avatar
228
jollydragon 2015.06.01 05:41 #
 
Thank you both!
Back to topics list  

To add comments, please log in or register