# Gap Filter

Hello,

I have being trying to write a script that will filter out stocks that have experienced a gap between a low of a day and the high of the day just prior to this day of greater than 15% within the last 10 days.

A example of this would be for example sake CPH.asx that for whatever reason triggered on 18/6/2019, I would like to filter this trade out in a scan because of the huge approximately 20% gap up from 6/6/2019 high to 7/6/2019 low.

I have tried many versions of script such as -

h1=(LOW()-HIGH()[1])/HIGH()[1] < 0.10;
TIMESINCESIGNAL( lh1 == 0 ) , <= 10;

This works ok at 10% or less gap, but when I change < 0.10; to < 0.15 for < 15% gap, as per the attached screen shot from 24/6/2019 back in time all shows as a 1, I want it to drop to zero on 7/6/2019.

What do I need to change to achieve this?

When using < 0.10 and 0.15 the formula is using cents, not a percentage.

For a 10% gap above yesterday’s high use LOW() > (HIGH()[1]*1.1)

https://www.optuma.com/mind-the-gap/

Hello,
Thanks for the new “Gap Finder” tool mentioned above.

I have been trying to write a script to filter out trades in Back Tester and Scanning Manager as per follows -

• remove trades that have an unfilled gaps below current price, originating(23/11/2021) within the last 30 - 120 days - as per attached diagram for FMG 25/3/2022 trade trigger date.

This trade could have been triggered by a close cross of a daily 30MA for example, but because of the gap originating on 23/11/2021 I would like this trade automatically filtered out.

I have tried several different scripts including below, but unable to formulate something that works as desired.
I understand why the below code doesn’t work as required but have no idea how to make it right.

gapup1= LOW() - HIGH()[1] > 0.01;
gapdown1=LOW()[1] - HIGH() > 0.01;
tss1=TIMESINCESIGNAL(gapup1 or gapdown1) <= 10, == 0;

Perhaps using GAP() would simplify this but again I don’t know how to make it work.