When posting small portions of code, please make use of the SRC button. If it is a large amount of code, please use "Attach file" and add the entire MQL file.
JD4:
When posting small portions of code, please make use of the SRC button. If it is a large amount of code, please use "Attach file" and add the entire MQL file.
When posting small portions of code, please make use of the SRC button. If it is a large amount of code, please use "Attach file" and add the entire MQL file.
Hello Angus,
did you find how to answer all your questions?
I have the same now...
Thanks
Franco
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 refer to the sample given in the documentation. How are we meant to use OnCalculate?
THANK YOU
int OnCalculate(const int rates_total,
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[])
{
//--- Get the number of bars available for the current symbol and chart period
int bars=Bars(Symbol(),0);
Print("Bars = ",bars,", rates_total = ",rates_total,", prev_calculated = ",prev_calculated);
Print("time[0] = ",time[0]," time[rates_total-1] = ",time[rates_total-1]);
//--- return value of prev_calculated for next call
return(rates_total);
}