Tuesday, December 2, 2008

A New Twist to the Gap Stat Calculator

Johnny Vento's gap stat calculator is a great tool that can help you make decisions in regards to swing trades.

One limitation is that you have to input the ticker symbol that you're interested in. You can't screen for a group of stocks and look at their gap statistics.

So, I designed a version that screens for stocks that have moved by a certain percentage, and then sorts them by the percentage of time they gap up or down.

Here's the "Gainer Gap Up" Filter. It finds stocks that have increased at least 10% from their open, and then calculates the percentage of time that the stock has gapped up the next day. It only looks at stocks that have met the 10% threshold more than 10 times in the last 100 days; otherwise, a stock that has increased by 10% only once and gapped up will have a 100% gap-up tendency. You want to have some sort of minimum sample to work with. You can change all of these numbers if you want.

The filter sorts by the percentage of time the stock has gapped up, from highest to lowest. This filter is probably best to use in bullish markets.

set {gain_threshold, 0.10} /* 10% gain */

set {ClOp , close - open}
set {ClOpPct , ClOp / open}

set {met_threshold_Yesterday , count(ClOpPct 1 day ago >= gain_threshold,1)}

set {gapped_up_today , count(open > close 1 day ago,1)}

set {gapped_down_today , count(open <>

set {met_threshold_then_gapped_up_today , met_threshold_yesterday * gapped_up_today}
set {met_threshold_then_gapped_down_today , met_threshold_yesterday * gapped_down_today}

set {met_threshold ,count(met_threshold_yesterday >= 1,100)}
set {then_gapped_up , count(met_threshold_then_gapped_up_today >= 1,100)}
set {then_gapped_down , count(met_threshold_then_gapped_down_today >= 1,100)}

add column met_threshold
add column then_gapped_up
add column then_gapped_down

set{gap_up_ratio, then_gapped_up / met_threshold}
set{gap_up_percent, gap_up_ratio * 100}

add column gap_up_percent

Close greater than Open
and ClOpPct greater than gain_threshold
and Volume greater than 100000
and Close less than 20
and Close greater than 0.1
and met_threshold greater than 10

sort by column 8 descending


Here's a variation of it, the "Loser Gap Up" filter. It finds stocks that have bounced the next day after a 10% loss, and sorts them by the % of time they've gapped up. This filter might be useful if you're looking for an overnight bounce play.


set {drop_threshold, 0.10} /* 10% drop */

set {OpCl , open - close}
set {OpClPct , OpCl / close}

set {met_down_threshold_Yesterday , count(OpClPct 1 day ago >= drop_threshold,1)}

set {gapped_up_today , count(open > close 1 day ago,1)}

set {gapped_down_today , count(open <>

set {met_down_threshold_then_gapped_up_today , met_down_threshold_yesterday * gapped_up_today}
set {met_down_threshold_then_gapped_down_today , met_down_threshold_yesterday * gapped_down_today}

set {met_down_threshold , count(met_down_threshold_yesterday >= 1,100)}
set {down_then_gapped_up , count(met_down_threshold_then_gapped_up_today >= 1,100)}
set {down_then_gapped_down , count(met_down_threshold_then_gapped_down_today >= 1,100)}


set{gap_up_ratio, down_then_gapped_up / met_down_threshold}
set{gap_up_percent, gap_up_ratio * 100}

add column met_down_threshold
add column down_then_gapped_up
add column down_then_gapped_down

add column gap_up_percent

Open greater than Close
and OpClPct greater than drop_threshold
and Volume greater than 100000
and Close less than 20
and Close greater than 1
and met_down_threshold greater than 10

sort by column 8 descending



Finally, here's the "Loser Gap Down" filter, which finds stocks that have a strong tendency to gap down after a 10% loss. This might be good for overnight shorts in downtrending charts.


set {drop_threshold, 0.10} /* 10% drop */

set {OpCl , open - close}
set {OpClPct , OpCl / close}

set {met_down_threshold_Yesterday , count(OpClPct 1 day ago >= drop_threshold,1)}

set {gapped_up_today , count(open > close 1 day ago,1)}

set {gapped_down_today , count(open <>

set {met_down_threshold_then_gapped_up_today , met_down_threshold_yesterday * gapped_up_today}
set {met_down_threshold_then_gapped_down_today , met_down_threshold_yesterday * gapped_down_today}

set {met_down_threshold , count(met_down_threshold_yesterday >= 1,100)}
set {down_then_gapped_up , count(met_down_threshold_then_gapped_up_today >= 1,100)}
set {down_then_gapped_down , count(met_down_threshold_then_gapped_down_today >= 1,100)}


set{gap_down_ratio, down_then_gapped_down / met_down_threshold}
set{gap_down_percent, gap_down_ratio * 100}

add column met_down_threshold
add column down_then_gapped_up
add column down_then_gapped_down

add column gap_down_percent

Open greater than Close
and OpClPct greater than drop_threshold
and Volume greater than 100000
and Close less than 20
and Close greater than 1
and met_down_threshold greater than 10

sort by column 8 descending





















0 comments: