Buy signal after certain things have happened?

Hello,

I would like to test for layered signals.

I have a pattern I particularly look for but I need something else to happen first.

Say, given I have 3 consecutive higher high bars then I look for a shooting start bar to occur in the next 10 bars.

Is there a way to implement this ?

Thanks !

Try using BarsSince().

hh3 = your rules for 3 consecutive higher highs shootingStar = your rules for shooting star pattern mySignal = shootingStar && BarsSince(hh3) <= 10;

This should get you started. Use explorations to debug and refine your rules.

2 Likes

You might also want to investigate the Hold function.

RecentSignal = Hold(ThreeHigherHighs, 10);

https://www.amibroker.com/guide/afl/hold.html

2 Likes