StockFetcher Forums · Filter Exchange · Trying to set buy/sell signals and stop loss in filter<< >>Post Follow-up
davesaint86
269 posts
msg #73310
Ignore davesaint86
modified
4/4/2009 9:46:23 PM

I attempted to develop a long-term trend filter for my and my wife's 401k plans since we cannot trade them freqently. I ran into trouble quickly and need some help. Thanks in advance.

Here are the Buy and Sell Rules
Buy 1% above the Weekly 30(MA). Set a stop 2.5% below the Weekly 30(MA). I would like the filter to contain a Buy column that would show a 1 as long as the price is at least 1% above the Weekly 30(MA). I would like to also like to see a column that shows the % difference between the current price and the Weekly 30(MA). I would like the filter to contain a Sell Column to show a 1 if the price falls 2.5% or lower below the Weekly 30(MA). I would like to see the stop-loss price column also.


Fetcher[

* your filter code goes below this line */
diff reached a new 1 year low and compare with ^SPX

Apply to Symlist
(AGG,BA,CWI,EFA,IGM,IWB,IWD,IWM,IWN,IWM,IWT,I,IMV,IWZ,IWZ,RSP,SPY)

and draw weekly MA(30)
set{Diff, price - weekly MA(30)}
add column separator
add column weekly MA(30)
add column separator
add column Diff
add column separator


and chart-display is weekly
and chart-time 1 year
]



davesaint86
269 posts
msg #73323
Ignore davesaint86
4/5/2009 3:02:52 PM

I've made some progress. Still trying to set the Buy column with a 1 in it (if split is > 0 it's a buy and a 1 should go into the buy column if the opposite a 1 should be in the sell column.

Fetcher[
* your filter code goes below this line */
diff reached a new 1 year low and compare with ^SPX

Apply to Symlist
(AGG,BA,CWI,EFA,IGM,IWB,IWD,IWM,IWN,IWM,IWT,I,IMV,IWZ,IWZ,RSP,SPY)

and draw weekly MA(30)

add column separator
add column weekly MA(30)
add column separator
set{BuyPrice, weekly MA(30) + PerAbove}
add column BuyPrice
add column separator
set{Stop, weekly MA(30) * .025}
add column Stop
add column separator
set{StopLoss, weekly MA(30) - Stop}
add column StopLoss
add column separator
set{PerAbove, weekly MA(30) * .01}
add column PerAbove
add column separator
set{Split, close - BuyPrice}
add column Split
add column separator

and chart-display is weekly
and chart-time 1 year
]



davesaint86
269 posts
msg #73326
Ignore davesaint86
4/5/2009 4:29:00 PM

I think I finally got it. I'm allowed to make changes every 15 days in my 401K and my wife is allowed to make changes every 30 days. The 30(MA) weekly may be too long of a time frame but is should keep us from frequent changes. Do any of you have a better suggestion on what timeframe I should use in this filter or suggestions or other filters that would work better based that we cannot short our 401K and the penalties for frequent trades.

Thanks - Dave

Fetcher[
your filter code goes below this line */
diff reached a new 1 year low and compare with ^SPX

Apply to Symlist
(AGG,BA,CWI,EFA,IGM,IWB,IWD,IWM,IWN,IWM,IWT,I,IMV,IWZ,IWZ,RSP,SPY)

draw weekly MA(30)
and do not draw MA(20)
and do not draw MA(50)
and do not draw MA(250)
add column separator
add column RSI(2)
add column separator
add column RSI(30)
add column separator
add column RSI(30) 1 day ago {RSI-1 day}
add column separator
add column RSI(30) 2 day ago {RSI-2 day}
add column separator
add column RSI(30) 3 day ago {RSI-3 day}
add column separator
add column weekly MA(30)
set{PerAbove, weekly MA(30) * .01}
add column separator
set{BuyPrice, weekly MA(30) + PerAbove}
add column BuyPrice
set{Split, close - BuyPrice}
add column separator
set{Long, count(split > 0,1)}
add column Long
add column separator
set{Short, count(split < 0,1)}
add column Short
set{Stop, weekly MA(30) * .025}
add column separator
set{StopLoss, weekly MA(30) - Stop}
add column StopLoss
add column separator

sort column 20 descending
and chart-display is weekly
and chart-time 1 year
]



chetron
2,817 posts
msg #73327
Ignore chetron
4/5/2009 4:40:15 PM

maybe............

Fetcher[

* your filter code goes below this line */
diff reached a new 1 year low and compare with ^SPX

Apply to Symlist
(AGG,BA,CWI,EFA,IGM,IWB,IWD,IWM,IWN,IWM,IWT,I,IMV,IWZ,IWZ,RSP,SPY)

and draw weekly MA(30)

add column separator
add column weekly MA(30)
add column separator
set{BuyPrice, weekly MA(30) + PerAbove}
add column BuyPrice
add column separator
set{Stop, weekly MA(30) * .025}
add column Stop
add column separator
set{StopLoss, weekly MA(30) - Stop}
add column StopLoss
add column separator
set{PerAbove, weekly MA(30) * .01}
add column PerAbove
add column separator
set{Split, close - BuyPrice}
add column Split
add column separator

set{vbuy,count(split above 0,1)}
add column vbuy {buy}

and chart-display is weekly
and chart-time 1 year
]



Eman93
4,659 posts
msg #73404
Ignore Eman93
4/8/2009 8:33:20 PM

http://www.investorsinsight.com/blogs/thoughts_from_the_frontline/archive/2009/03/28/why-bother-with-bonds.aspx

You should read all his letters.

davesaint86
269 posts
msg #73413
Ignore davesaint86
4/8/2009 9:40:22 PM

Thanks you guys!

Dave

StockFetcher Forums · Filter Exchange · Trying to set buy/sell signals and stop loss in filter<< >>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