StockFetcher Forums · Filter Exchange · HELP IN FILTER THAT MAY WORKS GREAT<< >>Post Follow-up
74 posts
msg #82157
Ignore jnafach
10/30/2009 7:29:25 PM

Well I am inteested if there is way to see if can know on each ETF that out of last 365 days for exmaple,
If there is gap up how many days it close higher than open and if there is gap down how many times it drop to the day so close is lower than open.
it seems quite frequent for me and if this is correct then if gapping up will buy at open and sell at close and vise versa
I appreciate all help

3,847 posts
msg #82168
Ignore Kevin_in_GA
10/31/2009 8:16:25 AM

Please do a search of the past forum threads. This is a well-TROdden road.

I have copied TRO's Gap Statistics filter, and added the line "and stock is ETF". Look at the filter construction and results - you can learn a lot from this one.

Based on my run of this filter,I reduced the gap filled % requirement from 80 to 70, to provide more hits.




/* 80% or greater selection criteria */
and gapfilled > 70

/* gap fill statistics */

set{Xgapped, open - close 1 day ago}
set{Xgapup, count(Xgapped > 0, 1)}
set{Xgapdn, count(Xgapped < 0, 1)}

set{absgap, abs(Xgapped)}

set{gappedup100, count(Xgapup > 0, 100)}
set{gappeddn100, count(Xgapdn > 0, 100)}

set{cl1lo, close 1 day ago - low}
set{hicl1, high - close 1 day ago }

set{fillup, count(cl1lo > 0, 1)}
set{filldn, count(hicl1 > 0, 1)}

set{gapupfilled, Xgapup * fillup }
set{gapdnfilled, Xgapdn * filldn }

set{gapup100f, count(gapupfilled > 0, 100)}
set{gapdn100f, count(gapdnfilled > 0, 100)}

set{gapfilled, gapup100f + gapdn100f}




and add column gappedup100
and add column gappeddn100
and add column gapfilled
and add column gapup100f
and add column gapdn100f

and add column cma(absgap, 100)
and add column absgap 100 day high
and add column absgap 100 day low


and stock is etf



265 posts
msg #82169
Ignore trendscanner
10/31/2009 8:49:29 AM

JNA, Kevin's mod to the TRO Fill The Gap filter may be of some help to you and is worth reviewing. Many times rather than continuing in the direction of the gap, individual stocks will reverse and close the gap during the day.

My reading of your post suggests that you're not looking to fade the gap but expecting the etf to continue for the rest of the day in the direction of the gap, and you would buy gap-ups in the morning and sell them at the end of the day, while doing the opposite for gap-downs (short them in the am, buy them back in pm).

The filter below may help give you some ideas about how to do that, using spy as an example. At least from a visual perspective, you can see where the gap-ups occurred. The chart is easier to read if you click on the 3 month enlarge link.

set{GapU, Count(Close-to-open gap > 0.5, 1)}
apply to symlist(spy)
draw GapU
draw Slow Stochastics Slow %D(10)
chart-length is 6 months

From looking at the chart, I think you're strategy could be successful many times, although there are occasions when it would not have worked for the spy. You might get more consistent results by matching gap-ups with confirmation from a slow stochastic or other indicator to confirm intermediate market direction.

SF doesn't allow a same day buy-sell strategy to be backtested. There is probably some other software available that could backtest that strategy.

For the filter above, you can delete the symlist line to see other etfs. And you can change the ">" to a "<" to look for gap downs.

There are probably other threads on the forum where ideas swing trading etfs are discussed.

best of luck

3,847 posts
msg #82175
Ignore Kevin_in_GA
10/31/2009 10:18:18 AM

If you are looking for stocks where the gap is NOT filled, just change the selection criterion to "gapfilled <20". This will give you only those ETFs that did NOT fill the gap 80% of the time or greater. This will not tell you if the price went in the direction you want, though (it will only tell you that it did not fill the gap).

Alternatively, you can write the following:


set{gap, open - close 1 day ago}
set{gap_up, count(gap > 0.1,1)}
set{gap_down, count(gap < -0.1,1)}

set{gap_up100, count(gap > 0.1,100)}
set{gap_down100, count(gap < -0.1,100)}

/*This will return a value of 1 if the gap up or down is greater than 10 cents (you can set this value at whatever you want)*/

set{move_up, count(open > close,1)}
set{move_down, count(open < close,1)}

/*This will return a value of 1 if the stock moves up or down from the open.*/

/*Now you combine the two to find only those stocks which gap and continue in the SAME direction*/

set{keep_moving_up, gap_up + move_up}
set{blast_off, count(keep_moving_up > 1.1,1)}
set{blast_off_100, count(keep_moving_up > 1.1,100)}

set{keep_moving_down, gap_down + move_down}
set{timber, count(keep_moving_down > 1.1,1)}
set{timber_100, count(keep_moving_down > 1.1,100)}

set{down_pct, timber_100 / gap_down100}
set{up_pct, blast_off_100/ gap_up100}

/* These will select for stocks that keep moving in the direction of the gap*/
/* up_pct and down_pct are the percentage of times the gap up or down continued in the same directrion for that particular ETF*/

add column gap_up100
add column blast_off_100
add column up_pct
add column gap_down100
add column timber_100
add column down_pct

/*selection criteria*/

close is above 3

If you run this filter early in the day (once the gap is identified), you have the statistical data in hand to determine for a given ETF if it is likely to close in the direction of the gap, or fade it.

74 posts
msg #82185
Ignore jnafach
10/31/2009 1:49:25 PM

sems fading gap is better option, now is there a way that we can back test and see if close position at close if do not fade , or close position when if fade the gap, how much would that make, I think the best seems to be IYT and XLV as have pretty decent volume and we need that to have very limited range between bid and ask

StockFetcher Forums · Filter Exchange · HELP IN FILTER THAT MAY WORKS GREAT<< >>Post Follow-up

*** Disclaimer *** does not endorse or suggest any of the securities which are returned in any of the searches or filters. They are provided purely for informational and research purposes. does not recommend particular securities., Vestyl Software, L.L.C. and involved content providers shall not be liable for any errors or delays in the content, or for any actions taken based on the content.

Copyright 2016 - Vestyl Software L.L.C.Terms of Service | License | Questions or comments? Contact Us
EOD Data sources: DDFPlus & CSI Data Quotes delayed during active market hours. Delay times are at least 15 mins for NASDAQ, 20 mins for NYSE and Amex. Delayed intraday data provided by DDFPlus