Yet when I compile the code, it comes up as a clean run. When doing "BT", it then shows up the error. I've run through coding and still can't find the problem, can I ask for help please? This is for Mt4 Version!.!.!
The error could be as a result of incorrect indexing, static array sizes, or non-valid loop bounds. The error on line 62 seems to be trying to access a non valid array in the initialization for loop. Try to print the iteration values like below and make sure the value you're trying to access is indeed valid.
for (int i=0; i<ArraySize(staticArray1); i++){//fix < or negate 1 from limit Print("Iteration: ",i+1," when index i = ",i); Print(i," = ",staticArray1[i]); }
The error could be as a result of incorrect indexing, static array sizes, or non-valid loop bounds. The error on line 62 seems to be trying to access a non valid array in the initialization for loop. Try to print the iteration values like below and make sure the value you're trying to access is indeed valid.
Yet when I compile the code, it comes up as a clean run. When doing "BT", it then shows up the error. I've run through coding and still can't find the problem, can I ask for help please? This is for Mt4 Version!.!.!
Apparently, the error is not in the code you posted, but in TrendLines.mq4.
Noted, I noticed that. I rewrote code still getting error till yesterday!
You published the wrong code. The error occurs in the "TrendLines" file, not in the code you posted.
Here you call that file:
int OnInit() { // Initialization ChartSetInteger(0, CHART_FOREGROUND, true); // Initialize custom indicator values ArraySetAsSeries(trendLineHigh, true); ArraySetAsSeries(trendLineLow, true); for (int i = 0; i < 62; i++) { trendLineHigh[i] = iCustom(NULL, 0, "TrendLines", 0, i); trendLineLow[i] = iCustom(NULL, 0, "TrendLines", 1, i); }
You need to fix TrendLines.mq4 (if you have the source code of that indicator)

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Yet when I compile the code, it comes up as a clean run. When doing "BT", it then shows up the error. I've run through coding and still can't find the problem, can I ask for help please? This is for Mt4 Version!.!.!