Where am I going wrong...
Here is my Python code which interacts with the MetaTrader5 API.
Note the calculate_ema function. and the get_bars function. I am simply getting inaccurate/wrong values.
I want the Exponential Moving Average values for the quantity of bars requested in the get_bars function. I want to access the 8MA and 20MA for the quantity of bars requested. Even if that quantity is only 1. So the function requests at least 20 bars so that this can be calculated. However the values I end up with for the 8MA and 20MA are not the same as my MT5 Moving Average indicator on Exponential mode, (on close).
Thanks in advance.
- Finding the intersection point
- Questions from Beginners MQL5 MT5 MetaTrader 5
- Setting up an EMA indicator

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