
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 MQL5 Experts, good afternoon!
Kindly ask for your help on this.
Please let me know if any additional information is required.
Thanks in advance!
Context:
I`ve built an EA on which I`m using EMA and MACD indicators inside the Expert Signal class. I`ve inherited the standard Expert Signal class and created my own. I`m using indicator classes CiMA and CiMyMACD (my custom implementation of CiMACD).
Issue:
Due to huge gaps between last day closing and current day opening prices, the indicators are not behaving as expected on the first N bars (screenshot attached).
Question:
How to begin indicators calculation from the first bar of the day, instead of the first bar on history?
Expected behaviour:
Code:
Indicator objects declaration:
Indicators init:
MA init (I`m using a 26 days period and applying EMA to closing prices):
MACD init (I`m using classical MACD period values 26 /12 /9 and applying it to the close prices):
Methods used for retrieving data from indicators: