Bad signal logic

Course Name: Technical Indicators Strategies in Python, Section No: 12, Unit No: 12, Unit type: Notebook

Hello,

In this notebook we use the following logic to generate trading signals:

Buy when ema_short > ema_long AND ema_short > ema_medium.
However this logic has a flaw: it can enter in buy even when medium trend is bearish (red=long, orange=medium, blue=short):

For fixing this we should use the following logic:

Buy when ema_short > ema_medium and ema_medium > ema_long


In that way we'll only enter in a buy when:

Both trends, medium and long are below short term.

Hi Daniel,



As per the strategy explained in Section 12 Unit 1 of the course, the condition to enter a long position requires the short_ema to cross the medium and long_ema from below. 



The alternative logic suggested by you is slightly more conservative and would result in fewer signals. However, its best to backtest both strategies to understand which one performs better.



Thanks

Rushda

Understood, thanks!