StockFetcher Forums · Filter Exchange · Boolean Operators OR and NOT<< >>Post Follow-up
smithman
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

Kevin_in_GA
4,599 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.

Kevin

smithman
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?

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

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

smithman
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.

METHOD 1
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

METHOD 2
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.


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

welcome!

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}
Set{both,T1+T2}

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



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

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

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

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

guru_trader
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:

http://www.stockfetcher.com/stockdb/fetcher?p=forum&sub=view&fid=1001&tid=28017

http://www.stockfetcher.com/stockdb/fetcher?p=forum&sub=view&fid=1003&tid=28019

StockFetcher Forums · Filter Exchange · Boolean Operators OR and NOT<< >>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.