Download MetaTrader 5
To add comments, please log in or register
No time to learn MQL5? The source code library is at your service!
moonsboy
889
moonsboy 2015.05.29 10:57 

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

Keith Watford
Moderator
7888
Keith Watford 2015.05.29 11: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? 

Alain Verleyen
Moderator
28535
Alain Verleyen 2015.05.29 19: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.

Keith Watford
Moderator
7888
Keith Watford 2015.05.29 20: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.
Alain Verleyen
Moderator
28535
Alain Verleyen 2015.05.30 07: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.
moonsboy
889
moonsboy 2015.06.01 03:41  
Thank you both!
/
To add comments, please log in or register