StockFetcher Forums · Filter Exchange · Connor combined?<< >>Post Follow-up
calhawk01
135 posts
msg #101575
Ignore calhawk01
7/11/2011 10:54:53 PM

Hi, i'm trying to combine 2 filters:

filter 1)

Close above 5
Average volume(50) > 500000
close > ma(200)
close < ma(10)
rsi(2) one day ago below 2
rsi(2) below 1

OR

filter 2)

Close above 5
Average volume(50) > 500000
close > ma(350)
close < ma(30)
rsi(2) one day ago below 2
rsi(2) below 1

I'm trying to combine both filters so that i can backtest them together... But i cant even get the first set of data correct: Here is what i have so far..

close above 5
average volume(50) > 500000
SET{LONG1, COUNT(CLOSE > MA(200),1)}
SET{LONG2, COUNT(CLOSE < MA(5),1)}
set{long3, count(close > ma(350),1)}
Set{long4, count(close < ma(30),1)}
Set{1, long1 * long2}
Set{2, long3 * 4}
Set{3, long1 * 2}
3 above .5

draw ma(200)
draw ma(10)
draw ma(300)
draw ma(30)

Kevin_in_GA
4,599 posts
msg #101583
Ignore Kevin_in_GA
7/12/2011 8:26:13 AM

http://forums.stockfetcher.com/sfforums/?q=view&fid=1002&tid=93830&qrid=

calhawk01
135 posts
msg #101594
Ignore calhawk01
7/12/2011 2:52:09 PM

lol I was actually on that yesterday. And that's how i came up with the top version. But cannot seem to put it together!

Kevin_in_GA
4,599 posts
msg #101598
Ignore Kevin_in_GA
7/12/2011 3:47:03 PM

close above 5
average volume(50) > 500000
SET{LONG1, COUNT(CLOSE > MA(200),1)}
SET{LONG2, COUNT(CLOSE < MA(5),1)}
set{long3, count(close > ma(350),1)}
Set{long4, count(close < ma(30),1)}
Set{1, long1 * long2}
Set{2, long3 * 4}
Set{3, long1 * 2}
3 above .5


Do not use numbers as user-defined variable names.

Also, the lines in bold are incorrect.

Try this

Fetcher[

close above 5
average volume(50) > 500000
SET{LONG1, COUNT(CLOSE > MA(200),1)}
SET{LONG2, COUNT(CLOSE < MA(5),1)}
set{long3, count(close > ma(350),1)}
Set{long4, count(close < ma(30),1)}
Set{var1, long1 * long2}
Set{var2, long3 * long4}
Set{var3, var1 + var2}
var3 above .5


]



calhawk01
135 posts
msg #101601
Ignore calhawk01
7/12/2011 6:52:16 PM

Thank you Kevin! You the best!

calhawk01
135 posts
msg #101603
Ignore calhawk01
7/12/2011 8:12:24 PM

So...


close above 5
average volume(50) > 500000
rsi(2) one day ago below 2
rsi(2) below 1
SET{LONG1, COUNT(CLOSE > MA(200),1)}
SET{LONG2, COUNT(CLOSE < MA(5),1)}
set{long3, count(close > ma(350),1)}
Set{long4, count(close < ma(30),1)}
Set{var1, long1 * long2}
Set{var2, long3 * long4}
Set{var3, var1 + var2}
var3 above .5


optionsavenger
7 posts
msg #101606
Ignore optionsavenger
7/13/2011 12:18:30 AM

Kevin would you happen to have a filter that I could use that would tell me when to go long or short the spy on an intra day bases. Thanks for all you do for us, I enjoy glimming your knowledge, keep it up you have a fan.

duke56468
683 posts
msg #101608
Ignore duke56468
7/13/2011 10:31:03 AM

Here is one of Kevins Market indicator filters

Fetcher[
/*THE FOUR HORSEMEN - OVERALL MARKET INDICATORS*/

/*SET ADVANCING - DECLINING STOCKS ON NYSE AS A VARIABLE AND CREATE A MOVING AVERAGE OSCILLATOR*/
set{var1, ind(^advn,close)}
set{var2, ind(^decn,close)}
set{var3a, var1 - var2}
set{AD_19, CEMA(var3a,19)}
set{AD_39, CEMA(var3a,39)}
set{AD_McClellan, AD_19 - AD_39}
set{AD_summation, sum(AD_McClellan,40)}

/*SET NYSE ADVANCING VOLUME / DECLINING VOLUME RATIO AS SECOND VARIABLE AND CREATE A SIMILAR OSCILLATOR*/
set{var3,ind(^nvlu,close)}
set{var4,ind(^nvld,close)}

set{advancing_volume, sum(var3,10)}
set{declining_volume, sum(var4,10)}
set{volume_oscillator, advancing_volume / declining_volume}

/*SET NEW HIGHS - NEW LOWS AS THIRD INDICATOR*/
set{newh,ind(^hign,close)}
set{newl,ind(^lown,close)}
set{range, newh + newl}
set{newhighs_minus_newlows,newh-newl}
set{HighLow_osc, newhighs_minus_newlows / range}

/*SET SPX VIX BID / ASK RATIO AS A VARIABLE AND CREATE A 10 PERIOD EMA*/
set{VIXbid,ind(^vvvb,close)}
set{VIXask,ind(^vwa,close)}
set{VIXratio, VIXbid / VIXask}
set{trigger_line, CEMA(VIXratio,10)}

/*DEFINE VIX OSCILLATOR AROUND ZERO*/
set{VIX_oscillator, VIXratio / trigger_line}

draw AD_McClellan line at 0
draw AD_Summation line at 0
draw volume_oscillator line at 1
draw newhighs_minus_newlows line at 0
draw VIX_oscillator line at 1
draw day position(0.5,30) on plot price


add column AD_McClellan {McClellan Oscillator}
add column AD_Summation {Summation Index}
add column volume_oscillator {up/down volume 10 day ratio}
add column newhighs_minus_newlows {new highs - new lows}
add column VIX_oscillator {VIX bid-to-ask oscillator}

symlist(spy)
chart-time is 6 months
]



calhawk01
135 posts
msg #101635
Ignore calhawk01
7/14/2011 3:47:20 PM

Kevin, what am I doing wrong here?

Fetcher[ average volume(65) > 500000

SET{LONG1, COUNT(CLOSE > MA(200),1)}
SET{LONG2, COUNT(CLOSE < MA(5),1)}
set{long3, count(close > ma(350),1)}
Set{long4, count(close < ma(30),1)}
Set{long5, count(rsi(2) one day ago below 2,1)}
Set{long6, count(rsi(2) below 1,1)}
Set{var1, long1 * long2}
Set{var2, long3 * long4}
Set{var3, var1 + var2}
Set{var4, long5 + long6}
Set{var5, var3 * var4}
Var5 above .5

Close above 5
set{dollar, close * average volume(65)}
dollar > 1000000
add column average volume(65)
]



The results should be combined results of:

price > 5
average volume(65) > 500000
rsi(2) one day ago below 2
rsi(2) below 1
close above ma(200)
close below ma(10)
close above ma(350)
close below ma(30)

Thanks

Kevin_in_GA
4,599 posts
msg #101638
Ignore Kevin_in_GA
7/14/2011 6:39:34 PM

Kevin, what am I doing wrong here?

You are adding instead of multiplying - use the * to require BOTH criteria to be true. Look at what I did here


Fetcher[ average volume(65) > 500000

SET{LONG1, COUNT(CLOSE > MA(200),1)}
SET{LONG2, COUNT(CLOSE < MA(5),1)}
set{long3, count(close > ma(350),1)}
Set{long4, count(close < ma(30),1)}
Set{long5, count(rsi(2) one day ago below 2,1)}
Set{long6, count(rsi(2) below 1,1)}
Set{var1, long1 * long2}
Set{var2, long3 * long4}
Set{var3, long5 * long6}
set{var4, var1*var3}
set{var5, var2 * var3}
Set{var6, var4 + var5}
Var6 above .5

Close above 5
set{dollar, close * average volume(65)}
dollar > 1000000
add column average volume(65)
]





StockFetcher Forums · Filter Exchange · Connor combined?<< >>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.