StockFetcher Forums · Filter Exchange · HOW TO DESIGN A SYSTEM (NOT JUST A FILTER)<< 1 ... 3 4 5 6 7 ... 43 >>Post Follow-up
campbellb75
101 posts
msg #101213
Ignore campbellb75
6/11/2011 3:44:05 PM

Kevin-
Have you backtested the pair trade in Stratasearch by buying SH with each long position? Curious what the equity curve and drawdown look like with it.

csupati
25 posts
msg #101216
Ignore csupati
6/12/2011 2:41:31 AM

Kevin,
Thanks for posting this system. I would be very much interested in your opinion about using other indexes (DOW, Nasdaq or NYSE), and on how to use your system with lower accounts (e.g. 10K). Thanks.

fortyfour
189 posts
msg #101217
Ignore fortyfour
modified
6/12/2011 3:01:44 PM

Kevin,

1st thanks for "doing this work" that is so helpful to many.
The 1st StockFetcher backtest is I believe "pure Kevin" as you first posted.
The 2nd Stockfetcher backtest still selects from SP500 but screens for 'wider" bollinger bands.
The test periods are for two years 6/11/09 to 6/11/2011.
( I also got very similar results for the periods 6/11//2007-6/11/2009 and 6/11/2005-6/11/2007)
The single change in the filter reduces the number of trades, increases ROI... but at what cost?
Does it hurt the Sharpe ratio as I suspect and increase drawdowns?
I am not one to chase ROI at the expense of creating a method that is
personally " untradeable" , so, I in no way endorse the increased ROI.
What I like most ( up to this point) is: fewer trades with decent results.
Would you be so kind as to run this through Statasearch and comment specifically
and in general on the differences.
Also, in an attempt to understand ZScore16 I have experimented with "median bollinger band(16)" as
an exit. I also "bumped" this center line higher and lower in increments of 1% but I cannot replicate
the success of the ZScore16.
Just what is Zscore16 ?....if it can be explained in a way that relates to a chart for us mathematically challenged folks?
Anyway...nice work...Thanks!


*************************************************************
Summary of original filter
*************************************************************
Statistics · Performance Chart · Trades · Equity Summary new! · System Summary · Edit Backtests · Backtest Forum · Help
Approach Information
Approach Name: pure kevin
Test started on 06/11/2009 ended on 06/10/2011, covering 504 days
Filter used:

S&P500

/*FIRST DETERMINE HISTORICAL RATIO OF S&P STOCK TO THE SPY OVER THE LAST 16 DAYS*/
SET{PRICERATIO, CLOSE / IND(^SPX,CLOSE)}
SET{RATIOMA16, CMA(PRICERATIO,16)}
SET{RATIOSTD16, CSTDDEV(PRICERATIO,16)}
SET{DIFF16, PRICERATIO - RATIOMA16}
SET{ZSCORE16, DIFF16 / RATIOSTD16}
SET{THRESHOLD16, RATIOSTD16 * 2}

/*NEXT, SET CRITERIA NECESSARY TO TRIGGER A PAIR TRADE*/

SET{UPPERBAND16, RATIOMA16 + THRESHOLD16}
SET{LOWERBAND16, RATIOMA16 - THRESHOLD16}

ZSCORE16 BELOW -2
WILLIAMS %R(16) BELOW -94
CLOSE BELOW LOWER BOLLINGER BAND(16,2)
CLOSE ABOVE MA(200)

DRAW LOWERBAND16 ON PLOT PRICERATIO
DRAW UPPERBAND16 ON PLOT PRICERATIO
DRAW BOLLINGER BANDS(16,2)
ADD COLUMN ZSCORE16 {Z-score}
ADD COLUMN WILLIAMS %R(16)

DRAW ZSCORE16 LINE AT -1
DRAW ZSCORE16 LINE AT -2
DRAW ZSCORE16 LINE AT 0

SORT ON COLUMN 5 ASCENDING
CHART-TIME IS 6 MONTHS



Trade Statistics
There were 515 total stocks entered. Of those, 515 or 100.00% were complete and or 0.00% were open.
Of the 515 completed trades, 351 trades or 68.16%resulted in a net gain.
Your average net change for completed trades was: 1.19%.
The average draw down of your approach was: -3.39%.
The average max profit of your approach was: 3.20%
The Reward/Risk ratio for this approach is: 2.29
Annualized Return on Investment (ROI): 53.17%, the ROI of ^SPX was: 17.32%.


Exit Statistics
Stop Loss was triggered 0 times or 0.00% of the time.
Stop Profit was triggered 0 times or 0.00% of the time.
Trailing Stop Loss was triggered 0 times or 0.00% of the time.
You held for the maximum period of time (20 days) 10 times or 1.94% of the time.
An exit trigger was executed 505 times or 98.06% of the time.


*********************************************************
wide bb's
**************************************************
Aproach Name: kevin_wide_bb_width
Test started on 06/10/2009 ended on 06/10/2011, covering 505 days
Filter used:


MARKET IS SP500
/*FIRST DETERMINE HISTORICAL RATIO OF S&P STOCK TO THE SPY OVER THE LAST 16 DAYS*/
SET{PRICERATIO, CLOSE / IND(^SPX,CLOSE)}
SET{RATIOMA16, CMA(PRICERATIO,16)}
SET{RATIOSTD16, CSTDDEV(PRICERATIO,16)}
SET{DIFF16, PRICERATIO - RATIOMA16}
SET{ZSCORE16, DIFF16 / RATIOSTD16}
ZSCORE16 BELOW -2
WILLIAMS %R(16) BELOW -94
CLOSE BELOW LOWER BOLLINGER BAND(16,2)
CLOSE ABOVE MA(200)

ADD COLUMN WILLIAMS %R(16)

/* 99 DAY AVERAGE BOLLINGER WIDTH */
set{hh, bollinger width(16,2)}
set{width_per, hh * 100}
set{wsum, sum(width_per,99) }
set{99_width_avg%, wsum/99}
add column 99_width_avg%

99_width_avg% > 15
sort column 6 descending





Trade Statistics
There were 173 total stocks entered. Of those, 167 or 96.53% were complete and 6 or 3.47% were open.
Of the 167 completed trades, 117 trades or 70.06%resulted in a net gain.
Your average net change for completed trades was: 1.98%.
The average draw down of your approach was: -5.02%.
The average max profit of your approach was: 4.61%
The Reward/Risk ratio for this approach is: 2.69
Annualized Return on Investment (ROI): 89.06%, the ROI of ^SPX was: 17.03%.


Exit Statistics
Stop Loss was triggered 0 times or 0.00% of the time.
Stop Profit was triggered 0 times or 0.00% of the time.
Trailing Stop Loss was triggered 0 times or 0.00% of the time.
You held for the maximum period of time (20 days) 1 times or 0.60% of the time.
An exit trigger was executed 166 times or 99.40% of the time.







shainadir
25 posts
msg #101218
Ignore shainadir
6/12/2011 3:24:28 PM

FortyFour

Even with a lower ROI, I would expect that Kevin's orignal filter would have a better bottom line cash result due to the fact that his filter produced more trades.

duke56468
683 posts
msg #101220
Ignore duke56468
6/12/2011 4:00:15 PM

In the backtest if I leave the "selection method" blank will SF choose the stocks in the order of the filter selection or do I have to write in a selection method??

fortyfour
189 posts
msg #101221
Ignore fortyfour
modified
6/12/2011 4:31:25 PM

Shainadir,

Thanks for pointing that out to me. The 15% width is extreme and I shouldnt have posted it as such.
A better method (eliminate about 160 SP500 stocks... everyone of those Electric Utilities etc..) , yet, include the
likes of APPL...... change the 99 day average bb width to 7% .

It now yeilds equity of $200,526 with 342 trades (approx 160 low volatility SP500 stocks eliminated)
The "original" master ( and I do mean that ! ) yeilds $183,700 with 515 trades


This would be a much more reasonable "look" in StrataSearch than the 15% bb filter.
Thanks.
Kevins exit of Zscore above -1 is used as well.


PS.
The display regarding BB's (width etc..) on the SP500 is posted below if anyone is interested...

PS. #2
Side by side comparisons within stockfetchers backtesting feature( never used this much) show that
cash(equity) was increased in method #2 mostly by changing(unintentionally) the max open positions to 6f(from 10)
and max daily entries to 3(from 5)
Setting to 10 and 5 as it is in study #1... the volatility exclusion reduced trades from 505 to 480 (not much) and
cash was nearly the same...
I should leave this type of analysis to others...

***************************************************************************************

Statistics · Performance Chart · Trades · Equity Summary new! · System Summary · Edit Backtests · Backtest Forum · Help
Approach Information
Approach Name: kevin_wide_bb_width
Test started on 06/10/2009 ended on 06/10/2011, covering 505 days
Filter used:
Market is sp500
/*FIRST DETERMINE HISTORICAL RATIO OF S&P STOCK TO THE SPY OVER THE LAST 16 DAYS*/
SET{PRICERATIO, CLOSE / IND(^SPX,CLOSE)}
SET{RATIOMA16, CMA(PRICERATIO,16)}
SET{RATIOSTD16, CSTDDEV(PRICERATIO,16)}
SET{DIFF16, PRICERATIO - RATIOMA16}
SET{ZSCORE16, DIFF16 / RATIOSTD16}
ZSCORE16 BELOW -2
WILLIAMS %R(16) BELOW -94
CLOSE BELOW LOWER BOLLINGER BAND(16,2)
CLOSE ABOVE MA(200)

ADD COLUMN WILLIAMS %R(16)

/* 99 DAY AVERAGE BOLLINGER WIDTH */
set{hh, bollinger width(16,2)}
set{width_per, hh * 100}
set{wsum, sum(width_per,99) }
set{99_width_avg%, wsum/99}
add column 99_width_avg%

99_width_avg% > 7
sort column 6 descending



Trade Statistics
There were 342 total stocks entered. Of those, 336 or 98.25% were complete and 6 or 1.75% were open.
Of the 336 completed trades, 233 trades or 69.35%resulted in a net gain.
Your average net change for completed trades was: 1.33%.
The average draw down of your approach was: -3.50%.
The average max profit of your approach was: 3.30%
The Reward/Risk ratio for this approach is: 2.51
Annualized Return on Investment (ROI): 60.00%, the ROI of ^SPX was: 17.03%.

Exit Statistics
Stop Loss was triggered 0 times or 0.00% of the time.
Stop Profit was triggered 0 times or 0.00% of the time.
Trailing Stop Loss was triggered 0 times or 0.00% of the time.
You held for the maximum period of time (20 days) 0 times or 0.00% of the time.
An exit trigger was executed 336 times or 100.00% of the time.

***************************************************************************************


Fetcher[market is sp500
draw bollinger band(16,2)
sort column 5 descending
draw williams %r(16)

/* CURRENT BOLLINGER WIDTH PERCENTAGE*/
set{bb, bollinger width(16,2)}
set{bb_width%, bb * 100}
add column bb_width%

/* 99 DAY AVERAGE BOLLINGER WIDTH */
set{hh, bollinger width(16,2)}
set{width_per, hh * 100}
set{wsum, sum(width_per,99) }
set{99_width_avg%, wsum/99}
add column 99_width_avg%

/*PRICE's PERCENTAGE(distance) FROM LOWER BOLLINGER BAND*/
set{ee, close - lower bollinger band(16,2)}
set{rr, ee/lower bollinger band(20)}
set{From_Lower%, rr * 100}
add column From_Lower%

/*PRICE's LOCATION IN RELATION TO LOWER AND UPPER BB*/
/* IE: "KMB" MAY BE 2% AWAY FROM LOWER BB BUT 50% AWAY FROM LOWER BB*/
/* IE: "JDSU" LIKEWISE MAY BE 2% FROM LOWER BB BUT ONLY 10% AWAY FROM LOWER BB*/

set{yy, From_Lower% / bb_width%}
set{fraction_per%, yy * 100}
add column fraction_per%
]












03bsbme
20 posts
msg #101226
Ignore 03bsbme
6/12/2011 7:41:21 PM

What would you use for a stop loss or exit if it goes against you? Some of these have drawdowns of more than 20%. Perhaps if the zscore falls more (ie from -2 to -3)?

novacane32000
331 posts
msg #101228
Ignore novacane32000
6/12/2011 9:57:37 PM

03
The best exit is a cross above -1 Zscore.

I backtested with a 5%,7% and 10% stop.

Also tried exits after 5 days and 10 days .

Only during a few isolated time periods were these exits better. At this point ,I am only using the Zscore exit.

Kevin_in_GA
4,599 posts
msg #101229
Ignore Kevin_in_GA
6/12/2011 10:24:00 PM

What would you use for a stop loss or exit if it goes against you? Some of these have drawdowns of more than 20%. Perhaps if the zscore falls more (ie from -2 to -3)?
+++++

Two options - double down and increase your positions on both sides, recognizing that now the attractiveness of this pair is even higher, or cut your loss and move to another pair trade.

No system can avoid the occasional bad trade. One of the reasons I built in a maximum holding period was to mitigate these types of situations, since nothing prevents them entirely.

I looked at adding a second exit criteria of "zscore(16) < -3" and allowed the maximum days held to vary. The stats are essentially unchanged, but you get a very slight improvement when you reduce the max holding period to 16 days from 20.

This argues that if you were to "double down" when the zscore(16) went south of -3, you would basically make more money than cutting your losses.

Kevin

novacane32000
331 posts
msg #101235
Ignore novacane32000
modified
6/13/2011 5:31:56 PM

Here is a strategy that may help with slippage without hurting performance results.

Buy with a limit order (use your discretion here .25%, .50%, 1%) at the open the day after a signal.

I am using a max portfolio of 7 since my acct is not so big but this should work fine with 10 also. There are enough signals generated daily that if your order does not get filled one day you can enter a limit order the next day on another signal.

I will need to review trades on previous backtest to determine how often you would get filled and more importantly how often you will miss on a pick that takes off .

For now, here are my current holdings with the % limit below the open I could have used and still got a fill.

GT 1%
THC .25%
LO 1%
ANF 1%
WM (Probably would not have been filled .20%)
KIM 1%
ALTR 1%

5 OF 7 would have been filled at a better price using a limit order 1% below the open.
THC did not drop much from the opening price.
WM –tough fill, only dropped .03 from the open


I’m sure many of you do this as common practice.

I have always entered w/ a market order.


StockFetcher Forums · Filter Exchange · HOW TO DESIGN A SYSTEM (NOT JUST A FILTER)<< 1 ... 3 4 5 6 7 ... 43 >>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.