StockFetcher Forums · General Discussion · A COMPLETE LOGIC SYSTEM - ANOTHER GIFT FROM AVERY<< 1 2 3 4 5 ... 10 >>Post Follow-up
Icculi
9 posts
msg #33481
Ignore Icculi
10/3/2004 11:02:17 PM

Anyone know why this won't work:

Fetcher[
SET{BB0,COUNT(CLOSE IS BELOW LOWER BOLLINGER BAND(20),1)}
SET{BB1,COUNT(LOW 1 DAY AGO IS BELOW LOWER BOLLINGER BAND(20) 1 DAY AGO,1)}
SET{BB2,COUNT(LOW 2 DAYS AGO IS BELOW LOWER BOLLINGER BAND(20) 2 DAYS AGO,1)}
SET{BB3,COUNT(LOW 3 DAYS AGO IS BELOW LOWER BOLLINGER BAND(20) 3 DAYS AGO,1)}
SET{BB4,COUNT(LOW 4 DAYS AGO IS BELOW LOWER BOLLINGER BAND(20) 4 DAYS AGO,1)}
SET{BB5,COUNT(LOW 5 DAYS AGO IS BELOW LOWER BOLLINGER BAND(20) 5 DAYS AGO,1)}
SET{CC0,COUNT(CLOSE HAS BEEN DECREASING FOR 3 DAYS,1)}
SET{CC1,COUNT(CLOSE HAS BEEN DECREASING FOR 4 DAYS,1)}
SET{CC2,COUNT(CLOSE HAS BEEN DECREASING FOR 5 DAYS,1)}
SET{CC3,COUNT(CLOSE HAS BEEN DECREASING FOR 6 DAYS,1)}
SET{CC4,COUNT(CLOSE HAS BEEN DECREASING FOR 7 DAYS,1)}
SET{CC5,COUNT(CLOSE HAS BEEN DECREASING FOR 8 DAYS,1)}
SET{MM0,BB0 * CC0}
SET{MM1,BB1 * CC1}
SET{MM2,BB2 * CC2}
SET{MM3,BB3 * CC3}
SET{MM4,BB4 * CC4}
SET{MM5,BB5 * CC5}
SET{OR1,MM0 + MM1}
SET{OR2,OR1 + MM2}
SET{OR3,OR2 + MM3}
SET{OR4,OR3 + MM4}
SET{OR5,OR4 + MM5}
AND OR5 IS ABOVE 0
]



Is there a limit on the number of set statements that can be used?




cegis
235 posts
msg #33483
Ignore cegis
10/4/2004 12:57:30 PM

Icculi,

There is no limit to the number of set{} statements in a filter (that I am aware of, although the syntax checker currently complains if there are more than 10). However, there is a limit how many times the set{} command can be "nested" - that is, one set{} being based on another. The number of nestings depends on the functions used, so I can't state an exact number. Very likely (due to the 5 OR's), you have hit the limit.

To determine if this is the case, you can use the "add column" phrase for each of your set{} statements. If any don't show up, there's EITHER a syntax problem (typo), or you hit the limit.

One thing you might want to try, is to not use set{} for the BB and CC variables. When calculating the MM variables, use the count()'s that are in the BB and CC set{}s, like so: set{MM0, COUNT(CLOSE IS BELOW LOWER BOLLINGER BAND(20),1) * COUNT(CLOSE HAS BEEN DECREASING FOR 3 DAYS,1)}. This *DOES* work sometimes, as I have done it before. (I haven't tried in this case, though...)

Another possibility that you could try is simply break the filter up into two or more filters, then create a watch list that auto-fills using the resulting filters. (This would work if the problem IS the nesting of the OR set{}s.)

Another possibility, although it might be some work to figure out correctly, is to use the fact that

(A or B) = NOT[ NOT(A) and NOT(B) ]

as well as

(A and B) = NOT[ NOT(A) or NOT(B) ].

This may get you to a point where your selection condition could read as a series of 5 AND's. "Thinking out loud" (i.e., this may be wrong, test it), that would give:

SET{CC0,1 - COUNT(CLOSE HAS BEEN DECREASING FOR 3 DAYS,1)}
set{MM0, count(close >= lower bolinger band(20),1) + CC0}

<etc. for MM1 thru MM5...>

MM0 * MM1 * MM2 * MM3 * MM4 * MM5 is equal to 0

What this is doing is, for CC0, calculating the NOT of your CC0, and for MM0, it uses the opposite condition of your BB0, and ORs that with my CC0. That makes my MM0 compute to NOT(yourBB0) or NOT(yourCC0), and to NOT that, I just make sure the answer is zero. (I'm not sure if this is 100% right, but it gives you an idea of what I'm talking about...) Note that the maximum number of nesting levels is only one (CC0 within MM0, CC1 within MM1, etc.), instead of your six (BB0 within MM0, MM0 within OR1, OR1 within OR2, etc.).

HTH,

C


xplorer
257 posts
msg #33485
Ignore xplorer
10/4/2004 1:04:05 PM

Your logic looks good ... but I think it is too restrictive ...

You may want to loosen your constraints a bit ....




xplorer
257 posts
msg #33486
Ignore xplorer
10/4/2004 1:09:36 PM

I used your logic ... with less constraints , and it does give results ...

Fetcher[SET{BB0,COUNT(CLOSE IS BELOW LOWER BOLLINGER BAND(20),1)}
SET{BB1,COUNT(LOW 1 DAY AGO IS BELOW LOWER BOLLINGER BAND(20) 1 DAY AGO,1)}
SET{BB2,COUNT(LOW 2 DAYS AGO IS BELOW LOWER BOLLINGER BAND(20) 2 DAYS AGO,1)}
SET{BB3,COUNT(LOW 3 DAYS AGO IS BELOW LOWER BOLLINGER BAND(20) 3 DAYS AGO,1)}
SET{CC0,COUNT(CLOSE HAS BEEN DECREASING FOR 3 DAYS,1)}
SET{CC1,COUNT(CLOSE HAS BEEN DECREASING FOR 4 DAYS,1)}
SET{CC2,COUNT(CLOSE HAS BEEN DECREASING FOR 5 DAYS,1)}
SET{CC3,COUNT(CLOSE HAS BEEN DECREASING FOR 6 DAYS,1)}
SET{MM0,BB0 * CC0}
SET{MM1,BB1 * CC1}
SET{MM2,BB2 * CC2}
SET{MM3,BB3 * CC3}
SET{OR1,MM0 + MM1}
SET{OR2,OR1 + MM2}
SET{OR3,OR2 + MM3}
AND OR3 IS ABOVE 0
]




Icculi
9 posts
msg #33489
Ignore Icculi
10/4/2004 5:38:31 PM

Thanks guys. Yeah I figured it was something like that. I'll try your suggestions Cegis. In case your wondering, I'm trying to set up the muddy filter with up to 5 days of failures into one filter, so I don't have to check multiple filters. Currently I have my watch list with the basic filter and then 5 additional filters for each day of failures. It works, but it's not very elegant. Well, thanks again for the help. I'll keep you posted if I come up with something better.


TheRumpledOne
6,407 posts
msg #33508
Ignore TheRumpledOne
10/5/2004 8:01:04 PM

Let me help you.

Here is how to compute fails...

set{CC,days(close is above close 1 day ago,100)}

CC is the # of consective days close is below previous close.

MAY ALL YOUR FILLS BE COMPLETE.



TheRumpledOne
6,407 posts
msg #33510
Ignore TheRumpledOne
10/5/2004 8:02:45 PM

I forgot...

and add column cc


Put those 2 lines of code in your Muddy BB filter.

TAKE ALL YOU CAN. GIVE NONE BACK.


cegis
235 posts
msg #34553
Ignore cegis
12/27/2004 1:57:17 PM

I thought I'd add to this thread just to bring it to the top of the forum list. It seems to be a popular topic lately...

HTH,

C


TheRumpledOne
6,407 posts
msg #34728
Ignore TheRumpledOne
1/3/2005 10:03:31 PM

Check this out:

http://www.agora-inc.com/reports/DJM/WDJMEC24/

RSI(2) being oversold finds all of these stocks.






TheRumpledOne
6,407 posts
msg #35966
Ignore TheRumpledOne
5/11/2005 1:42:18 AM

Just in case you have seen some of my latest filters, here's the thread where the logic comes from.




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


This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.