StockFetcher Forums · Filter Exchange · HOW TO DESIGN A SYSTEM (NOT JUST A FILTER)<< 1 ... 2 3 4 5 6 ... 43 >>Post Follow-up
Kevin_in_GA
4,599 posts
msg #101158
Ignore Kevin_in_GA
6/10/2011 7:30:43 AM

Not really. I ran several variants that looked at exiting when the Z score was >-0.5 and >0 and neither did as well. I also looked at extending the maximum days held, but these trades are typically completed in 5 days or less, so it added nothing.

seanban
22 posts
msg #101183
Ignore seanban
6/10/2011 3:09:18 PM

novacane320000

"I took a look at setting a stop at the open of the next day after a sell trigger but that will not improve results-With the small sample size I looked at most times I got a worse fill with the stop than I would have by just selling at the open.

As far as which is best all depends on which way the market and your stock is headed when you sell.

Either way ,very excited at the potential here. Big thanks to Kevin for his work. "

Thanks for your reply. One variant I'm building into the paper trade system is to buy on green i.e. only when it trades a few cents above the open price and round numbers.

As today was predictably a red day, I'm wondering if there is a way to improve the approach.

Indeed a big Thanks to Kevin for his inspired feedback.

Sean

novacane32000
331 posts
msg #101193
Ignore novacane32000
6/10/2011 10:29:48 PM

I started tracking slippage today.

I enter my actual buy and sell prices real time and then also track the trade based on the opening price the day after the signal.

My expectation is to get better fills in a down market and worse fills in an up market.

Kevin_in_GA
4,599 posts
msg #101196
Ignore Kevin_in_GA
6/11/2011 8:38:29 AM

Just following up -

SWY: bought at 22.28, sold at 22.36
FMC: bought at 78.68, sold at 79.02

KIM: bought at 17.66
ALTR: bought at 43.94

No exit signals for Friday.

mdrobish
1 posts
msg #101205
Ignore mdrobish
6/11/2011 11:12:07 AM

Kevin, not sure if I'm missing something...I am trying to code this in NT to see if the backtesting correlates...I'm pretty close, but I think I'm missing the meaning of the thresholds. Are they use to actually trigger the buy? It seems they are only being set.

Kevin_in_GA
4,599 posts
msg #101208
Ignore Kevin_in_GA
6/11/2011 12:16:25 PM

Yes, the thresholds trigger both buys and sells. In an automated system this would happen intraday.

Also note that this is really only one half of a pair trade (go long the stock while simultaneously going short on the ^SPX). Since we are looking at the ratio of the stock to it's index you bet on both the numerator to rise and the denominator to fall. This week the long stocks have held up ok, but if you had also gone short by by buying SH you would be better off since most of the movement in the Z-score came from a large drop in the ^^SPX.

Kevin

jkinghome
7 posts
msg #101212
Ignore jkinghome
6/11/2011 3:23:13 PM


_______________________________________________________________________________________________
Also note that this is really only one half of a pair trade (go long the stock while simultaneously going short on the ^SPX). Since we are looking at the ratio of the stock to it's index you bet on both the numerator to rise and the denominator to fall. This week the long stocks have held up ok, but if you had also gone short by by buying SH you would be better off since most of the movement in the Z-score came from a large drop in the ^^SPX.

Kevin

_______________________________________________________________________________________________

So, just to confirm. For example. if we are trading with a total $100K, and having 7 long positions open at all times (replacing closed positions with new positions of score >2), we would always be equally short ^SPX via an ETF like SH ($50K). We will never be closing the SH position, because we are always long with the other pair? Is that correct?

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.







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