StockFetcher Forums · Filter Exchange · Gap trade using yesterdays day range<< >>Post Follow-up
mktmole
325 posts
msg #52155
Ignore mktmole
6/11/2007 3:42:23 PM

I'm trying to figure out how to implement yesterday’s day range in a 11am gap trade.
In a gap down and reverse long situation, The Setup: is where the gap size is the amount todays open is below the low yesterday. This gap size should be greater than 5% of the high minus low day range yesterday.
The Entry Trigger: is when price has reversed back up above the low of yesterday by an amount that is 7% or greater of the high minus low day range yesterday.
Thanks!

nikoschopen
2,824 posts
msg #52159
Ignore nikoschopen
6/11/2007 4:35:55 PM

The gap size is the the difference between yesterday's low minus today's open AND this gap should be greater than 5% of yesterday's range:
Fetcher[
set{diff, low 1 day ago - open}
set{dpr, day point range 1 day ago}
set{gap_size, diff / dpr}
gap_size above 0.05
sign(diff) equals 1
]

I hope this is enough to get you on ure two feet to solve the second part of the equation on ure own.

For reference, here's a reversal gap filter I recently wrote by way of helping another user.



mktmole
325 posts
msg #52199
Ignore mktmole
6/13/2007 10:39:22 AM

Niko, Thank you for your help.
I can better understand the formula format above than in the link to your prior posting that you kindly provided... so along those lines i've taken a stab with the following which doesn't quite meet the original idea.
fetcher[set{diff, low 1 day ago - open}
set{dpr, day point range 1 day ago}
set{gap_dwn_size, diff / dpr}
gap_dwn_size above 0.05
sign(diff) equals 1
and add column gap_dwn_size
and open below low 1 day ago

set{diff2, low 1 day ago – price}
set{dpr2, day point range 1 day ago}
set{move_up, diff2 / dpr2}
and move_up above 0.05
and add column move_up {move_up%}
and market is not OTCBB
and price above 20
and average volume(45) above 200,000
and chart-type is bar]

Is it also possible to show trade confirmation by using Williams A/D and a 28 period MA of this A/D, when A/D moves above the MA for 2 consecutive bars?

Thanks again, MM

nikoschopen
2,824 posts
msg #52205
Ignore nikoschopen
6/13/2007 4:47:53 PM

By the premise of the first filter I wrote, We already know that the difference between today's open and yesterday's low (gap_size) has to be 5% or more of the yesterday's range. So if we want to write a second filter with a 7% or more of the yesterday's range, we merely need to add another 2% on top of the existing filter. Here's one of possibly many ways to write the second filter.

Fetcher[
set{diff, low 1 day ago - open}
set{dpr, day point range 1 day ago}
set{gap_size, diff / dpr}
gap_size above 0.05
sign(diff) equals 1

set{fill_gap, gap_size * 1.4} /*which equals 7 percent if we consider gap_size to be 5 percent*/
opcl% above fill_gap
close above low 1 day ago


add column low 1 day ago{low-1}
add column open
add column diff
add column dpr
add column gap_size
add column fill_gap
]



mktmole
325 posts
msg #52212
Ignore mktmole
6/14/2007 12:00:31 PM

Thank you niko.
Does the above take into consideration the Low of yesterday?
From the original post... "the Entry Trigger: is when price has reversed back up above the low of yesterday by an amount that is 7% or greater of the high minus low day range yesterday."

If yes, when the scan is run intraday today at 11:30.. SNY and REX for example appear and do not meet the above condition?

MM


nikoschopen
2,824 posts
msg #52213
Ignore nikoschopen
6/14/2007 1:15:03 PM

Yes, the 8th line ("close above low 1 day ago") should take care of that. I just ran the filter and, with the exception of one or two, almost all of them looked okay. I think it's the bug with StockFetcher. Also keep in mind the SF data is delayed by 15-minute.

nikoschopen
2,824 posts
msg #52214
Ignore nikoschopen
6/14/2007 3:41:54 PM

Try the filter below. It's the identical filter as above, but without the HTML tags. I didn't run into any inconsistency running this one.

Fetcher[
set{diff, low 1 day ago - open}
set{dpr, day point range 1 day ago}
set{gap_size, diff / dpr}
gap_size above 0.05
sign(diff) equals 1

set{fill_gap, gap_size * 1.4}
opcl% above fill_gap
close above low 1 day ago

add column low 1 day ago{low-1}
add column open
add column diff
add column dpr
add column gap_size
add column fill_gap
]





mktmole
325 posts
msg #52247
Ignore mktmole
6/15/2007 11:48:41 AM

Works A1 without the HTML!

To add the final piece to the puzzle how would it be possible include the trade confirmation buy using a 28 period MA of Williams A/D, when A/D crosses and is above the MA for 2 consecutive bars?

** many thanks, MM



nikoschopen
2,824 posts
msg #52257
Ignore nikoschopen
modified
6/15/2007 6:44:24 PM

Unfortunately, StockFetcher currently doesn't support Williams A/D, although it has Williams %R. So I had to write one manually based on a formula I got off the Internet:

_______________
To calculate the Williams' Accumulation/Distribution indicator, determine:

1. True Range High (TRH) = Yesterday's close or today's high whichever is greater

2. True Range Low (TRL) = Yesterday's close or today's low whichever is less

The day's accumulation/distribution is then calculated by comparing today's closing price to yesterday's closing price.

3.If today's close is greater than yesterday's close:

Today's A/D = today's close - TRL

4. If today's close is less than yesterday's close:

Today's A/D = today's close - TRH

If today's close is the same as yesterday's close then the A/D is zero.

The Williams' Accumulation/Distribution indicator is a cumulative total of the daily values:

Williams A/D = Today's A/D + Yesterday's Williams A/D
_______________


Fetcher[
/*Gap Rversal*/

set{diff, low 1 day ago - open}
set{dpr, day point range 1 day ago}
set{gap_size, diff / dpr}
gap_size above 0.05
sign(diff) equals 1

set{fill_gap, gap_size * 1.4}
opcl% above fill_gap
close above low 1 day ago

add column separator
add column low 1 day ago{low-1}
add column open
add column diff
add column dpr
add column gap_size
add column fill_gap

do not draw gap_size
do not draw fill_gap
do not draw opcl%
do not draw diff

/*Williams' Accumulation/Distribution*/

set{TRH, max(close 1 day ago, high)}
set{TRL, min(close 1 day ago, low)}

set{Chg, sign(day change)}
set{Chg_Up, close - TRL}
set{Chg_Down, close - TRH}

set{If1, count(Chg equals 1,1) * Chg_Up}
set{If2, count(Chg equals -1,1) * Chg_Down}
set{Then, If1 + If2}
set{Then2, Then 1 day ago}
set{WAD, Then + Then2}
set{Williams.AD, sum(WAD,90)}
draw cma(Williams.AD,28) line at 0

price above 20
avgvol(17) above 300000

add column separator
add column Williams.AD
]


** Before I wrap this up, some explanations are needed:

First, as you might notice from the charts, some will look very different from what you would see from other data vendors. The reason for this is that Williams' A/D is (I paraphrase from the description above) a cumulative total of the daily values, and yet it doesn't tell me just what "cumulative" means. Hence I used an arbitrary number, 90 trading days in this case, as the base number.

Second, I ran into a brick wall (aka perfomance constraints) when I tried to add your last criterion, A/D crosses above the MA(28) for 2 consecutive bars (or "count(Williams.AD above cma(Williams.AD,28),2) above 1") to the above filter. Only thing I got was a "blank" webpage.

StockFetcher Forums · Filter Exchange · Gap trade using yesterdays day range<< >>Post Follow-up

*** Disclaimer *** StockFetcher.com 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. StockFetcher.com does not recommend particular securities. StockFetcher.com, 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