
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
That's why a Truly Event-Driven approach is imperative for this language... We cannot to hold on on bad programming practices, like "polling" the status of something unnecessarily until we get the desired result... The MQL5 is complex enough to get this out of scope... And that's why is a mess to make very good EAs, considering also the adversity of the Brokers and behavioral sh*ts that happens all the time...
I have developed an Expert Advisor (EA) in MQL5 that uses the MACD indicator. However, during backtesting, I consistently encounter the error:
Key Details of the Implementation:
MACD Initialization:
Buffer Copying:
Error Handling:
Additional Observations:
Code Snippet: File attach + image backtest (MACD indicator have data)
Attempts to Resolve:
Question:
If anyone has encountered a similar issue or has insights into resolving this, your help would be greatly appreciated!
Thank you in advance! 😊
it's because you specify the MACD timeframe to a fixed timeframe
I see you fix it to PERIOD_M1, but you should rather have it like that to avoid 4806 error:
The software isn't fully matured yet to properly handle 4806, and BarsCalculated won't do anything to make the error go away, so you have to specify current timeframe and leave fixed timeframe stuff for indicators.
You can try ArraysSetAsSeries to set the macd buffer as series, but I think it's safer to make a custom indicator for multi-timeframe data