- Creating a ready-made Expert Advisor - MQL4/MQL5 Wizard
- Real and Generated Ticks - Algorithmic Trading, Trading Robots
- Parabolic SAR - Trend Indicators - Indicators - Charts - MetaTrader 5 for Android
It may sound strange, but try storing the symbol name in a variable first, then call the iLow with the string variable
Thanks for getting back to me.
I'm using MQL4.
I've just tried placing in a variable and doesn't seem to work either. So now I'm using..
string GBPUSD = "GBPUSD";
iLow(GBPUSD,PERIOD_D1,0);
This is still giving me incorrect values. However if I use iLow(NULL,PERIOD_D1,0); then I get the correct values. Really strange!.. I'm wondering if it's an issue where it's pulling the data from? any other ideas mate?
One final question: Is the problem occurring when you're trading live or during backtesting?
Hmmm OK, would need to see your code to debug further mate. MT4 can be pretty temperamental when it comes to multi timeframe and multi currency EAs & indicators. You can put it up here as an attachment or if you'd prefer to protect it, feel free to PM it to me and I'll have a look.
Ok mate I can paste some of the code in here. I was only running a simple Print statement at this stage to test a few pairs see if I can read the data in correctly.
string GBPUSD = "GBPUSD";
string EURUSD = "EURUSD";
string AUDUSD = "AUDUSD";
string USDJPY = "USDJPY";
double GBPUSD_low = iLow(GBPUSD,PERIOD_D1,0);
double EURUSD_low = iLow(EURUSD,PERIOD_D1,0);
double AUDUSD_low = iLow(AUDUSD,PERIOD_D1,0);
double USDJPY_low = iLow(USDJPY,PERIOD_D1,0);
Print("GBPUSD Low = ",GBPUSD_low);
Print("EURUSD Low = ",EURUSD_low);
Print("AUDUSD Low = ",AUDUSD_low);
Print("USDJPY Low = ",USDJPY_low);
It's just strange that it's giving me some data but not the same as I see on the charts. If I run the following it does give me the correct data that I see on the pair that the EA is trading.
double GBPUSD_low = iLow(NULL,PERIOD_D1,0);
Print("GBPUSD Low = ",GBPUSD_low);
Could it be to do with it being a demo account? The symbols all have a ".m" after the names, so for example "GBPUSD.m", would that make a difference to what I need to write in the string?
The symbols all have a ".m" after the names, so for example "GBPUSD.m", would that make a difference to what I need to write in the string?
Bingo!
Awesome!.. yes that seems to have worked!
Thanks for the help!
Awesome!.. yes that seems to have worked!
Thanks for the help!
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use