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:
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 charttype 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.

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 15minute.

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.

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_______________
** 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.
