StockFetcher Forums · General Discussion · A COMPLETE LOGIC SYSTEM - ANOTHER GIFT FROM AVERY<< 1 ... 4 5 6 7 8 ... 10 >>Post Follow-up
jaketheguy
52 posts
msg #37992
Ignore jaketheguy
9/16/2005 3:07:10 AM

***********************
9/13/2005 10:49:15 PM

again...

...I'm trying to isolate a "Measuring Bar" (ie. a day that is a minimum of five days ago) whose High is HIGHER than EITHER the Open OR Close for EACH of the subsequent 4 days...AND...whose Low is LOWER than EITHER the Open OR Close for EACH of the subsequent 4 days. As long as the Open OR Close of the subsequent 4 days falls within the High/Low Range of the "Measuring Bar Day" that's acceptable. Not necessarily looking for "inside days" subsequent to the "Measuring Bar" Day but they DO fit the criteria and are okay. If the High/Low Range of any of the subsequent 4 days is outside the High/Low Range of the "Measuring Day" that's okay too. As long as either the Open OR Close falls within the "Measuring Day" Range that's what I'm wanting.

Thanks again for any help !


alf44
***********************

To get started, the 'brute-force' filter below falls within your constraints (at least as I understand them):

open and close 3 days ago is below high 4 days ago
open and close 3 days ago is above low 4 days ago
open and close 2 days ago is below high 4 days ago
open and close 2 days ago is above low 4 days ago
open and close 1 days ago is below high 4 days ago
open and close 1 days ago is above low 4 days ago
open and close is below high 4 days ago
open and close is above low 4 days ago


jaketheguy
52 posts
msg #37993
Ignore jaketheguy
9/16/2005 3:35:18 AM

To get started, the 'brute-force' filter below falls within your constraints (at least as I understand them):

open and close 3 days ago is below high 4 days ago
open and close 3 days ago is above low 4 days ago
open and close 2 days ago is below high 4 days ago
open and close 2 days ago is above low 4 days ago
open and close 1 days ago is below high 4 days ago
open and close 1 days ago is above low 4 days ago
open and close is below high 4 days ago
open and close is above low 4 days ago
******************************************************


So why do the following two more concise attempts at the above filter produce different results?

open for the last 3 days has been below the high 4 days ago
close for the last 3 days has been below the high 4 days ago
open for the last 3 days has been above the low 4 days ago
close for the last 3 days has been above the low 4 days ago


open has been below high 4 days ago for the last 3 days
close has been below high 4 days ago for the last 3 days
open has been above low 4 days ago for the last 3 days
close has been above low 4 days ago for the last 3 days


jaketheguy
52 posts
msg #37994
Ignore jaketheguy
9/16/2005 4:09:53 AM

Neither does the following seem to work correctly, erroneously returning symbol ACP:

Fetcher[ set{hi4, high 4 days ago}
set{lo4, low 4 days ago}
hi4 has been above open for the last 3 days
hi4 has been above close for the last 3 days
lo4 has been below open for the last 3 days
lo4 has been below close for the last 3 days
]



I'm obviously new, but what am I missing?



jclaffee
81 posts
msg #37995
Ignore jclaffee
9/16/2005 9:04:20 AM

Jake, try this:

Fetcher[set{hi4, High 4 days ago}
and set{lo4, Low 4 days ago}
and hi4 is above Open last 3 days
and hi4 is above Close last 3 days
and lo4 is below Open last 3 days
and lo4 is below Close last 3 days
]



Jim


alf44
2,025 posts
msg #37998
Ignore alf44
9/16/2005 9:12:11 AM

jaketheguy,

First, thanks for the response and the effort.

With your filter you have defined a series of days whose Open AND Close BOTH fall within the High/Low Range of some bar 5 days ago. And while...technically it fits into the criteria that I tried to define...that's not exactly what I was looking for. Your filter would EXCLUDE those days where ONLY the Open...OR...ONLY the Close fell into the High/Low Range of a day 5 days ago. And THAT is the tricky part that I (and others apparently) haven't been able to solve (yet).

Again, thanks for your thoughts and I hope you'll feel free to offer more !



alf44





jaketheguy
52 posts
msg #38000
Ignore jaketheguy
9/16/2005 10:55:56 AM

Hey Jim,

Your filter returns the same 110 stocks as mine. However, there seems to be an error in StockFetcher, because one of the returned stocks is ACP, which, if you look at its open and close the last three days, you'll see that it failed the filter criteria on 12 Sept.

Thanks.


jclaffee
81 posts
msg #38001
Ignore jclaffee
9/16/2005 12:14:04 PM

Ouch!

I failed to run your filter, Jake, and I ASSUMED that it had produced only the one hit. Sorry 'bout that.

I see the fault with the issue you mentioned. . .I'll smoke that over a little this time!

Jim


jaketheguy
52 posts
msg #38002
Ignore jaketheguy
9/16/2005 12:31:38 PM

Hey alf, see below for the solution to your problem. This problem demonstrates well the concepts that were the subject of this thread:


Fetcher[
/* open OR close 3 days ago is below high 4 days ago
AND open OR close 3 days ago is above high 4 days ago
AND open OR close 2 days ago is below high 4 days ago
AND open OR close 2 days ago is above high 4 days ago , etc.
*/

set{hi4, high 4 days ago}
set{lo4, low 4 days ago}

set{3A, count(open below hi4, 1) 3 days ago}
set{3B, count(close below hi4, 1) 3 days ago}
set{OR31, 3A + 3B}
set{3C, count(open below hi4, 1) 3 days ago}
set{3D, count(close below hi4, 1) 3 days ago}
set{OR32, 3C + 3D}
set{AND3, OR31*OR32}

set{2A, count(open below hi4, 1) 2 days ago}
set{2B, count(close below hi4, 1) 2 days ago}
set{OR21, 2A + 2B}
set{2C, count(open below hi4, 1) 2 days ago}
set{2D, count(close below hi4, 1) 2 days ago}
set{OR22, 2C + 2D}
set{AND2, OR21*OR22}

set{1A, count(open below hi4, 1) 1 days ago}
set{1B, count(close below hi4, 1) 1 days ago}
set{OR11, 1A + 1B}
set{1C, count(open below hi4, 1) 1 days ago}
set{1D, count(close below hi4, 1) 1 days ago}
set{OR12, 1C + 1D}
set{AND1, OR11*OR12}

set{0A, count(open below hi4, 1)}
set{0B, count(close below hi4, 1)}
set{OR01, 0A + 0B}
set{0C, count(open below hi4, 1)}
set{0D, count(close below hi4, 1)}
set{OR02, 0C + 0D}
set{AND0, OR01*OR02}

set{ANDALL, AND3*AND2*AND1*AND0}

show stocks where ANDALL is equal to 1
]




jaketheguy
52 posts
msg #38003
Ignore jaketheguy
9/16/2005 12:59:42 PM

Jake, try this:

Fetcher[set{hi4, High 4 days ago}
and set{lo4, Low 4 days ago}
and hi4 is above Open last 3 days
and hi4 is above Close last 3 days
and lo4 is below Open last 3 days
and lo4 is below Close last 3 days
]




Jim
****************************************
Jim, The phrase "4 days
ago", as in,

set{hi4, high 4 days ago}

will actually be the 5th candle or bar on the chart, so you would want to change the other phrases to: and hi4 is above Open last 4 days.

However, as explained by Tom from StockFetcher in an email response, this does not really do my original intention of keeping both the OPEN and CLOSE of the last 4 days within the High Low range of the 5th day back. The reason being that "hi4" is not a constant but changes based on the "last 3 days" phrase.

For example the phrase:
hi4 is above Open last 3 days

Will make the following comparisons:

hi4 0 days ago is above open 0 days ago
hi4 1 day ago is above open 1 day ago
hi4 2 days ago is above open 2 days ago

The correct filter to do that is as follows, complements of Tom:

Fetcher[set{hi4, high 4 days ago}
set{lo4, low 4 days ago}
open 4 day high is below hi4
and open 4 day low is above lo4
and close 4 day high is below hi4
and close 4 day low is above lo4
]



Thanks Tom!


alf44
2,025 posts
msg #38005
Ignore alf44
9/16/2005 1:42:44 PM

jaketheguy,

You posted:

-----------------------

Hey alf, see below for the solution to your problem. This problem demonstrates well the concepts that were the subject of this thread:



Fetcher[
/* open OR close 3 days ago is below high 4 days ago
AND open OR close 3 days ago is above high 4 days ago
AND open OR close 2 days ago is below high 4 days ago
AND open OR close 2 days ago is above high 4 days ago , etc.
*/

set{hi4, high 4 days ago}
set{lo4, low 4 days ago}

set{3A, count(open below hi4, 1) 3 days ago}
set{3B, count(close below hi4, 1) 3 days ago}
set{OR31, 3A + 3B}
set{3C, count(open below hi4, 1) 3 days ago}
set{3D, count(close below hi4, 1) 3 days ago}
set{OR32, 3C + 3D}
set{AND3, OR31*OR32}

set{2A, count(open below hi4, 1) 2 days ago}

more...
]


----------------------

In order to fit the criteria as I have described in my previous posts your opening description SHOULD read:

open OR close 3 days ago is below high 4 days ago
AND open OR close 3 days ago is above "LOW" 4 days ago
AND open OR close 2 days ago is below high 4 days ago
AND open OR close 2 days ago is above "LOW" 4 days ago , etc


As for the filter that you wrote...did you run it ? And if so...did it return any results ? I didn't have any luck with it when I tried.


alf44






StockFetcher Forums · General Discussion · A COMPLETE LOGIC SYSTEM - ANOTHER GIFT FROM AVERY<< 1 ... 4 5 6 7 8 ... 10 >>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