The compiler won't allow multiple initializers with type declarations. for(i=0, int y=0;i<limit;i++) {if (Time[i]<TimeArray1[y]) y++; SumVQ[i]=SumVQ_MTF[y];}
Thus int y; for(i=0, y=0;i<limit;i++) {if (Time[i]<TimeArray1[y]) y++; SumVQ[i]=SumVQ_MTF[y];}
Your code ArrayCopySeries(TimeArray1,MODE_TIME,Symbol(),TimeFrame); int limit=CountBars+TimeFrame/Period(); for(i=0, int y=0;i<limit;i++) {if (Time[i]<TimeArray1[y]) y++; SumVQ[i]=SumVQ_MTF[y];}
Simplified int limit=CountBars+TimeFrame/Period(); for(i=0;i<limit;i++) SumVQ[i]=SumVQ_MTF[ iBarShift(_Symbol, TimeFrame, Time[i]) ];
Only on MT4 is the ENUM_TIMEFRAMES equal to minutes. Code fails on MT5. extern int TimeFrame = 0; int limit=CountBars+TimeFrame/Period();
Always work extern ENUM_TIMEFRAMES TimeFrame = PERIOD_CURRENT; int limit=CountBars+PeriodSeconds(TimeFrame)/PeriodSeconds();
Thank you so much for all your help Sir
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
Hi, I want to compile this MQL4 but have 3 error on line 143, I'm new here, would you please help me to clear this issue