The downside is that on average, you hold a lot more positions, for the same backtest, average positions held is 22 for Rob's method vs 29 for my modified .
No this is good. That's the point of DO - more positions when you can afford them
Rob
The downside is that on average, you hold a lot more positions, for the same backtest, average positions held is 22 for Rob's method vs 29 for my modified .
I've been playing with DO implementation, and stumbled upon what could be a slight improvement so wanted to share.
I've been trading Rob's implementation of DO for about 2 years now, and I've been noticing that I would sometimes have a position on in an instrument that has optimal unrounded, eg. 0.17, and have nothing on in something with optimal unrounded 1.7. Digging into this, I think it is because since the algo is greedy, if the 0.17 one has a big notional, it will take that as that will reduce the tracking error the most in that step. Then it never gets to the 1.7 one, as the notional is much smaller.
I've made the following modification: instead of starting from 0 weights for all instruments as the starting point for the DO, start from the. I then increase/decrease the weight towards optimal unrounded weight in the DO iterations.Code:round(unrounded_optimal_position)
That does indeed reduce the occurrences I've mentioned above. It also prevents the situation of forecast flipping - when forecast is around 0, original implementation has to switch position (I believe buffering deals with that to an extent). The reason it prevents that situation is that if the optimal unrounded is [-0.49, 0.49], we'll start from 0 anyways, so variations around 0 forecast/optimal unrounded are not as impactful.
Running a backtest on 104 instruments, about 20 years of data, I get lower average tracking error, 3.81% vs 4.65% with the original method.
Here's a chart with difference over time.
View attachment 337794
The downside is that on average, you hold a lot more positions, for the same backtest, average positions held is 22 for Rob's method vs 29 for my modified version.
Risk is almost exactly the same, slightly smaller for my method.
Has anybody played with something similar? Would be interested to see if anyone could replicate these results.
I've just ran a quick backtest where DO starts with the ideal rounded positions instead of zeros, the PnL and Sharpe stayed roughly the same, but the number of trades jumped from 6558 to 8631, so by 30%.. The overall costs also jumped, but apparently a slightly higher return compensated for it? I wouldn't trust my costs 100%, but the number of trades should be somewhat reliable in my backtest..
Btw, how do you calculate tracking error in percentage?I get lower average tracking error, 3.81% vs 4.65%
I use Rob's method of having everything in weights. At that point in the process (DO stage), I don't want to have to deal with exchange rates and stuff. So I think that's your Option 1.Btw, how do you calculate tracking error in percentage?
I normally calculate tracking error in currency, e.g. an actual value could be 1,077$, how would you convert it to % ?
Good Morning globalarbtrader,As I said about 4 posts ago:
Personally I think the absolute minimum account size to trade futures is probably around the 50k mark
Rob
hmm, interesting.. I reran my backtest, there was a small error, but the result didn't change much, still the number of trades and margin\notional usage gets ~35% higher, when starting from the rounded weights...For me, SR is about 10% better for the modified version. That's all after costs, for exact same set of instruments and forecasts.
I use Rob's method of having everything in weights. At that point in the process (DO stage), I don't want to have to deal with exchange rates and stuff. So I think that's your Option 1.
Interesting that your tracking error is much lower, mine hovers around 3-4% almost all the time, sometimes dips below 3%.
Good Morning globalarbtrader,
Yes, I agree with you. $50K is needed for 1 or 2 trading systems if running the future instruments.
How many systems are you running in your portfolio?
How do you know when a system not work anymore to make you money?
Hello globalarbtrader,1) What is a system?
2) I don't know
Rob
Our tracking errors could be different because mine is "daily" and maybe yours is "annual", I feed daily standard deviations into the calculations, if I convert it to annual (0.359*16=5.7%) it becomes much closer to yours..hmm, interesting.. I reran my backtest, there was a small error, but the result didn't change much, still the number of trades and margin\notional usage gets ~35% higher, when starting from the rounded weights...
You're not seining an increase in the number of trades\capital usage?
I run this backtest with 37 instruments, 15-30y of data, at 300k capital. The DO tracking-error threshold below which I don't reoptimize comes out to 956.25$, which is 0.3% of the base capital., My actual tracking error hovers around 1.1k, or 0.35% of the base capital., although I do see a decrease in the average tracking error from 0.359 to 0.327 when using rounded weights as a start
tracking error from zero vs from rounded:
View attachment 337984
Btw, the way I calculate (gap)portfolio sigma (tracking error) is this:
var weightedStds = new List<double>(stdWeightInfo.Select(stw => stw.stDev * ( (Math.Abs(stw.unitPriceUSD) * stw.unitsBought) / totPortfPriceUSD ) ));
var varience = (weightedStds * correlationMatrix * weightedStds.Transpose())[0, 0];
var sigmaUsd = Math.Sqrt(varience) * totPortfPriceUSD;
so weightedStds is a vector of instruments' standard deviations multiplied by the proportion of that instrument(by notional) in the current portfolio..