In 2022, there still exists someone trading discretionarily? 
You should not spare constructive criticism, just because he is a gentleman

You should not spare constructive criticism, just because he is a gentleman



Now that was a pleasant day. My futures trading system achieved its best daily profit ever. And I had to transfer out excess cash twice within the last 24 hours, to avoid that my portfolio is getting too large to my liking.

Problem is fixed, though I need to tidy up the production code, but I had to recalibrate the shadow_cost parameter to 50, otherwise I was trading far too slowly. Latest commit should work, but be careful if you have shadow_cost in your private_config.yaml as that will need overwriting.
If you're using your own implementation of this method then hopefully it's clear what the difference is but ping me if you want more clarification.
Rob
I think I'm calculating costs slightly differently, because I express both costs and GapSigma in USD.
I.e. when I first calculate risk of the gap portfolio I use daily percentage returns: (TodayPrice-YesterdayPrice)/YesterdayPrice and standard deviations of these returns, (the weights are calculated as FullNotionalUSDPrice*Units/BaseSystemCapital) so my portfolio sigma is initially in daily percentage units, I then multiply it by BaseSystemCapitalUsd which gives daily risk of the gap portfolio in USD and then I add trading costs to it which is also in USD.
GapSigmaUSD = GapSigmaPercentDaily*BaseSystemCapitalUsd+CostsUSD
Trading Costs are calculated for each product in the gap portfolio as
CostsUSD=(BidAskSpreadUSD+CommPerCtrUSD)*NumUnins * shadowCostsDaily
and then summed up for all instruments in the gap portfolio.
My ShadowCosts parameter equals to 30, but I treat it as annual value, therefore I divide it by 16 to get daily (shadowCostsDaily=1.875) because everything else is also "in daily units".
My buffer is currently 0.017, and I still think the system is trading a bit too fast (up to 2x from before, didn't fully analyzed it yet). Not sure if my ShadowCostAnnual is really in the same units as in pysystemtrade or not, 30 and 50 look pretty close..