StockFetcher Forums · Filter Exchange · Boolean Operators OR and NOT<< >>Post Follow-up
8 posts
msg #105945
Ignore smithman
4/19/2012 12:38:45 PM

I wanted to use an OR expression like (A or B or C) where A,B,C are True or False results. Then, I learned that SF doesn't allow OR expressions. So, I converted the OR expression to an AND expression using a Truth Table. (A or B or C) equivalent to NOT(-A and -B and -C).
However, now I need to use a NOT function. But I don't believe I can use NOT in StockFetcher. Does anyone know a 'workaround' for NOT?

Coach John

3,847 posts
msg #105946
Ignore Kevin_in_GA
4/19/2012 12:45:46 PM

Search the forums for "complete logic system".

Always use the search function before posting - you'll usually find that the answer is there.


8 posts
msg #105950
Ignore smithman
4/19/2012 4:35:31 PM

I did search for boolean NOT and read all there was in that thread including stuff about using set statements to create If-Then constructs. Just now I tried searching for "complete .." as you suggested with no results... Is there a write up somewhere here on a work-around for the NOT Boolean function?

319 posts
msg #105951
Ignore mktmole
4/19/2012 5:06:25 PM

Kevin's post did give the answer. Try again.

8 posts
msg #105952
Ignore smithman
4/19/2012 6:32:01 PM

His answer "NOT Implementation" doesn't work for me. I'm a newbie, trying very hard to learn this programming language. The problem may be that I can't use the method because my components are incorrect. I'm trying to test for a series of comparisons between averages. My challenge is testing for NOT(Average(10)>Average(20) AND Average(20)>Average(50)). I tried two methods and both failed.

Set{T1,Count(Average(10) above Average(20),1)}
Set{T2,Count(Average(20) above Average(50),1)}
Set{T3, T1+T2}
Show stocks where T3 is above 0

Set{D1, Average(10)-Average(20)}
Set{D12, Count(D1 above 0,1)}
Set{D2, Average(20)-Average(50),1)}
Set{D22, Count(D2 above 0,1)}
Set{D, D12 + D22}
Show stocks where D above 0

Please help me learn what I am doing wrong here.
I appreciate any guidance you can give me.

319 posts
msg #105954
Ignore mktmole
4/19/2012 6:51:06 PM


Method 1 try..
Fetcher[Set{T1,Count(MA(10) above MA(20),1)}
Set{T2,Count(MA(20) above MA(50),1)}
add column T1{10abv20}
add column T2{20abv50}

and add column both{10_20_50up}
draw MA(10)
draw MA(20)
draw MA(50)
price above 10
sort column 7 descending

8 posts
msg #105955
Ignore smithman
4/19/2012 8:22:15 PM

Thank you so much, Mr./Mrs. MktMle!

64 posts
msg #105956
Ignore olathegolf
4/19/2012 9:29:35 PM

TRO has a bunch of posts on this. Here's an excerpt......

454 posts
msg #54660
- Ignore guru_trader 9/9/2007 3:22:11 AM

Yes, thanks for TRO and others ...

Currently StockFetcher does not support conditional boolean logic directly. This is due to the potentially enormous computational impact it might have on StockFetcher's servers. There are, however, some work-arounds which may accomplish any boolean logic (or/if conditions). See the following forum posts for some solutions:

StockFetcher Forums · Filter Exchange · Boolean Operators OR and NOT<< >>Post Follow-up

*** Disclaimer *** 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. does not recommend particular securities., 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