The Motley Fool Discussion Boards

Previous Page

Investing/Strategies / Mechanical Investing

URL:  http://boards.fool.com/in-light-of-all-the-re-coding-ive-been-doing-30300613.aspx

Subject:  Re: ER hedge Date:  10/4/2012  4:31 PM
Author:  rgearyiii Number:  239782 of 253842

In light of all the re-coding I've been doing lately, I can't say for certain whether I've torpedoed DrBob2's blend or his blend has torpedoed my backtester (or I've just misinterpreted something), but taking my backtester's results at face value, the blend seems pretty well sunk.

The screens don't actually require any SI Pro data, so they can be tested from when Nasdaq started reporting daily volume in early 1983.

I could have constructed a formula for Efficiency Ratio out of monthly g-prices using the functions gprc, abs and linear (and that may be a good way for a highly motivated user to check what I've done) the way DrBob2 did in RadiScript, but it was probably faster to just whip up a dedicated Efficiency Ratio function within the backtester itself. I've added the field function er, which takes three parameterizable arguments like the functions beta, xret, vol and gsd. The first is lag, the second is number of periods, and the third is the length of periods in market days.

Here is my construction of the long screen:

http://backtest.org/gtr1/2011/?aprc%281%29gt5:product%28av63...
Translation:
Create [ER]: [Efficiency Ratio of 21-day g-price changes over 10 periods; lag=1 days]
step0: [Actual closing Price; share_lag=1 days; quote_lag=1 days] > 5
step1: [[Actual Average daily Vol 63d; lag=1 days]*[Actual closing Price; share_lag=1 days; quote_lag=1 days]] > 500000
step2: [Security Type] != 30,31,36
step3: [Fama/French Industry Code] != 48
step4: [mkt Days Since Investment Opened for purchase] > 210
step5: [ER] >= 0.7
step6: [ER] < 0.9
step7: [Total Return Multiplier over 20 days; lag=1 days] Top 5; Long, Cash When Fewer
Holding period = 20 mkt days; Fully rebalance every 1 periods

step2 eliminates ADRs and step3 eliminates the miscellaneous financial stocks.

The screen to be shorted is this:
http://backtest.org/gtr1/2011/?aprc%281%29gt5:product%28av63...

Neither Keelix nor DrBob2 are explicit about the weighting of long, short and cash positions in blends, but I've assumed 1 part long, -1 part short and 2 parts cash in the blend:
http://backtest.org/gtr1/2011/blend.cgi?-1:aprc(1)gt5:produc...

The results for 19830131 through yesterday are as follows:

                 Avg      Min      Max       SD
CAGR: 11.50 6.61 15.67 2.66
TR: 3017.96 564.79 7321.46 1972.49
GSD(20): 24.54 22.52 26.15 1.16
DD(20): 15.63 13.48 18.37 1.32
MDD: -54.87 -81.67 -43.50 10.39
UI(20): 19.14 10.97 35.91 5.65
Sharpe(20): 0.42 0.22 0.59 0.11
Beta(20): -0.14 -0.24 -0.03 0.06
TI(20): -83.97 -342.36 -25.35 67.08
AT: 12.13 12.04 12.20 0.04


I might as well reveal a new feature of the backtester: Putting -picks in the miscellaneous options box causes the backtester to run in screening mode, revealing the stock selections and all field values on the last market date of the backtest. Currently, only screens that do not use VL, VL+, SI Pro or WER data can reveal their screen selections, but conveniently, the screens above do not use any of this data. (All of the data that is currently displayed can be obtained from free sources online.) Here is a temporary direct link to the screening results for the long screen: http://backtest.org/gtr1/2011/csv/vmmnucstfo.csv

Thus, I encourage people to check my backtester's calculations of Efficiency Ratio and other price/volume-based metrics against what you come up with using your own data.

Robbie Geary

PS I'm working on a system for allowing VL, VL+ and SI Pro screening only for users who can prove they are subscribers by uploading the latest installation files. If the uploaded file matches what's on the server, then their browser gets a cookie that allows them to screen on that data until the next week's update. If there are any CGI Perl programmers who would like to help with this in the next week, send me an email.
Copyright 1996-2014 trademark and the "Fool" logo is a trademark of The Motley Fool, Inc. Contact Us