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
Hi everyone, I ran into quite a perplexing problem today. There are many symbols that I cannot select or get information from in my EA. In fact, it seems as if there's a bug within MQL4 itself.
The following EA provides different results when ran in the debugger vs a strategy tester (both using the GBPCAD chart).
On the debugger in live data, the following is printed:
2020.08.23 11:25:20.011 Exit Backtester GBPCAD,Daily: USDCAD visible
2020.08.23 11:25:20.011 Exit Backtester GBPCAD,Daily: It worked
On the strategy tester near the beginning of 2017, the following is printed:
2020.08.23 11:26:01.200 2017.02.09 00:00:00 Exit Backtester GBPCAD,Daily: Couldn't select USDCAD
2020.08.23 11:26:01.200 2017.02.09 00:00:00 Exit Backtester GBPCAD,Daily: USDCAD isn't visible
2020.08.23 11:26:01.200 2017.02.09 00:00:00 Exit Backtester GBPCAD,Daily: It didn't work, 4106
Where error code 4106, according to the documentation, states that the symbol is not selected in Market Watch or found in the list of "available ones".
However, running the following code:
2020.08.23 11:38:03.235 Exit Backtester GBPCAD,Daily: 18 USDCAD
So SymbolName proves that USDCAD is available, while SymbolSelect, SymbolInfoInteger, and SymbolInfoDouble prove otherwise.
Why is this the case? I'm attempting to automatically buy and sell in my EA, and it's important that I'm able to get symbol info from other symbols to calculate the correct amount of lots I need. This doesn't seem to be possible inside the strategy tester.