Home › Forums › Trading System Mentor Course Community › Progress Journal › Olivers Weekly Journal
- This topic is empty.
-
AuthorPosts
-
February 15, 2016 at 3:51 am #101421AnonymousInactive
I have started to code up a momentum strategy based on the concept outlined in Andreas Clenow’s book, stocks on the move. It ranks stocks at the end of each month based on exponential regression, and buys and sells on the open of the first trading day of the following month.
Parts that I have yet to finalise are as follows
1. How to code in risk parity position sizing. To date, I have only been using fixed percentage position sizing. Discussing this with Craig tomorrow
2. I have included an index filter, however I also want to test a “Go To Cash” switch, which will force the portfolio to close all holdings if triggered, on any day, and repopulate, on any day if back on. I am not sure as yet how to include this outside the current monthly re-balance.Once I have dealt with the above 2 issues, later this week I will take a look at the following
1. Run an optimization on the momentum look back period to see the impact of various look back lengths
2. Do the same for the index filter lengthOliver
February 15, 2016 at 5:27 am #102818TrentRothallParticipantHi Oliver, just wondering if you are working on a ASX or US system?
February 15, 2016 at 9:00 pm #102819AnonymousInactiveHi Trent,
Initially taking a look at US stocks, so just using the S&P500 and Nasdaq100 as my stock universe. To date, I have just been running fixed % position sizing, using 10 positions.
February 15, 2016 at 11:44 pm #102827TrentRothallParticipantOk nice, that should work well
February 21, 2016 at 2:20 pm #102820StephaneFimaParticipantHi Oliver,
My goal is also to code Clenow’s system.
I think I am not the only one here to try to do so. Why not putting our efforts all together under the supervision of Nick and Craig?
We could start a new thread about it.What do you think?
Regards
StephaneFebruary 21, 2016 at 8:39 pm #102857Nick RadgeKeymasterA great idea.
We will be adding some new content to the course regarding a Rotational system.
When Craig returns we’ll start compiling info.
February 21, 2016 at 10:27 pm #102858AnonymousInactiveMorning Stephane,
I am more than happy to collaborate. I have coded his method of ranking stocks, being exponential regression adjusted for R squared. I am pretty sure it is correct, as I double check the calculations in excel. I have attached an amibroker AFL file with the calculations. It can be used both as an exploration and also an indicator, as it plots.
February 21, 2016 at 10:37 pm #102871AnonymousInactiveWhoops, I can’t attach an AFL file. If you would like me to paste the code in a comment, let me know and I am happy to do so.
There are a couple of parts of Chenow’s method that I am yet to look at.
1. He also uses a 100 day MA stock filter. I have added this filter as part of the initial ranking process, however currently, my system only takes this into account at the initial buy. I am not sure exactly, but I think he uses this filter at every re-balance. Currently, my system will continue to hold the stock if it remains a top ranked stock even if it falls below the 100 day MA.
2. I am yet to code in the gap filter, whereby stocks with a large gap are removed.
February 21, 2016 at 10:50 pm #102821Nick RadgeKeymasterTo post code use the ‘Post Code’ function above:
Here is some Gap Code for you:
Code:GpP = Param(“Gap %”,15,1,200,0.01);
GpD = Param(“Gap Up Lookback”,100,1,1000,1);
PF1 = C;
PF2 = Ref(C,-1);
R1 = ((PF1-PF2)/PF2)*100;G1 = GapUp() AND R1 > GpP;
GapNum = Sum(G1,GpD);
GapFilt = GapNum == 0;February 21, 2016 at 10:57 pm #102822AnonymousInactiveThanks Nick,
The below code calculates the adjusted exponential slope, explorer and indicator.
Code://———————————————————————————————————————-
// Adjusted (R2) Exponential Regression Slope
//———————————————————————————————————————-Period = Param(“Period”,90,2,300,1);
Expo = log(Close);
R2 = Correlation(Cum(1),Expo,Period)*Correlation(Cum(1),Expo,Period);
AdjExpSlope = (((exp((LinRegSlope((Expo),Period)))^250)-1) * R2) * 100;
“”;
“AdjExpSlope ” + NumToStr(AdjExpSlope,1.2);//———————————————————————————————————————-
// Exploration
//———————————————————————————————————————-Filter = AdjExpSlope;
AddTextColumn(FullName(),”Company Name”,1,colorDefault,colorDefault,500);
AddColumn(Close,”Closing Price”,1.3,colorDefault,colorDefault,100);
Addcolumn(AdjExpSlope,”Adj Exponential Regression Slope”,1.5,colorDefault,IIf(AdjExpSlope >= 0,colorGreen,colorRed),200);SetSortColumns(-5);
AddRankColumn();//———————————————————————————————————————-
// Plotting
//———————————————————————————————————————-Plot(AdjExpSlope,”Exponential Regression Slope Adj”,IIf(AdjExpSlope<0,colorRed,colorGreen),styleHistogram);
March 6, 2016 at 11:38 am #102872StephaneFimaParticipantHi
I am now working also on the Clenow System.
1) Just one remark on the code above: are you sure we have to convert the price with the common log and not the natural one (i.e. ln () )?
2) Nick, on the Gap code you posted above, I read again Clenow’s book and I think that he wants to avoid not only gap up but also gap down.March 6, 2016 at 1:53 pm #102924SaidBitarMemberHi
Just one comment regarding avoiding the gap down. No need to bother about it since you will be using the slope of the exponential regression.
in case of gap down then the slope will turn downMarch 6, 2016 at 2:20 pm #102926SaidBitarMemberHi Oliver,
i am interested to know the results of your backtest.
i used ROC but not exponential regressionthanks
March 6, 2016 at 9:03 pm #102823Nick RadgeKeymasterQuote:1) Just one remark on the code above: are you sure we have to convert the price with the common log and not the natural one (i.e. ln () )?I’m not suggesting to use one or other – it’s just code I have.
Quote:2) Nick, on the Gap code you posted above, I read again Clenow’s book and I think that he wants to avoid not only gap up but also gap down.I wouldn’t think a gap down would be partial to generating an entry signal. I certainly didn’t read it like that, but as usual, test it.
March 6, 2016 at 9:21 pm #102925AnonymousInactiveMorning Stephane,
I am fairly confident that how I calculated the exponential slope is the same as the method in Clenow’s book. I replicated his workings in excel, and cross checked with my code, and was getting the same slope coefficients.
On page 81 of his book, he shows the excel functions required to get the slope coefficients he uses.
Always good to double check, as I may have made a mistake somewhere.
Regards
Oliver
-
AuthorPosts
- You must be logged in to reply to this topic.