StockFetcher Forums · Filter Exchange · HOW TO DESIGN A SYSTEM (NOT JUST A FILTER)<< 1 2 3 4 5 ... 43 >>Post Follow-up
03bsbme
20 posts
msg #101018
Ignore 03bsbme
6/3/2011 12:36:43 AM

That is a bit surprising, but maybe that is somehow accounted for by the ratio itself. I'll have to think more about that although it appears I shouldn't spend too much time worrying about it.

On another note, if I am thinking about this correctly when the zscore drops below 2 std below the ratio it essentially means the price is falling faster (or rising slower) than the market. It could be possible that both the index and stock went down, but the stock decreased by a greater percentage. If the market continues to fall, the stock may not fall as fast, stay the same, or go up just a small amount. In those cases the ratio increases without the price of the stock increasing much if at all. Similar idea to relative strength. Perhaps you might want to consider adding in something dealing with looking at what the market is doing (going up, sideways, or down). I realize that the close being above the MA may account for that somewhat, but there might be something else that improves your system in addition to that.

I definitely like the idea behind this. Just trying to think of other things to consider. I typically like to keep things simple, but don't mind adding to things if they seem pretty intuitive.

Kevin_in_GA
4,599 posts
msg #101020
Ignore Kevin_in_GA
6/3/2011 7:00:15 AM

The strategy here is really half of a pair trade strategy. My original thinking was to simply reverse this and to simultaneously go short an overvalued stock (Z-score above 2). However, looking at all of the possible combinations of these variables failed to identify a short system that would perform anywhere near as well, or trade as frequently.

The basic thinking here was to have 2 pairs (A/B and C/B) with the first pair Z-score below -2 and the second pair Z-score above 2. Then one could go long on A and simultaneously short C to make a dollar-neutral pair strategy that mitigates some risk while generating profits from both trades.

However, one could simply buy SH (effectively shorting the market) each time you buy one of these stocks - that creates the correct pair trade since the ratio uses the ^SPX in the denominator. My guess is that you would not do as well, since we know that the market spends longer time in slow growth phases and then has short abrupt corrections.


novacane32000
331 posts
msg #101037
Ignore novacane32000
6/3/2011 2:38:02 PM

Kevin
I have been working with Stratasearch for the past week or so after reading one of your post referencing it. Appears to be a powerful program ! I am still in the learning phase.

How would you trade your SF code above? Exit ?

Kevin_in_GA
4,599 posts
msg #101040
Ignore Kevin_in_GA
6/3/2011 3:09:04 PM

Kevin
I have been working with Stratasearch for the past week or so after reading one of your post referencing it. Appears to be a powerful program ! I am still in the learning phase.

How would you trade your SF code above? Exit ?
++++++++

The Zscore function I had to write as a custom function (not hard, as the SS coding language is not too complex). You can find it here:

http://www.stratasearch.com/forum/viewtopic.php?f=3&t=950&p=4243#p4243

The entry code is:

Zscore(16) < -2 and

close > mov(close,200,simple) and

wlr(16) < -94 and

close < bbl(close,16,2)


Exit code:

Zscore(16) > -1 or

$daysheld > 20


Kevin

mystiq
650 posts
msg #101060
Ignore mystiq
modified
6/4/2011 2:13:21 AM

can this be *modified* to show 16 weeks instead....(weekly version)

novacane32000
331 posts
msg #101068
Ignore novacane32000
modified
6/4/2011 5:15:26 PM

Kevin
I have been working with Stratasearch for the past week or so after reading one of your post referencing it. Appears to be a powerful program ! I am still in the learning phase.

How would you trade your SF code above? Exit ?
++++++++

The Zscore function I had to write as a custom function (not hard, as the SS coding language is not too complex). You can find it here:

http://www.stratasearch.com/forum/viewtopic.php?f=3&t=950&p=4243#p4243

The entry code is:

Zscore(16) < -2 and

close > mov(close,200,simple) and

wlr(16) < -94 and

close < bbl(close,16,2)

Exit code:

Zscore(16) > -1 or

$daysheld > 20

Kevin
*******************************************************************************************
*******************************************************************************************

Thanks Kevin
I tried to input the code in SS but apparently need to define the custom code for Zscore as you stated (easy for you is not easy for me).
Actually, I meant to ask how the StockFetcher filter itself posted above is best traded.

Would you simply buy the stock generated by the filter and sell after the zscore goes to -1 (I entered --zscore16 > -1 on the exit trigger for the backtest but it does not trigger an exit ) or also exit after holding > 20 days?

Simply buying the stock generated and selling after 5 days has produced good results YTD 2011. If Kevin or someone else can explain to me how to backtest with an exit of zscore above -1 it would be appreciated.

Trade Statistics
There were 294 total stocks entered. Of those, 272 or 92.52% were complete and 22 or 7.48% were open.
Of the 272 completed trades, 164 trades or 60.29%resulted in a net gain.
Your average net change for completed trades was: 0.85%.
The average draw down of your approach was: -2.52%.
The average max profit of your approach was: 3.03%
The Reward/Risk ratio for this approach is: 1.97
Annualized Return on Investment (ROI): 41.77%, the ROI of ^SPX was: 8.05%.


Kevin_in_GA
4,599 posts
msg #101070
Ignore Kevin_in_GA
6/4/2011 7:21:37 PM

To exit when Zscore16 is above -1, just put the same filter as you use in the entry but make the only selection condition "Zscore16 above -1" also make sure that the maximum days held is set to 20.

Here is the specific code I use in the backtest for exits:

/*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}

zscore16 above -1


That does it.

If you look at the last 4 months, the results are as follows:

There were 105 total stocks entered. Of those, 95 or 90.48% were complete and 10 or 9.52% were open.
Of the 95 completed trades, 65 trades or 68.42% resulted in a net gain.
Your average net change for completed trades was: 1.20%.
The average draw down of your approach was: -2.95%.
The average max profit of your approach was: 2.90%
The Reward/Risk ratio for this approach is: 2.72
Annualized Return on Investment (ROI): 55.29%, the ROI of ^SPX was: -0.60%.

But more important in any backtest is not so much the stats above, but the equity generated during the test period. From the equity summary:

Starting Equity: $100,000.00
Ending Equity: Total (Cash + Market): $108,934.55
Period: 75 days

8.9% gain. Not bad, especially when compared to the market as a whole for the same period. And yes, all trades here were closed on Friday (which probably brought the real performance of the filter down a lot).

novacane32000
331 posts
msg #101078
Ignore novacane32000
modified
6/4/2011 11:07:35 PM

OK,Thanks for explain that. It seems to be the magic exit point.

I tried exits after 4 days ,5 days and 10 days.

Also used RSI(6) > 60 and >70 as exits.

All had very good results beating the market during 2 year stretches going back from 2000 to present day but none were as good as your zscore exit.

My results using your exit filter were actually better for the last 4 months than what you posted !!

I used a 10% stop loss which was only triggered twice.
Max trades /day = 2
Max open positions = 7

Trade Statistics
There were 77 total stocks entered. Of those, 70 or 90.91% were complete and 7 or 9.09% were open.
Of the 70 completed trades, 51 trades or 72.86%resulted in a net gain.
Your average net change for completed trades was: 1.54%.
The average draw down of your approach was: -2.88%.
The average max profit of your approach was: 3.29%
The Reward/Risk ratio for this approach is: 3.32
Annualized Return on Investment (ROI): 76.50%, the ROI of ^SPX was: 2.48%.


Gain for the portfolio over the 4 months was 12.81%

I will continue checking different time periods but this looks like a winner .

seanban
22 posts
msg #101079
Ignore seanban
6/5/2011 6:45:53 AM

Kevin,
Would like to paper trade this approach as of June 6th. with the limitations applied in your back testing. Am I correct in assuming the following:

- initial capital - $100K
- max 10 open trades
- filter run daily if less than 10 open positions
- select stocks with highest z-score

With these assumptions, here is the list on the Monday buy list:

FMC
LEG
AMD
SAI
SWY
SNA
PKI
ESRX
TER


Thanks again for your many contributions.

Sean

Kevin_in_GA
4,599 posts
msg #101080
Ignore Kevin_in_GA
6/5/2011 8:39:22 AM

LOWEST Zscore - remember that these are long plays, and that they need to be BELOW the normal relationship with the SPX. Think Bollinger Bands.

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