disbellj:
Here is my code that worked before:
The problems are line:
AsianStartBars[k] = j;
AsianEndBars[n] = m+1;
I don't know how to fix it. If someone nows how, it's much appreciated. Thank you.
Kindest regards,
Don
Do not modify external cyrcle before internal.
tara,
Thanks so much tara! You ROCK!
while(k<14) { for(int j=AsianStartBar1;j<iBars(symbol,tf);j++) { if(TimeHour(iTime(symbol,tf,j)) == ChannelStartHour && TimeMinute(iTime(symbol,tf,j)) == 0) { AsianStartBars[k] = j; k++; } } }The while does NOTHING when you are inside the for.
// while(k<14) { for(int j=AsianStartBar1;j<iBars(symbol,tf);j++) { if(TimeHour(iTime(symbol,tf,j)) == ChannelStartHour && TimeMinute(iTime(symbol,tf,j)) == 0) { AsianStartBars[k] = j; k++; if(k >= 14) break; } } // }
WHRoeder,
Thank you for the further explanation. Like I said, the code I posted worked before the upgrade to new MQL4 code. I have now updated my code. Same results as I get on pre-upgrade ex4. Thanks again. Maybe this will also help anyone else having the same issue.
Kindest regards,
Don
I didnt work properly before the upgrade, MT4 just ignored the error and continued until it reached the end of the chart as defined by iBars() in the for loop. The new version generated the array error and quit the indicator when the code attempted to write to your array indexes [14] +
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
Here is my code that worked before:
The problems are line:
AsianStartBars[k] = j;
AsianEndBars[n] = m+1;
I don't know how to fix it. If someone nows how, it's much appreciated. Thank you.
Kindest regards,
Don