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

Rick67
64 posts
msg #101082
Ignore Rick67
6/5/2011 10:15:56 AM

Great work Kevin...

RE: "So in a single massive optimization"

You have a very smooth equity line over a long period of time which is always a great sign.

Just want to throw this out there:

Optimization can be a trap since your are "curve fitting". It looks great on paper, but next month, the market's "curve" could be different and your system could fail.

Have you tried doing walk forward testing? Or testing different periods over the past as opposed to one large period?

I do appreciate your postings and like to follow what you do!!





seanban
22 posts
msg #101083
Ignore seanban
6/5/2011 12:05:32 PM

Kevin,
If your filter run example, you posted the results returned last Friday and selected just 3 stocks: AMD, SWY and DD. Is there some reason that the other 11 were not seleted?

Thanks - Sean

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.