How to avoid entry signals which occur around the previous pivot or congestion area?

Hi all,

When testing a system. I found that some of the entries are in the area of either previous high or congestion zones, which lead to failure most of the time.

I would really appreciate any help to avoid such trades as I am unable to code it.

Cheers,
Scott

There are several ways to achieve that, but as an example you can define the rule that determines the congestion zone, and then guarantee that your entry rule is not in a congestion zone.

This example prevents any buy entry, if there is any bar defined as congestion, within the last 10 bars.

longsignal= Cross(C,MA(C,10)); // example condition
lookback=10; // bars
congestion= ADX(14)<15; //  congestion variable has non zero values if congestion is true

Buy= longsignal AND Sum(congestion,lookback)==0; 
1 Like

hi pmxgs,

Thanks for the suggestion, it's interesting. I will give it a go.

Cheers,
Scott