double GBPUSD[][6]; double USDCHF[][6]; : int init(){ ArrayCopyRates(GBPUSD, "GBPUSD", PERIOD_D1); ArrayCopyRates(USDCHF, "USDCHF", PERIOD_D1); :
Is there some ideas that causes the problem ?
1. Correct the array declaration and its use and make the loop dynamic by using ArraySize() rather than coding a hard number (such as 9). For example (code not compiled or tested):
string SymbolPairs[] = {"EURUSD", "GBPUSD", "USDCHF", "USDJPY", "EURGBP", "EURCHF", "EURJPY", "CHFJPY", "USDEUR"}; for (int a = 0; a <= ArraySize(SymbolPairs) - 1; a++) { string array_name = SymbolPairs[a]; string symbol_pairs = SymbolPairs[a]; ... }
2. ArrayCopyRates() expects an array as its first argument. You are simply supplying it a string, not a variable.
ArrayCopyRates(array_name, symbol_pairs, PERIOD_D1); // I am doing actual ArrayCopyRates, that each time uses other Array and Currency pair
This is the root cause of the error you received. Supply an array as the first argument to ArrayCopyRates(), not a string of characters which you think represents the name of the array.
1. Correct the array declaration and their use and make the loop dynamic by using ArraySize() rather than coding a hard number (such as 9). For example (code not compiled or tested):
2. ArrayCopyRates() expects an array as its first argument. You are simply supplying it a string, not a variable.
This is the root cause of the error you received. Supply an array as the first argument to ArrayCopyRates(), not a string of characters which you think represents the name of the array.
Ok, thanks for answer. I did it. It works.
But how can I retrieve all array in way to see them in alerts ?
I tried such code. But it just retrieves SymbolPair name. But with
array_name[u][]
'[' - unexpected token C:\Program Files (x86)\MetaTrader 4\experts\multi_chart.mq4 (53, 25) //this is error using code above
Full code for alert
for (int u=0;u <= ArraySize(SymbolPairs) - 1;u++) Alert(array_name[u][], symbol_pairs);

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
HI,
I want to be able place 9 currency pair rates inside array specified to that pair. Compiles successfully without errors, so there is no syntax errors in the code. But In Terminal when I am launching EA in message window, it shows this kind off error:
I am using this code.
Is there some ideas that causes the problem ?
Thank You!