Discussed here https://qoppac.blogspot.com/2015/05/systems-building-futures-rolling.html Or you can wait for my next book which will also discuss this. GAT
I look forward to it, I've managed to poke around and get the optimization running. I look at how instruments are differing thought time. With the 'chapter15' provided system I find Sharpe .7, is your blog post system very different to this?
Awesome! So in the end you just used Shadow cost 250 and Buffer size 0.0125 based on common sense, checked that the results weren't crazy (higher turnover but lower costs) and didn't optimize these values any further.. So just to confirm, trading costs used in the objective function are calculated as (commissions + Bid-Ask-spread of this contract)*number of contracts to trade, where the Bid-Ask spread is I guess averaged over some time period per contract(actually per instrument using one of it's contract's bid-ask prices) once and isn't dynamically updated ? Also, regarding Correlation matrix shrinkage, is it something related to pandas only? I actually never checked in any way my correlation matrixes, I mean I just put the pairwise correlations into the off-diagonal elements and then use it to compute portfolio standard deviation, I'm not using pandas, just some regular matrix multiplication library in C#., Does is make sense maybe to add a sanity check before taking square root that the variance is positive, and if it isn't discard this attempt., or it's still advisable to implement shrinkage routine ? Is this the shrinkage implementation in pysystemtrade: "https://github.com/robcarver17/pysy...e66b0/sysquant/estimators/correlations.py#L78" ?
Well I do periodically check my bid/ask are good; but then once I have a value for cost per trade I adjust it historically according to price volatility in the past. Yes that's the shrinkage function. I'd definitely advise a sanity check for positive variance, unless it's going to be very obvious that you've done sqrt(-x); my problem is I originally had a try: except: which caught this so didn't realise what was going on (schoolboy error; always keep your code brittle when in the research phase; then in production only build in exception handling which logs loudly if it's ignoring an error). Then if you're seeing a lot of negative variances you know you have a problem to solve, eithier through shrinkage or finding the nearest psd matrix. GAT