
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
Actually, that is what they instruct in the documentation as I noted above in my post.
Forum on trading, automated trading systems and testing trading strategies
Direction of OnCalculate() in MQL4 and MQL5
Fernando Carreiro, 2017.01.22 18:12
Also, according to the documentation, and I quote:
const int prev_calculated,
const datetime &time[],
const double &open[],
const double &high[],
const double &low[],
const double &close[],
const long &tick_volume[],
const long &volume[],
const int &spread[])
{
static bool HasRun=false;
if(!HasRun)
{
printf("Default: time[0]=%s time[rates_total-1]=%s",
TimeToString(time[0]),TimeToString(time[rates_total-1]));
ArraySetAsSeries(time,true);
printf("ArraySetAsSeries(true): time[0]=%s time[rates_total-1]=%s",
TimeToString(time[0]),TimeToString(time[rates_total-1]));
ArraySetAsSeries(time,false);
printf("ArraySetAsSeries(false): time[0]=%s time[rates_total-1]=%s",
TimeToString(time[0]),TimeToString(time[rates_total-1]));
HasRun=true;
}
return(rates_total);
}
In MT5:
In MT4:
Conclusion:
In MT5 default oldest index is [0]
In MT4 default oldest index is [rates_total-1]