StockFetcher Forums · General Discussion · Search for volatile stocks .... Help<< >>Post Follow-up
jmahon01
19 posts
msg #45324
Ignore jmahon01
6/27/2006 11:59:48 AM

I would like to add a search to one of my filters to identify the MAX high of the last 30 days, subtract the MAX low of the last 30 days then divide by last close to obtain a decimal to compare against (as in is the result equal to or GT .10). Anyone know if there is a way to do this on SF ???


nikoschopen
2,824 posts
msg #45326
Ignore nikoschopen
6/27/2006 1:01:16 PM

Fetcher[
set{hi, high 30 day high}
set{lo, low 30 day low}
set{diff, hi - lo}
set{ratio, diff / close}
ratio above 0.09
]


But I think the following would better inform you where the close might lie in the range made up of the 30-day high/low:

Fetcher[
set{hi, high 30 day high}
set{lo, low 30 day low}
set{range, hi - lo}
set{position, close - lo}
set{posrange, position / range}
set{ratio, posrange * 100}
ratio above 10

]




jmahon01
19 posts
msg #45332
Ignore jmahon01
6/27/2006 5:39:23 PM

Hey Niko .... Thanks a lot for the help. I sure do appreciate it. Looks like it should work fine. If I wanted to add and "or" clause (such as "or if diff above 5" ) would that work with it? /JPM


nikoschopen
2,824 posts
msg #45334
Ignore nikoschopen
6/27/2006 6:37:15 PM

There have been many passing remarks on the uses of Boolean algorithms within the SF paradigm. Be that as it may, the "OR" clause usually means "this OR that, but NOT both". That is, "OR equals NOT AND" (OR = ~AND).

Therefore, here's a brief rundown on how to implement the "OR" expression. Suppose you want to screen for stocks that have moved below the 20-day low OR below the MA(20), but not BOTH. When the "OR" expression is successfully evaluted, only one of the two conditional statements will be stamped as "true".

Fetcher[
set{ma20, count(price crossed below ma(20),1)} //first conditional
set{lo20, count(price crossed below low 20 day low,1)} //second conditional
set{OR, ma20 + lo20}
OR equals 1
]



Hope that helps.


jmahon01
19 posts
msg #45342
Ignore jmahon01
6/28/2006 12:43:01 AM

Yes, it does help! Thanks very much ..... I think it will allow me to do what I want to do. Thanks again. /JPM


nikoschopen
2,824 posts
msg #46011
Ignore nikoschopen
modified
7/21/2006 2:50:21 AM

For the record, the use of OR in the above illustration refers to "exclusive disjunction"!

In the virtual absence of exclusive disjunction, wherein the "OR" operator is ordinarily interpreted as "this OR that, or BOTH" (according to the rules of inclusive disjunction), you probably wanna use the "OR is above 0" premise instead.

If for any reason should this academically stale subject matter become the source of next nuclear fallout, so be it. My conscience is clear.



maxreturn
745 posts
msg #46021
Ignore maxreturn
7/21/2006 12:46:41 PM

Whew Niko...You gotta stop usin dem million dolla words!


StockFetcher Forums · General Discussion · Search for volatile stocks .... Help<< >>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