betyerbottomdollar 169 posts msg #54654 - Ignore betyerbottomdollar |
9/8/2007 9:00:34 PM
Can SF filters handle "if, then" type of statements?
I want to buy when the close crosses below the EMA(20)
and sell if the high crosses the Upper Bollinger Band(20, 2)
unless...
the price keeps dropping past the EMA(20) and the close crosses the Lower Bollinger Band (20, 2), then I want to buy again...
and sell when the high crosses up the EMA (20)
and on and on and on n on n on forever.
|
guru_trader 485 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
|
TheRumpledOne 6,411 posts msg #54670 - Ignore TheRumpledOne modified |
9/9/2007 2:47:29 PM
xBB tells you the number of days the price has been above/below the upper/lower Bollinger bands.
CxE20 tells you the number of days the price has been above/below the EMA(20).
Check out the BASIC FILTER DISPLAY I wrote years ago.
|
nikoschopen 2,824 posts msg #54672 - Ignore nikoschopen modified |
9/9/2007 3:10:41 PM
C'mon guys, the chap is asking for a "if, then" CONDITIONAL statement, not a BOOLEAN function. Gggrrrrr!!
Here's one way to get around the If..Then conditional. Suppose I'm looking for stocks with a weekly return greater than 5% or less than -5%. That is, I'm screening for stocks like ABC that ran up more than 5% within a week and XYZ that plummeted more than 5% within a week. Basically, I want to exclude from my filter any stocks that are in between -4.99 and 4.99. What I want are the ones in the extreme.
At any rate, TRO deserves the credit for bringing the Boolean formula here at SF. Way to go, bro!
:)
|
guru_trader 485 posts msg #54708 - Ignore guru_trader |
9/11/2007 3:22:02 AM
Well, I'd love an actual if/then/else function, but I'll keep dreaming :)
|
betyerbottomdollar 169 posts msg #54728 - Ignore betyerbottomdollar |
9/11/2007 7:19:33 PM
Hmmm....yeah....
Thanks for yall's input. The links helped a bit...I learned some things I didn't know. But as for the actual if then else function I guess I can do it on paper. Or set up multiple backtests and try to add em up and average them out somehow.
Oh, here is a joke I heard the other day...
How do you kill a circus?
Go for the juggler.
|