StockFetcher Forums · General Discussion · A COMPLETE LOGIC SYSTEM - ANOTHER GIFT FROM AVERY<< 1 ... 6 7 8 9 10 >>Post Follow-up
four
3,389 posts
msg #114271
Ignore four
modified
6/30/2013 10:54:41 AM

pop
--------

http://www.stockfetcher.com/forums/Filter-Exchange/Why-does-this-not-work/114264

ChoWZa
3 posts
msg #114688
Ignore ChoWZa
modified
7/29/2013 10:31:20 PM

I don't know if this has been mentioned already, but I thought I'd throw this logic out in case no one had thought of it. Sorry if I'm repeating someone else's contribution.

To implement

IF (Condition1 and Condition2 and Condition3 ...) or (Condition4 and Condition5 and Condition6...) or .... (...)
then ...

Count each condition as 1, like normal.
Then multiply Conditions in parenthesis against each other, if any condition is not met, the product will be 0

Then take this product, and sum it together with the other sets of parenthesis. There is no limit to the number of conditions per set or sets of conditions.

AND = equals (# of sets)
OR = above 1

OR:
if Product1 (Con1*Con2*Con3...) + Product2(Con4*Con5*Con6) is above 0, then success.

AND:
if Product1 (Con1*Con2*Con3...) + Product2(Con4*Con5*Con6) equals 2, then success.

Nesting Logic:

If (Con1 or (Con2 and Con3)) and (Con4 or Con5)

(Con2 + Con3) Product = 1 or 0 (1 Success, 0 Fail)
Con1 + Product = 2 or 1 or 0, divide by itself, will be either 1 - Success, or 0 - Failure <--- Quotient1

And (Con4 or Con5) Conf4 + Conf5 = 2,1,0 divide by itself, 1 - Success, or 0 - Failure <--- Quotient2

Overall Success: Quotient1 + Quotient2 = 2

Lastly
If you want a single count of a condition one or more to be true.
Ie. Count the number of crosses above MA(200) in last 30 days, 1,2,3... crosses are okay
Set a variable to the count, divide by itself, 1 = true 0 = false.
Then take the quotient (AND) a cross above RSI 30 or something, then count the RSI cross and add to the quotient, and 2 = success.

You can do this is a safety measure in case it is possible a double count of a single condition could throw off your entire logic statement, divide by itself to ensure it is no more than 1.

sohailmithani
192 posts
msg #119667
Ignore sohailmithani
5/13/2014 11:00:49 AM

Guys need some help here.

I want to place a limit buy as follows:

CONDITION
If Yesterday Low was more than 10% below close 2 days ago then buy at 92% of close price yesterday or open whichever is lower.

However, if CONDITION is not satisfied i.e. If Yesterday Low was NOT more than 10% below close 2 days ago then buy at 90% or open which ever is lower.

Please help me code this.

Thanks

sohailmithani
192 posts
msg #119719
Ignore sohailmithani
5/14/2014 11:07:23 AM

Anyone out there willing to help me code this. Thanks

four
3,389 posts
msg #120074
Ignore four
5/25/2014 10:08:34 PM

pop

four
3,389 posts
msg #124354
Ignore four
7/12/2015 12:23:58 AM

pop

Bill_J
1 posts
msg #124453
Ignore Bill_J
7/21/2015 10:39:18 AM

Really, you are trying to copyright Boolean Algebta? Good luck with that.


TheRumpledOne
6,358 posts
msg #127140
Ignore TheRumpledOne
2/4/2016 12:00:57 PM

*POP*

StockFetcher Forums · General Discussion · A COMPLETE LOGIC SYSTEM - ANOTHER GIFT FROM AVERY<< 1 ... 6 7 8 9 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 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