Thanks for this post, it prompted me to check on my cash balances and I was overdue some FX trading! Not sure - I don't own T-bills. I have a bunch of T-bill like ETF's which I invest most of my spare cash in, leaving the rest to cover margin. I keep changing my mind about this, as the yield pickup vs cash probably isn't that large. The sweeping does happen, although sometimes if delayed it can trigger a false margin call. Rob
But do you then just accept not earning any interest in the "futures segment"? And do you always leave enough cash in the account to cover t+1 variation margin call? If too tight of a cash buffer is left, you may need to keep an eye on after a bad P&L day in order to sell your T-bill-like-ETFs and avoid interest charge on the securities segment..don't you?
Let's start from the beginning. Apologise if this is retreading ground you are familiar with, but I think it's required as you're clearly in a bit of a knot here. A forecast is proportional to price change / standard deviation of price changes. So it is unitless. We set a forecast of 10 as equal to the average as an arbitrary number. Seperate from that, we want to take positions in an instrument with a given risk relative to our capital. For the moment, assume we want to take an average sized position. So we don't worry about the forecast, and we can ignore the term (capped forecast / 10). Also suppose for now we are only trading a single instrument. So the term IDM * Instrument weight can again be ignored. Don't worry, I will come back to it, as that is the source of your confusion. What we are calcualating is what I call a subsystem position. Its the position we would have if we were trading our entire capital on a single instrument. Next thing is to work out how much annualised $ risk we actually want to take (assuming a $ account w.l.g.). That will be equal to the capital * target risk. Now we need to translate that into a number of contracts. We need to know the $ risk of a given contract. Then the number of contracts = capital * target risk / $ risk per contract The $ risk per contract is equal to the price * % standard deviation of price changes ('volatility') * FX Substituting in, the number of contracts we need to buy then for the subsystem position is: capital * target risk / (price * % std. dev * FX) You know what, we might as well throw in the forecast now: forecast * capital * target risk / (price * % std. dev * FX * 10) To reiterate, that is the subsystem position. It's as if our entire capital was in a single instrument. And we have divided by the standard deviation of the instrument returns, and we won't do it again. Now we have the job of allocating our capital proportionally to a bunch of subsystems. This is a portfolio optimisation problem. We can calculate p&l streams as we have prices and positions. And from those we can calculate correlations and means if we want to use those (personally I mostly only use the correlations!). And standard deviations. Note that these are not the standard deviations, correlations or mean returns of the underlying instruments! They are the relevant estimates for the p&l streams of the subsystem positions on each instrument! Because each subsystem is calibrated to hit the same target standard deviation, their standard deviations will all be roughly equal to target risk. They won't be exactly right, since we can't forecast standard deviation perfectly, and because especially for short history the forecast won't exactly average out to 10. It's for this reason that my default is to equalise the standard deviations and not estimate them. However if we do use standard deviations, their effect on the weights would be minimal (plus or minus 20% around the risk target except for very short history). Yes we will be dividing by standard deviations, but to reiterate they are not the instrument standard deviations. From this we get the instrument weights, and we can then calculate the IDM. At the portfolio level then our position = IDM * instrument weight * subsystem position And if you substitute you will obviously recover the initial formula. Hope that makes sense. Rob [Geeky note - don't read if you get confused: we've divided by standard deviation once, but actually since the forecast = price change / standard deviation, we actually divided by std dev^2. So the position is proportional to 1/std dev^2 which you may recognise as the kelly criterion]
What's the average margin to NAV ratio for most people here? 20%-30%? If you are losing 4% on 25% of your portfolio, that's a 1% "treasury" drag. For a 25% vol portfolio, that's a 0.04 sharpe drag due to loss of interest on margin.
I got some errors the last few days when submitting an order for SP400_micro to IB: 201: Order rejected - reason:MARGIN CALCULATION IS NOT SUPPORTED FOR THIS CONTRACT. PRODUCT IS CURRENTLY UNAVAILABLE FOR TRADING. Does anybody know what is going on there? Is this contract never tradable on IB?
Thank you for taking the time to explain this thoroughly Rob. Yes, I get where you are going now. Yes this key! Correlations and Vol are based on subsystem p&l streams of each instrument not the instruments themselves, we've already done that! I get that since they are already calibrated to target risk so we can default to equal vol. The first thing I did when I became confused was to "eyeball" SOFR weightings in your private config yaml. It was clear that vol was not driving the weighting. Instrument weights are unaffected by vol at this point since we've already done that. Tying this back to the handcrafting script: 1.Form each 3‐instrument cluster: •Use the (Fisher‐transformed) correlation matrix for those 3 instruments to do a mini‐HRP allocation. •That yields 3 “within‐cluster” weights whose sum is 1. •You then build a cluster P&L (a weighted combination of the 3 underlying instrument returns). 2.Move up a level: •Now each newly formed “cluster P&L” is treated like a single instrument. •You group those cluster P&Ls into bigger clusters, again applying the same HRP logic with correlation matrices (this time at the cluster level). •The result: each cluster gets a weight summing to 1, allocated among its sub‐clusters. 3.Repeat until one top‐level cluster remains: •Ultimately you have a single “global cluster,” which is the entire portfolio. •By recursion, each original instrument ends up with a final weight = (weight in sub‐cluster) × (weight in parent cluster) × … all the way up the tree. 4.Compute final portfolio stdev and apply the IDM: •Once you have final instrument weights from the HRP tree, you check the overall variance (using the correlation matrix of all instruments). •Finally, multiply those raw weights by 1/SQRT(Variance) Voila IDM! Do I have it now?
My margin/NLV in IBKR is about 30%. I only have futures in this account and have simply left the AUD cash there on which I get paid some interest every month. I only went live q4 last year so I still need to figure out the best way to optimise the cash... Would love to hear what others are doing as well. Putting a part of the 'idle' cash balance in a treasury/cash based ETF may be helpful.