Home › Forums › Trading System Mentor Course Community › AmiBroker Coding and AFL › rotation rule
- This topic is empty.
-
AuthorPosts
-
August 26, 2018 at 9:12 am #101844DanielBaeumlerMember
I listened to Nick’s presentation he gave to CMT regarding momentum investing. In this presentation, Nick shared some very interesting insights on the rules of his Trade Long Term momentum system.
One criteria really caught my interest: Suppose your portfolio is holding 10 positions. If a position is dropping out of the top 10 (e.g. to ranking position 11), you would normally replace it. But Nick is applying a different rotation rule. In this scenario, he would only replace a position, if it drops out from the top 20 ranks. I really like this approach and would love to try it out on my systems. I’m running an aggressive portfolio with just 5 positions and often have a position dropping to position 6 or 7 in one month and returning back to the top 5 in the following month.
Has anybody applied such a rule yet or knows how to code it?
Cheers.
P.S. I really recommend listening to Nick’s presentation. There is always something new to learn…
August 26, 2018 at 2:02 pm #109045LEONARDZIRParticipantDaniel
My Nasdaq aggressive rotation position keeps stocks as long as they rank in the top 20.August 26, 2018 at 4:24 pm #109047DanielBaeumlerMemberLen,
how did you code the backtest section? I suppose your portfolio size is smaller than 20?
Below code snippet from the template for momentum systems assume that the rotation logic is connected to portfolio size.posqty = Param(“# Positions”,10,1,100,1);
Eq = Param(“Initial Equity”,100000,1,10000000,1);
SetOption(“InitialEquity”,Eq);
SetOption(“MaxOpenPositions”,posqty);
SetOption(“UsePrevBarEquityForPosSizing”,True);
SetOption(“AccountMargin”,100);
SetTradeDelays(0,0,0,0);SetBacktestMode(backtestRotational);
EOM = Month() != Ref(Month(),-1);
score = ;//score is the rotational criteria
Score = IIf(LE,score,0);
PositionScore = IIf(Year()>=1985 AND EOM,score,scoreNoRotate);August 26, 2018 at 7:34 pm #109050LEONARDZIRParticipantDaniel,
Used same code above plus:
MinRank = Param(“Min Rank”,20,1,500,1);
SetOption(“WorstRankHeld”,MinRank);I used 5 positions for Nasdaq aggressive.
August 26, 2018 at 7:39 pm #109051LEONARDZIRParticipantposqty = Param(“# Positions”,5,1,100,1);
Eq = Param(“Initial Equity”,100000,1,10000000,1);
MinRank = Param(“Min Rank”,20,1,500,1);
SetOption(“InitialEquity”,Eq);
SetOption(“MaxOpenPositions”,posqty);
SetOption(“UsePrevBarEquityForPosSizing”,True);
SetOption(“AccountMargin”,100);
SetOption(“AllowPositionShrinking”,True);
SetOption(“WorstRankHeld”,MinRank);SetTradeDelays(0,0,0,0);
SetBacktestMode(backtestRotational);
score = Ref(Rank,-1) ;
Score = IIf(LE,score,0);
PositionScore = IIf(Year()>=1985 AND EOM,score,scoreNoRotate);August 27, 2018 at 4:37 am #109053JulianCohenParticipantThe thing I gleaned from the video was adding an absolute momentum rule to the system, comparing each stock to the index as well as each other. In fact it seems slightly redundant as the stocks at the top of the list seem to have a much higher ROC than the Index, but it is a good idea and I added it to my systems.
August 27, 2018 at 8:00 am #109056DanielBaeumlerMemberLen,
thank’s a lot. That’s exact what I was looking for.Julian,
yes, I thought about it as well but didn’t figure out how to use the momentum of the index. As you pointed out already, the top ranks by definition will always outperform the index.August 27, 2018 at 8:48 pm #109058Nick RadgeKeymasterQuote:The thing I gleaned from the video was adding an absolute momentum rule to the system, comparing each stock to the index as well as each other. In fact it seems slightly redundant as the stocks at the top of the list seem to have a much higher ROC than the Index, but it is a good idea and I added it to my systems.I did on this back in 2015.
[video width=640 height=360 type=vimeo]141505640[/video]
August 28, 2018 at 7:08 am #109059RobGilesMemberGot a lot out of that presentation thanks Nick.
August 28, 2018 at 9:25 pm #109057Nick RadgeKeymasterQuote:The thing I gleaned from the video was adding an absolute momentum rule to the system, comparing each stock to the index as well as each other. In fact it seems slightly redundant as the stocks at the top of the list seem to have a much higher ROC than the Index, but it is a good idea and I added it to my systems.The subtle difference is that is measuring the ROC over an average period of time.
August 29, 2018 at 3:16 am #109046RobGilesMemberAgree with Daniel, If you’re building a momentum system watch Nick’s CMT presentation. It’s given me more clarity as to what I want to investigate next.
September 4, 2018 at 5:05 am #109052RobGilesMemberLen Zir wrote:Daniel,
Used same code above plus:
MinRank = Param(“Min Rank”,20,1,500,1);
SetOption(“WorstRankHeld”,MinRank);I used 5 positions for Nasdaq aggressive.
Len, Others, is there a rule of thumb here on how many positions you have in your portfolio and how far down the ranking list the cut-off has to be? i.e. the example given in Nick’s presentation was a system with 10 positions, will still hold them if they are in the top 20. So if your’re running 15 positions, top 30? 5 positions / top 10?
FWIW I tested my USMOM system (S&P500) by optimizing the MinRank variable and it made no real difference.
September 4, 2018 at 12:07 pm #109123LEONARDZIRParticipantRob,
I didn’t follow any rules. I just tested.September 4, 2018 at 1:30 pm #109126RobGilesMemberLen Zir wrote:Rob,
I didn’t follow any rules. I just tested.thanks Len….did you get any uplift in results?
September 4, 2018 at 6:05 pm #109127LEONARDZIRParticipantRob,
As far as my nasdaq aggressive rotation a minimum rank of 20 was best for my system. -
AuthorPosts
- You must be logged in to reply to this topic.