Curious Mind:
Am I using the StringConcatenate plain wrong?
You don't need StringConcatenate().
Do something like this:
string cur_1 = "EURUSD"; double cur_1_open = iOpen(cur_1,PERIOD_M1,1); if ( cur_1_open == 0 ) { Print("Error ", GetLastError()); }
Anthony Garot:
That was it! Can't believe how I'd miss that!! Much appreciated, Anthony Garot!!
You don't need StringConcatenate().
Do something like this:
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
Been struggling for hours now on apparently easy task. If someone could point out my error, please? I would like to use StringConcatenate with "iOpen" (or iTime, iHigh, iLow, iClose).
Instead, I would like to avoid hard-coding the currencies part into the code. Reason: many currencies in the list and I would like to be able to swap currencies out with changing the name of currency in one place only.
To accomplish that, I am looking at the following option:
Both attempts give me the same ERROR: 'iOpen' - undeclared identifier;
What am I doing wrong? Why is it asking for the iOpen to be "declared", if the "default" way of coding it iOpen("EURUSD",PERIOD_M1,1) does NOT ask for the iOpen to be "declared". Am I using the StringConcatenate plain wrong?