TheRumpledOne 6,411 posts msg #28090 - Ignore TheRumpledOne |
8/27/2003 1:02:40 AM
PHMD... looks good.. too bad you didn't buy in at the daily low today.
========
The filters in this thread are EXAMPLES of how to code Stockfetcher filters so you can use BOOLEAN LOGIC, "or" and "not" in particular. I included "and" so the "language" would be complete. You can now use "or" without the combination problem bringing the server to its knees.
Funny thing, I realized today that I did the exact same thing about 20 years ago in RPG II because that language did not have IF statements.
People (including myself) have requested that StockFetcher give us "or" and "not". Until SF or somebody else creates a META LANGUAGE and code generator for StockFetcher , this is a way to code the BOOLEAN LOGIC.
A FILTER WIZARD would sure be cool!! Similiar to eSignal's Formula Wizard.
|
TheRumpledOne 6,411 posts msg #28170 - Ignore TheRumpledOne |
8/31/2003 2:17:16 AM
I am curious...
Has anyone out there used my logic technique?
Would love to see it applied.
|
deprez 60 posts msg #28180 - Ignore deprez |
8/31/2003 4:48:59 PM
I tried but there is a problem. Please help.
|
murknd 62 posts msg #28181 - Ignore murknd |
8/31/2003 5:02:56 PM
deprez,
Read this - I think you're mis-using the set feature.
D
http://www.stockfetcher.com/stockdb/fetcher?p=varhelp
|
deprez 60 posts msg #28206 - Ignore deprez |
9/1/2003 4:46:45 PM
I thought it was an "overloaded class" which would allow the plus sign to be used for addition and the "or logic". I guess I was wrong.
I tried it initially with "count" as prescribed but had zero results I will rewrite it and see if it works.
|
Icculi 9 posts msg #31429 - Ignore Icculi |
3/16/2004 10:21:49 PM
Try this
Stock
|
defghca 150 posts msg #31431 - Ignore defghca |
3/17/2004 6:46:29 AM
An OR filter using 2 popular variation of the MUDDY filter
2. RSI(2) DAILY (Avery/HG):
RSI(2) IS BELOW 2 AND AVERAGE VOLUME(90) IS ABOVE 100000 AND PRICE IS
BETWEEN 1 AND 10 AND PRICE TOUCHED LOWER BOLLINGER BAND(20) AND CLOSE
HAS BEEN DECREASING OVER THE LAST 3 DAYS
3. LRI DAILY (Avery/HG):
60 DAY SLOPE OF THE CLOSE IS ABOVE 0 AND CLOSE NEAR BOTTOM LINEAR
REGRESSION LINE(60) AND AVERAGE VOLUME(90) IS ABOVE 100000 AND PRICE
IS BETWEEN 1 AND 10 AND PRICE TOUCHED LOWER BOLLINGER BAND(20) AND
CLOSE HAS BEEN DECREASING OVER THE LAST 3 DAYS
combining these 2 filters in a OR filter
set{A, count(RSI(2) IS BELOW 2 , 1)}
set{B, count(60 DAY SLOPE OF THE CLOSE IS ABOVE 0.5,1)}
set {C, count(CLOSE NEAR BOTTOM LINEAR REGRESSION LINE(60),1) }
set{OR0,a+b}
set{or,or0+c}
show stocks where OR is above 0 and AVERAGE VOLUME(90) IS ABOVE
100000 AND PRICE IS BETWEEN 1 AND 10 AND PRICE TOUCHED LOWER
BOLLINGER BAND(20) AND CLOSE HAS BEEN DECREASING OVER THE LAST 3
DAYS
i sure wish SF would implement the "OR" conjunction, it would be so
much simpler
|
TheRumpledOne 6,411 posts msg #31437 - Ignore TheRumpledOne |
3/17/2004 5:40:20 PM
DEFGHCA:
Isn't it more fun BENDING a system to your will?
|
TheRumpledOne 6,411 posts msg #32367 - Ignore TheRumpledOne |
6/16/2004 8:15:04 PM
I am happy to see people making use of this.
MAY ALL YOUR FILLS BE COMPLETE.
|
cegis 235 posts msg #32374 - Ignore cegis |
6/17/2004 1:35:21 PM
RumpledOne,
Good idea to make a post on this thread to bring it back to the top of the list!
I just re-read the thread, and would like to make some comments:
1) RPG II - WOW! I haven't used THAT for quite a while, either! (But more recently than 20 years ago, I think. Imagine THAT!)
2) Unfortunately, I don't believe this technique is copyrightable, as it is standard algebraeic (sp??) logic, with one exception: AND is "usually" implemented with multiplication (c1 * c2 = 1 is the same as c1 AND c2). Using multiplication keeps your values 1 if "the whole schebang" is true, and 0 if false. (Think complex conditions...) No need to figure that c1 AND c2 AND c3 should be using 3 instead of 2 and so forth. (Although that's not hard, it could be a point of error if you are editing a filter.)
3) "NOT c1" could also be implemented as (1 - c1), which again keeps "true" = "1", and "flase" = "0", for use in more complicated expressions. (Again, "standard" algebraeic logic...)
4) **IMPORTANT** (IMHO) This technique also allows for IF/THEN/ELSE!!! Let me use an example (NOT necessarilly a good filter, but a good example!) to explain. Suppose you want a volume condition, but the volume limit is to be based on price. Let's say, if a stock's price is less than $5, you want an average volume(30) of at least 100,000. For stocks >= $5, you want the average volume(30) to be at least 250,000. Here's a filter that illustrates how to achieve this:
The first set{} will result in "if" being 1 if the price is below $5, or 0 if the price is >= $5.
The second set{} command (and here's the trick) will result in "vol1" being 100,000 if the price is below $5, or ZERO otherwise. This is kinda like an AND, except the value you're looking for won't be only zero or one.
The third set{} is really "NOT if", to be used for the "else" part of the condition.
The fourth set{} uses the same trick as the second, resulting in "vol2" being 250,000 or zero.
Note that "vol2" will be 250,000 ONLY when "vol1" is zero, and "vol1" will ONLY be 100,000 when "vol2" is zero. That allows the last set{} command to be our desired volume limit based on price! (This is kinda like an OR, except using non-binary numbers.)
Oh, yeah. This is also a case where you might NEED the implementation of AND described above, and NOT BE ABLE to use SF's implementation. (Think "volume must be > 100,000 if price is < 5 AND RSI(2) < 1, otherwise voume must be > 250,000".)
I hope this information is useful.
C
|