It would help people to help you if you highlighted the code that causes the problem
int OnInit()
{
oldTime = Time[0];
Never try to get any values from series arrays such as Time[] in OnInit as they may not be loaded yet and so return an array out of range error.
Keith Watford:
int OnInit()
{
oldTime = Time[0];
It would help people to help you if you highlighted the code that causes the problem
int OnInit()
{
oldTime = Time[0];
Never try to get any values from series arrays such as Time[] in OnInit as they may not be loaded yet and so return an array out of range error.
I changed the code my error occurred again, I attach you a screenshot of my Journal Tab. How can I find the code that cause error?
elfunambolo:
I changed the code my error occurred again, I attach you a screenshot of my Journal Tab. How can I find the code that cause error?
I changed the code my error occurred again, I attach you a screenshot of my Journal Tab. How can I find the code that cause error?
The error is on Line 376 of your code, 42 characters in.
honest_knave:
The error is on Line 376 of your code, 42 characters in.
The error is on Line 376 of your code, 42 characters in.
This is the line, inside condizione1() fuction
double valoreCloseCandela1 = Close[1];
elfunambolo:
This is the line, inside condizione1() fuction
You can add an extra line like this:
bool condizione1(){ //se la candela 1 chiude dentro la BB 21 (> 2dev inf) e la precedente (2) chiude fuori la BB 21 (< della 2dev inf) if(Bars < 3) return(false); double valoreCloseCandela1 = Close[1]; //iClose(Symbol(),timeFrameRiferimento,1); // calcolo prezzo chiusura ultima candela double valoreCloseCandela2 = Close[2]; //iClose(Symbol(),timeFrameRiferimento,2); // calcolo prezzo chiusura penultima candela //.................................. }
A similar thing for the condizione2() function....
Regards.
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
I have this type of error (Array out range error) when I backtesting this EA. How can I identify the point of issue?
Thanks
Giovanni