I have been trying to replicate ETF HQ’s TransDow strategy. It is a neat idea, and the simplicity appeals to me. Beyond that, I’ve been working with AmiBroker to get better at coding in multiple time frames. Because this strategy uses weekly closes, I thought it would be good practice. The problem is that I cannot get my results to be any where near ETF HQ’s results. My guess is that my code has an error, but for the life of me, I cannot figure it out.
After emailing with ETF HQ, I was able to determine that their coding has the week close on Monday while my code uses Friday as the last day of the week. This should not make that much of a difference.
The AmiBroker code is below. I have put it within the WordPress quote function, so it should be able to be cut and pasted without error.
*Update* It will not cut and paste without error. The problem seems to stem from the quotation marks. I’ll leave the code here so that others can peruse it. Email me woodshedder73 at google mail and I’ll send the .afl file as an attachment.
/*TransDow as described by Derry Brown: http://etfhq.com/blog/2013/05/04/market-timing-through-market-dominance-transdow/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+EtfHq+%28ETF+HQ%29
SetTradeDelays( 0, 0, 0, 0 );
SetOption( “InitialEquity”, 10000 );
SetOption( “MinShares”, 1 );
SetOption( “MinPosValue”, 0 );
SetOption( “FuturesMode”, False );
SetOption( “AllowPositionShrinking”, True );
SetOption( “ActivateStopsImmediately”, False );
SetOption( “ReverseSignalForcesExit”, False );
SetOption( “AllowSameBarExit”, False );
SetOption( “CommissionMode”, 3 );
SetOption( “CommissionAmount”, 0.0 );
SetOption( “InterestRate”, 0 );
SetOption( “MarginRequirement”, 100 );
SetOption( “MaxOpenPositions”, 1 );
SetOption( “UsePrevBarEquityForPosSizing”, True );
RoundLotSize = 1; // 0 for Funds, 100 for Stocks
TickSize = 0; // 0 for no min. size
MarginDeposit = 0;
Totalpositions = 1;
PositionSize = -100/TotalPositions;
// Weekly Bars //
Let me know in the comments if there are any questions about the code. My data provider uses $DJI for the Dow Jones Industrial Average and $DJT for the Dow Jones Transportation Index. These symbols may have to replaced with whatever symbol your data provider uses for the $DJI and $DJT.