I am trying to program a weak stock rotation system in Amibroker from active trader magazine
http://www.activetradermag.com/index.php/c/Trading_Strategies/d/Weak-stock_rotation My numbers a terrible, I think I did something wrong. I want to have a max 8 securities and buy the worst Roc every 14 days and hold for a minimum of 6 days. EnableRotationalTrading(); NumberHeld = 8; SetOption("MaxOpenPositions", NumberHeld); SetOption("AllowSameBarExit",False); // Allocate funds equally among all issues PositionSize = -100/NumberHeld; WorstRank = 7; SetOption("WorstRankHeld", WorstRank); LookBack = 14; Holdmin =6; SetOption("HoldMinBars", Holdmin ); PositionScore = Max(-ROC(C,LookBack),0); I test on the dow for the last 5 years I get -41 percent per year. I coded the same thing in wealth lab as a sanity check and I get 4 percent profit per year. Id there anyway way to debug this, I was trying to open a file and print to it. Maybe the custom back tester ?