Does someone have any idea? I've been searching around to really no avail.
gadget:
Ok the question didn't trigger tons of suggestions, but just to close the question I found the problem. It was due to the MQL compiler not initializing a local variable. Admins are free to remove this subject if they want.
Ok the question didn't trigger tons of suggestions, but just to close the question I found the problem. It was due to the MQL compiler not initializing a local variable. Admins are free to remove this subject if they want.
See documentation :
If a variable is not initialized explicitly, the value stored in this variable can be any. Implicit initialization is not used.

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
Dear community,
A EA that I have playing with uses the iADX function.
When I debug I have:
iADX (NULL, ADXTime, ADXPeriod, ADXPrice, MODE_PLUSDI, 0) i.e. value of current +DX always returns a value.
iADX (NULL, ADXTime, ADXPeriod, ADXPrice, MODE_PLUSDI, 1) i.e. value of previous +DX always returns a value.
iADX (NULL, ADXTime, ADXPeriod, ADXPrice, MODE_MINUSDI, 0) i.e. value of current -DX always returns a value.
iADX (NULL, ADXTime, ADXPeriod, ADXPrice, MODE_MINUSDI, 1) i.e. value of previous -DX always returns 0!
Any idea on the reason?
The chart clearly displays the ADX lines. Why would MetaTrader return 0?