
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
Hello,
I 'm trying to figure out how to pass struct MqlRates members to a function as arrays but the compiler refuses stubbornly coding like open, rt.open and rt[].open, maybe some sort of a pointer?
here is the relevant part of the code.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
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 &TickVolume[],
const long &Volume[],
const int &Spread[])
This compiles:
reBuild(rates_total, prev_calculated, open, high, Low, close, time);
----
MqlRates rt[];
if(CopyRates(NULL,InpTimeFrame,0,InpTimeBarsLimit,rt)!=InpTimeBarsLimit)
{Alert("Error CopyRates ",GetLastError());ExpertRemove();}
else
This does not compile:
reBuild(rates_total, prev_calculated, rt.open, rt.high, rt.Low, rt.close, rt.time);
----
void reBuild(const int rates_total, const int prev_calculated, const double &Open[], const double &High[], const double &Low[], const double &Close[], const datetime &Time[])
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Is there a way to pass MqlRates members to a function?