PureBytes Links
Trading Reference Links
|
Somebody suggested, "why not try to repair the
"Achilles heel" that, in your OPINION, prevents the
Fixed Ratio method from beating the Spear algorithm?"
Good question! Why not?!
So I installed another line of code into the Trading
Recipes implementation of { CBO(89,13) + FixedRatio }
and I ran it overnight.
Eureka! Wow. Whatta difference.
I ran the very same trading system, CBO(89,13),
on the very same commdities, for the very same
period. All I changed in this version was the
number of contracts traded by Fixed Ratio.
This version explicitly trades different numbers of
contracts in different markets. The number of
contracts are normalized to "volatility" where, as
Spear's algorithm does, I am using the 15 day average
true range as an approximation of "volatility".
First I calculated the global average of the
volatilities (i.e. 15-day-ATR's) for all of the
different commodities in the test; it was about
$700 per contract. That is, if you calculate the
15-day-ATR every single day, for each of the
commodities, and you average them all together,
you get $700.
Then I normalized each position size according to
the specific 15-day-ATR of that commodity on its
trade entry signal day. So for example, if
the 15-day-ATR of Cotton was $2100 on the day
that a trade entry was signalled, then I had the
backtest trade (1/3) as many contracts as the raw
Fixed Ratio algorithm called for. Higher volatility,
smaller number of contracts. {math: $700 / $2100
equals 1/3}.
For another example, if the 15-day-ATR of Eurodollars
was $350 on the day that a trade entry was signalled,
then my backtest traded TWICE as many contracts as
the raw Fixed Ratio algorithm called for. Lower
volatility, larger number of contracts.
{math: $700 / $350 equals 2.0}.
If you find my English description confusing, take a
look at the code below. Or read about it in Tharp's
book TYWTFF.
I have added the equity curve of this new modification
onto the Excel chart (and spreadsheet) that contains
the equity curves of the Spear Algorithm and the
(raw unmodified) Fixed Ratio algorithm. So now you
can look at all three equity curves at once. And
when you do, WOW. As before, they can be downloaded as
http://www.mjohnson.com/trecipes/fr_vs_spear.xls
Here are the performance statistics, side by side,
for all three tests. I have chopped down the
descriptive prose at left, to make it fit on small
video screens. Sorry! The new algorithm is in the
last column, labeled Unequal#FR
FixedRatio SpearAlgorithm Unequal#FR
-----------------------------------------------------------------------
Starting equity.......... 80000.00 80000.00 80000.00
Final equity............. 5319261.50 13159391.00 13079522.00
Net profit............... 5239261.50 13079391.00 12999522.00
Compound AnnGrwthRate %.. 39.06 49.32 48.90
Max Drawdown (percent)... 40.61 39.12 41.87
(CAGR / MAXDD) Ratio..... 0.962 1.261 1.168
# tr days longest DD..... 572 302 404
Annual St Dev (%)........ 38.36 36.89 38.29
Avg max ann DD (%)....... 24.29 26.46 26.46
% days w new equity hi... 6.393 7.739 7.512
Sharpe Ratio............. 0.888 1.201 1.146
Semideviation Ratio...... 1.282 1.748 1.664
Return Retracement Ratio. 3.567 4.270 6.343
Sterling Ratio........... 0.556 1.503 0.729
Number of Trades......... 715 715 715
Winning Trades........... 321 321 321
% Winners................ 44.9 44.9 44.9
First day of test........ 870128 870128 870128
Last day of test......... 990810 990810 990810
# days................... 3269 3269 3269
Comm+slippage per cont... 75.00 75.00 75.00
APPENDIX C. TRADING RECIPES SOFTWARE CODE FOR CBO + UNEQUAL_#_CONTS FR
APPENDIX C. TRADING RECIPES SOFTWARE CODE FOR CBO + UNEQUAL_#_CONTS FR
************begin************
COL1 = ATR[15]
SYSTEM = 700.0 / (COL1[1] * POINTVALUE) ''** new line of code **
COL2 = MAX[H,89,1] + TICK[1]
COL3 = MIN[L,13,1] - TICK[1]
COL4 = MIN[L,89,1] - TICK[1]
COL5 = MAX[H,13,1] + TICK[1]
BUYSTOP = COL2
SELLSTOP = COL4
' Using S=80000 and Delta=12000
' Ryan Jones Fixed Ratio algorithm is next 6 lines
STARTUPCASH = 80000
MEMORY[1] = EQUITY - 80000
IF MEMORY[1] < 0.01 THEN MEMORY[1] = 0.01 'avoid sqrt(negative)
MEMORY[2] = 0.5 + ((2 * MEMORY[1] / 12000) + 0.25) ^ 0.5
IF MEMORY[2] < 1 THEN MEMORY[2] = 1
NEWCONTRACTS = MEMORY[2] * SYSTEM ''** modified line **
SELLSTOP = COL3
BUYSTOP = COL5
************end************
--
Mark Johnson Silicon Valley, California mark@xxxxxxxxxxxx
"... The world will little note, nor long remember, what we
say here..." -- Abraham Lincoln, "The Gettysburg Address"
|