Need help with EA: how to implement trend filtering via triple EMA of daily level for EA trading in H1?
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
Hello, I've written an EA which trades Pivot Points, you'll find their calculation inside the EA. It may look more complicated than needed, but I wanted to use a certain hourly Close for indicator calculation. This works fine.
What troubles me is the implementation of trend filtering. I'd like to use a simple filter from daily timeframe, i.e. comparison between EMA 9,12,26: buy would be allowed if 9>12>26, sell if 9<12<26, no trades allowed if other combination.
The way the EA is written, it seems that the condition is checked only once and not for every bar as intended. I'm clueless, why this is so. Either I get only buys or only sells, which means that some data is provided by the if-conditions in line 164ff, but it doesn't actualize as it should.
Where is the mistake? Can anybody provide an example of a solution? Please help!
Regards,
PomeGranate