StockFetcher Forums · Filter Exchange · ETF Weekly EMA(5) / Weekly EMA(12)<< >>Post Follow-up
davesaint86
266 posts
msg #63600
Ignore davesaint86
modified
6/12/2008 8:51:04 AM

This filter seems to be working correctly. However I'm trying to backtest it and the backtest is not triggering the sells correctly. Here is my sell trigger (EMA(5) crossed below weekly EMA(12) 2 days ago). My backtest parameters are show below the filter. In my opinion the backtest should show DBA purhcased around 8/27/07 and then sold around 4/28/08 and then purchased again around 6/9/08. Also, USO and OIH should show my in the backtest results. I could use some help troubleshooting the backtest parmeters or filter. I think the problem lies in the backtest parameters.
Davesaint

Fetcher[* your filter code goes below this line */
APPLY TO SYMLIST*/
apply to Symlist (DBA,USO,OIH)
show stocks where weekly EMA(5) crossed above weekly EMA(12) 2 days ago

and volume above 100000

do not draw weekly EMA(5)
do not draw weekly EMA(12)


and draw EMA(5)
and draw EMA(12)
and draw EMA(73)
and draw ADX(10)
and draw RSI(14)
and draw RSI(14) line at 30.00
and draw RSI (14) line at 70.00
and do not draw MA(10)
and do not draw EMA(30)
and do not draw CCI(20)
and do not draw Slow Stochastics(14,5)
and do not draw MACD Fast Line(8,17)
and do not draw MA(200)


SET{VAR1,COUNT(MACD HISTOGRAM < 0.00,1)}
SET{VAR4,COUNT(MACD HISTOGRAM > -0.00,1)}
SET{VAR7,COUNT(2 DAY SLOPE OF MACD HISTOGRAM > 0,1)}
SET{VAR8,COUNT(2 DAY SLOPE OF MACD HISTOGRAM < 0,1)}


add column separator
add column rsv
add column separator
and add column rsi(2)
and add column RSI(14)
add column separator
add column ADX(10,10) {ADX10}
add column separator
add column Money Flow Index(15) {MFI15}
add column separator
ADD COLUMN MACD FAST LINE {MACD}
add column separator



* Relative Strength Rating */

set{ cq0,close }
set{ cq1,close 3 months ago }
set{ cq2,close 6 months ago }
set{ cq3,close 9 months ago }
set{ cq4,close 12 months ago }

set{ roi1z, cq0 - cq1 }
set{ roi1, roi1z / cq1 }

set{ roi2z, cq1 - cq2 }
set{ roi2, roi2z / cq2 }

set{ roi3z, cq2 - cq3 }
set{ roi3, roi3z / cq3 }

set{ roi4z, cq3 - cq4 }
set{ roi4, roi4z / cq4 }

set{ rsvz, roi4 + roi3 }
set{ rsvy, rsvz + roi2 }
set{ rsvx, rsvy + roi1 }
set{ rsvw, rsvx + roi1 }
set{ rsv, rsvw / 5 }

set{ lrs250, linear regression(250) slope }
set{ sq250, r squared(250) }



add column Open {TDO}
add column separator
add column High {TDH}
add column separator
add column Low {TDL}
add column separator
add column Close {TDC}


* STOCK DASHBOARD DISPLAY for newbies and old pros */

set{E36b,days(ema(3) is above ema(6),100)}
set{E36a,days(ema(3) is below ema(6),100)}
set{E3xE6, E36a - E36b}

set{E50200b,days(ma(50) is above ma(200),100)}
set{E50200a,days(ma(50) is below ma(200),100)}
set{M50xM200, E50200a - E50200b}

set{E1326b,days(ema(13) is above ema(26),100)}
set{E1326a,days(ema(13) is below ema(26),100)}
set{E13xE26, E1326a - E1326b}

set{CCb,days(close is above close 1 day ago,100)}
set{CCa,days(close is below close 1 day ago,100)}
set{CxC, CCa - CCb}

set{E5b,days(close is above ema(5),100)}
set{E5a,days(close is below ema(5),100)}
set{CxE5, E5a - E5b}


set{E50b,days(close is above ma(50),100)}
set{E50a,days(close is below ma(50),100)}
set{CxM50, E50a - E50b}

set{E200b,days(close is above ma(200),100)}
set{E200a,days(close is below ma(200),100)}
set{CxM200, E200a - E200b}


set{T10, count(10 day slope of the close above 0,1)}
set{T60, count(60 day slope of the close above 0,1)}
set{T200, count(200 day slope of the close above 0,1)}

Set{a1, T200 * 1}
Set{a2, T60 * 10}
Set{a3, T10 * 100}

Set{aa, a1 + a2}
Set{TREND, aa + a3}

set{v, volume 1 day ago}
set{volinc, volume - v}
set{volpc, volinc / v}
set{volpct, volpc * 100}

set{VolZ, days(volume < 1,100)}
set{VolUp, days(volume is below volume 1 day ago,100)}
set{VolDn, days(volume is above volume 1 day ago,100)}
set{VolCnt, VolUp - VolDn}

set{vck1, volume 1 day ago }
set{vck, volume / vck1 }
set{vdbl, days(vck < 2, 100)}


set{PARBuy, count(close crossed above Parabolic SAR, 5) }
set{DMIBuy, count( di(14) Difference crossed above 0 , 5) }
set{DMIBuyX, count( di(14) Difference above 0 , 1) }

set{PARSell, count(close crossed below Parabolic SAR, 5) }
set{DMISell, count( di(14) Difference crossed below 0, 5) }
set{DMISellX, count( di(14) Difference below 0, 1) }

set{PARSBuy1, PARBuy * DMIBuy}
set{PARSBuy, PARSBuy1 * DMIBuyX}

set{PARSSell1, PARSell * DMISell}
set{PARSSell, PARSSell1 * DMISellX}

set{PARSTrade, PARSBuy + PARSSell}

set{HiOp, high - open}

set{WRb,days(Williams %R(10) is above Williams %R(10) 1 day ago,100)}
set{WRa,days(Williams %R(10) is below Williams %R(10) 1 day ago,100)}
set{WRxWR, WRa - WRb}

add column separator
and add column VolCnt
add column separator
and add column Vdbl
add column separator
and add column volpct
add column separator

and add column HiOp
add column separator
and add column Trend
add column separator

and add column CxC {CxC_}
add column separator
and add column CxE5 {CxE5}
add column separator

and add column E3xE6 {E3xE6}
add column separator
and add column E13xE26 {E13xE26}
add column separator

and add column CxM50
add column separator
and add column CxM200
add column separator
and add column M50xM200
add column separator

add column rsi(2)
add column separator
add column weekly rsi(2)
add column separator

add column PARSBuy
add column separator
add column PARSSell
add column separator

add column WRxWR
add column separator
add column sector
add column separator
Trend above -1


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



EMA(5) crossed below weekly EMA(12) 2 days ago
Entry Filter
Weekly (EMA 5/12/73) ETFs Vol > 100, (saved filter)

Basic Setup
Name: Weekly (EMA 5/12/73) ETFs Vol > 100,
Approach Type: Long
Start Date: 01/02/2008
End Date: 06/06/2008
Benchmark Symbol: ^SPX

Exit Setup
Stop Loss: N/A
Profit Stop: N/A
Trailing Stop Loss: N/A
Minimum Holding Days: N/A
Maximum holding days: N/A
Exit Trigger #1: EMA(5) crossed below weekly EMA(12) 2 days ago

Extra Indicators
Entry Columns:
Show Performance After: after 2 daysafter 5 daysafter 10 daysafter 25 daysafter 40 days

Advanced Options
Selection Method: select by Money Flow Index ascending
Entry Price: open
Conditional Entry: No
Exit Price: close
Maximum Trades Per Day: 10
Maximum Open Positions: 5
Maximum Selected Stocks: 50



StockFetcher Forums · Filter Exchange · ETF Weekly EMA(5) / Weekly EMA(12)<< >>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