waterhorse: I received the error message 'double_array" - array required.
ArrayCopyRates(double_array,"EURUSD",PERIOD_M15);
- Show all the relevant code, like your declarations. How should we know what double_array is, unless you show it?
MqlRates chartM15[]; init(){ ArrayCopyRates(chartM15,"EURUSD",PERIOD_M15); ...} start(){ Print("EURUSD close[1]="+chartM15[1].close);
WHRoeder,
Thanks for your reply:
Here is the declaration:
double ClosePriceArray[]; double OpenPriceArray[]; if (ArraySize(Close) > 101) { ArrayCopy(ClosePriceArray, Close, 0, 1, 100); ArrayCopy(OpenPriceArray, Open, 0, 1, 100); RandVar = 0; if (doublecnt > 0.0) { for (int cnt = 0; cnt < ArraySize(ClosePriceArray); cnt++) { if (MathRand() > 383) RandVar = (MathRand() + 0.0001) / 767.0 * (doublecnt * Point); else RandVar = (-(MathRand() + 0.0001)) / 767.0 * (doublecnt * Point); ClosePriceArray[cnt] += RandVar; } for (cnt = 0; cnt < ArraySize(OpenPriceArray); cnt++) { if (MathRand() > 383) RandVar = (MathRand() + 0.0001) / 767.0 * (doublecnt * Point); else RandVar = (-(MathRand() + 0.0001)) / 767.0 * (doublecnt * Point); OpenPriceArray[cnt] += RandVar; } } }
Is there a way that we can limit the size of the ArrayCopyrates? It takes a long time for the backtesting.
ArrayCopyRates(double_array,"EURUSD",PERIOD_M15);

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
How can I rewrite the code so that it will always address EURUSD, PERIOD_M15? I have tried the following code:
I received the error message 'double_array" - array required.
BTW, how do I deal with if (ArraySize(Close) > 101)?