Fully automated futures trading

I just did a report from 1st April (since I haven't made any serious changes)

RzTuwxLh5n873YVPA


https://photos.app.goo.gl/RzTuwxLh5n873YVPA

Code:
********************************************************************************
Trades report report produced on 13/09/2022 08:57 from 01/04/2022 00:00 to 13/09/2022 08:57
********************************************************************************


delay_cash Sum
                                        delay_cash
strategy_name         instrument_code            
_ROLL_PSEUDO_STRATEGY BRE               -21.358850
                      CRUDE_W_mini       64.076550
                      DJSTX-SMALL       -47.608556
                      EU-BASIC          -71.412835
                      EU-OIL             73.576860
                      IRON               12.815310
                      KR10                9.289177
                      MXP                 2.135885
                      SILVER            -18.368611
                      TOPIX              -0.600178
                      V2X                58.428683
dynamic_TF_carry      AUD               108.930135
                      BITCOIN          -364.595570
                      BRE                -8.543540
                      BUND              528.022170
                      CORN             1569.875478
                      CRUDE_W_mini     3006.258143
                      DAX                -2.596830
                      DJSTX-SMALL        23.804278
                      DOW                17.514257
                      EU-BASIC          705.472244
                      EU-OIL            -38.952455
                      EUR              1516.478353
                      EUROSTX          -510.709968
                      FTSETAIWAN        111.066020
                      GAS_US_mini     -3481.492556
                      GBP               400.478438
                      GBPEUR          -1006.250000
                      GOLD_micro       -164.035968
                      IRON              -66.212435
                      JPY               576.688951
                      KOSDAQ            283.629552
                      KR10              120.759307
                      LEANHOG          -264.849740
                      LIVECOW          -410.089921
                      MSCISING          -33.684812
                      MUMMY              57.016951
                      MXP              -207.180845
                      NASDAQ_micro      831.713621
                      NIKKEI           -201.059776
                      NIKKEI400        -151.545055
                      RUSSELL            41.649758
                      SILVER             17.087080
                      SOYBEAN             5.339713
                      SOYOIL          -1391.742669
                      SP500_micro      1146.970247
                      TOPIX             -15.004461
                      US10U            1468.420940
                      US20             -574.019095
                      V2X                75.740885
                      WHEAT           -2803.349068
                      YENEUR          -1200.356869
delay_cash Total Sum
                       delay_cash
strategy_name                  
_ROLL_PSEUDO_STRATEGY   60.973435
dynamic_TF_carry      -283.355111
bid_ask_cash Sum
                                       bid_ask_cash
strategy_name         instrument_code            
_ROLL_PSEUDO_STRATEGY BRE                 -4.271770
                      CRUDE_W_mini       -32.038275
                      DJSTX-SMALL         -4.328051
                      EU-BASIC            -2.164025
                      EU-OIL              -4.328051
                      IRON                -8.543540
                      KR10                -9.289177
                      MXP                 -2.135885
                      SILVER              -0.427177
                      TOPIX               -5.101517
                      V2X                -10.820126
dynamic_TF_carry      AUD                 -2.135885
                      BITCOIN            -14.737607
                      BRE                 -8.543540
                      BUND               -17.312202
                      CORN               -21.358850
                      CRUDE_W_mini       -96.114825
                      DAX                -77.039300
                      DJSTX-SMALL       -201.254352
                      DOW                 -5.126124
                      EU-BASIC          -670.847840
                      EU-OIL            -428.477007
                      EUR                -21.358850
                      EUROSTX             -8.656101
                      FTSETAIWAN          -8.543540
                      GAS_US_mini        -96.114825
                      GBP                -16.019138
                      GBPEUR             -31.250000
                      GOLD_micro         -20.077319
                      IRON              -177.278455
                      JPY                -10.679425
                      KOSDAQ              -8.669899
                      KR10                -9.289177
                      LEANHOG            -17.087080
                      LIVECOW             -8.543540
                      MSCISING            -3.062256
                      MUMMY              -21.006245
                      MXP                -14.951195
                      NASDAQ_micro        -1.708708
                      NIKKEI              -6.001784
                      NIKKEI400          -16.504907
                      RUSSELL             -6.621244
                      SILVER             -42.717700
                      SOYBEAN             -5.339713
                      SOYOIL             -99.959418
                      SP500_micro         -5.339713
                      TOPIX              -13.504015
                      US10U              -13.349281
                      US20               -13.349281
                      V2X                -23.804278
                      WHEAT             -368.440163
                      YENEUR             -22.506691
bid_ask_cash Total Sum
                       bid_ask_cash
strategy_name                    
_ROLL_PSEUDO_STRATEGY    -83.447594
dynamic_TF_carry       -2654.681474
execution_cash Sum
                                       execution_cash
strategy_name         instrument_code              
_ROLL_PSEUDO_STRATEGY BRE                2.593619e-13
                      CRUDE_W_mini      -6.165403e-12
                      DJSTX-SMALL       -4.901203e-13
                      EU-BASIC          -0.000000e+00
                      EU-OIL             2.959942e-12
                      IRON              -2.442448e-13
                      KR10               0.000000e+00
                      MXP                2.130473e-12
                      SILVER             7.054643e-13
                      TOPIX              0.000000e+00
                      V2X               -1.837951e-13
dynamic_TF_carry      AUD               -4.271770e+00
                      BITCOIN            7.689186e+00
                      BRE                0.000000e+00
                      BUND               1.731220e+01
                      CORN               1.067943e+01
                      CRUDE_W_mini      -4.271770e+01
                      DAX                5.193661e+00
                      DJSTX-SMALL        2.596830e+01
                      DOW               -9.825071e+00
                      EU-BASIC           5.713027e+02
                      EU-OIL            -1.731220e+01
                      EUR                2.135885e+01
                      EUROSTX            0.000000e+00
                      FTSETAIWAN        -1.708708e+01
                      GAS_US_mini       -3.203828e+01
                      GBP                2.135885e+01
                      GBPEUR             1.250000e+01
                      GOLD_micro        -5.126124e+00
                      IRON               0.000000e+00
                      JPY               -9.261925e-12
                      KOSDAQ            -4.334949e+00
                      KR10              -1.238557e+01
                      LEANHOG            0.000000e+00
                      LIVECOW            0.000000e+00
                      MSCISING          -3.062256e+00
                      MUMMY              0.000000e+00
                      MXP               -4.271770e+00
                      NASDAQ_micro       1.623273e+01
                      NIKKEI             0.000000e+00
                      NIKKEI400         -6.001784e+00
                      RUSSELL            1.281531e+00
                      SILVER            -2.563062e+01
                      SOYBEAN            1.067943e+01
                      SOYOIL             5.638736e+01
                      SP500_micro       -1.174737e+01
                      TOPIX              4.501338e+00
                      US10U              0.000000e+00
                      US20              -0.000000e+00
                      V2X               -3.073097e-13
                      WHEAT              2.135885e+01
                      YENEUR             7.502230e+00
execution_cash Total Sum
                       execution_cash
strategy_name                      
_ROLL_PSEUDO_STRATEGY   -1.028322e-12
dynamic_TF_carry         6.154941e+02
versus_limit_cash Sum
                                       versus_limit_cash
strategy_name         instrument_code                  
_ROLL_PSEUDO_STRATEGY BRE                   0.000000e+00
                      CRUDE_W_mini          0.000000e+00
                      DJSTX-SMALL          -8.656101e+00
                      EU-BASIC             -4.328051e+00
                      EU-OIL               -8.656101e+00
                      IRON                  0.000000e+00
                      KR10                  0.000000e+00
                      MXP                   0.000000e+00
                      SILVER                0.000000e+00
                      TOPIX                 0.000000e+00
                      V2X                  -2.164025e+01
dynamic_TF_carry      AUD                   0.000000e+00
                      BITCOIN               0.000000e+00
                      BRE                   0.000000e+00
                      BUND                  0.000000e+00
                      CORN                  0.000000e+00
                      CRUDE_W_mini         -5.339713e+01
                      DAX                  -5.713027e+01
                      DJSTX-SMALL           0.000000e+00
                      DOW                  -1.836861e+01
                      EU-BASIC              0.000000e+00
                      EU-OIL               -3.029635e+01
                      EUR                   0.000000e+00
                      EUROSTX              -1.731220e+01
                      FTSETAIWAN            0.000000e+00
                      GAS_US_mini           0.000000e+00
                      GBP                   0.000000e+00
                      GBPEUR               -1.387779e-11
                      GOLD_micro           -6.834832e+00
                      IRON                  0.000000e+00
                      JPY                   0.000000e+00
                      KOSDAQ                0.000000e+00
                      KR10                  0.000000e+00
                      LEANHOG               0.000000e+00
                      LIVECOW               0.000000e+00
                      MSCISING              0.000000e+00
                      MUMMY                 0.000000e+00
                      MXP                   0.000000e+00
                      NASDAQ_micro          0.000000e+00
                      NIKKEI                0.000000e+00
                      NIKKEI400             0.000000e+00
                      RUSSELL              -2.990239e+00
                      SILVER                0.000000e+00
                      SOYBEAN               0.000000e+00
                      SOYOIL                0.000000e+00
                      SP500_micro           0.000000e+00
                      TOPIX                 0.000000e+00
                      US10U                 0.000000e+00
                      US20                  0.000000e+00
                      V2X                  -4.328051e+00
                      WHEAT                 0.000000e+00
                      YENEUR                0.000000e+00
versus_limit_cash Total Sum
                       versus_limit_cash
strategy_name                          
_ROLL_PSEUDO_STRATEGY         -43.280506
dynamic_TF_carry             -190.657682
versus_parent_limit_cash Sum
                                       versus_parent_limit_cash
strategy_name         instrument_code                        
_ROLL_PSEUDO_STRATEGY BRE                                     0
                      CRUDE_W_mini                            0
                      DJSTX-SMALL                             0
                      EU-BASIC                                0
                      EU-OIL                                  0
                      IRON                                    0
                      KR10                                    0
                      MXP                                     0
                      SILVER                                  0
                      TOPIX                                   0
                      V2X                                     0
dynamic_TF_carry      AUD                                     0
                      BITCOIN                                 0
                      BRE                                     0
                      BUND                                    0
                      CORN                                    0
                      CRUDE_W_mini                            0
                      DAX                                     0
                      DJSTX-SMALL                             0
                      DOW                                     0
                      EU-BASIC                                0
                      EU-OIL                                  0
                      EUR                                     0
                      EUROSTX                                 0
                      FTSETAIWAN                              0
                      GAS_US_mini                             0
                      GBP                                     0
                      GBPEUR                                  0
                      GOLD_micro                              0
                      IRON                                    0
                      JPY                                     0
                      KOSDAQ                                  0
                      KR10                                    0
                      LEANHOG                                 0
                      LIVECOW                                 0
                      MSCISING                                0
                      MUMMY                                   0
                      MXP                                     0
                      NASDAQ_micro                            0
                      NIKKEI                                  0
                      NIKKEI400                               0
                      RUSSELL                                 0
                      SILVER                                  0
                      SOYBEAN                                 0
                      SOYOIL                                  0
                      SP500_micro                             0
                      TOPIX                                   0
                      US10U                                   0
                      US20                                    0
                      V2X                                     0
                      WHEAT                                   0
                      YENEUR                                  0
versus_parent_limit_cash Total Sum
                       versus_parent_limit_cash
strategy_name                                
_ROLL_PSEUDO_STRATEGY                         0
dynamic_TF_carry                              0
total_trading_cash Sum
                                       total_trading_cash
strategy_name         instrument_code                  
_ROLL_PSEUDO_STRATEGY BRE                   -4.271770e+00
                      CRUDE_W_mini          -3.203828e+01
                      DJSTX-SMALL           -4.328051e+00
                      EU-BASIC              -2.164025e+00
                      EU-OIL                -4.328051e+00
                      IRON                  -8.543540e+00
                      KR10                   0.000000e+00
                      MXP                   -2.135885e+00
                      SILVER                -4.271770e-01
                      TOPIX                  0.000000e+00
                      V2X                   -1.082013e+01
dynamic_TF_carry      AUD                   -6.407655e+00
                      BITCOIN               -7.048421e+00
                      BRE                   -8.543540e+00
                      BUND                   2.460165e-11
                      CORN                  -1.067943e+01
                      CRUDE_W_mini          -1.388325e+02
                      DAX                   -7.184564e+01
                      DJSTX-SMALL           -1.752860e+02
                      DOW                   -1.495120e+01
                      EU-BASIC              -9.954516e+01
                      EU-OIL                -4.457892e+02
                      EUR                   -2.371348e-11
                      EUROSTX               -8.656101e+00
                      FTSETAIWAN            -2.563062e+01
                      GAS_US_mini           -1.281531e+02
                      GBP                    5.339713e+00
                      GBPEUR                -1.875000e+01
                      GOLD_micro            -2.520344e+01
                      IRON                  -1.772785e+02
                      JPY                   -1.067943e+01
                      KOSDAQ                -1.300485e+01
                      KR10                  -2.167475e+01
                      LEANHOG               -1.708708e+01
                      LIVECOW               -8.543540e+00
                      MSCISING              -6.124511e+00
                      MUMMY                 -2.100625e+01
                      MXP                   -1.922297e+01
                      NASDAQ_micro           1.452402e+01
                      NIKKEI                -6.001784e+00
                      NIKKEI400             -2.250669e+01
                      RUSSELL               -5.339713e+00
                      SILVER                -6.834832e+01
                      SOYBEAN                5.339713e+00
                      SOYOIL                -4.357205e+01
                      SP500_micro           -1.708708e+01
                      TOPIX                 -9.002677e+00
                      US10U                 -1.334928e+01
                      US20                  -1.334928e+01
                      V2X                   -2.380428e+01
                      WHEAT                 -3.470813e+02
                      YENEUR                -1.500446e+01
total_trading_cash Total Sum
                       total_trading_cash
strategy_name                          
_ROLL_PSEUDO_STRATEGY          -69.056900
dynamic_TF_carry             -2039.187394

So in ~5.5 months my execution algo 'earned' £600 versus I would have paid £2700 in bid-ask spread costs for a net cost of £2100; so it's reducing my slippage to more like 78% of what you'd expect. I also paid £350 in commissions.

Those results are however heavily affected by a few trades on which the slippage was quite large as the plot makes clear. It certainly doesn't look like the algo is adding much value, but I don't think it's losing any money eithier.

While I'm here, a useful sense check is to annualise the above figures and divide by maximum capital to get a percentage (400k). I get 1.1% in annual slippage (net of execution algo) plus 0.2% in commissions for a net of 1.3%. That's much lower than the 3% from last year, and only a tad above the 1% in my backtest.

Rob
So you are seeing slippage results quite similar to mine.
Thanks for the information.
 
Was just reading Kernfusions post from early August and thinking about trading without market data. I'm not sure how this wasn't brought up more (though I did see a mention in early 2020), but we can use snapshot request to get the real-time quote, which as far as I understand is all that's needed for Rob's algo. It's $0.03 per request.
If your exec algo does a lot of requests to get the quote, this might add up. Mine does one request only, and I have to pay professional fees, so this pays off big time.
Keep in mind this is not available for some exchanges, details here https://ibkr.info/article/2830. I guess if an exchange is not listed, snapshot requests are not available, so no ICE stuff, but CBOT/CME/COMEX/NYMEX work.

So if we combine that with the fact that we can get data history without the market data subscription if we use
Code:
ib.reqMarketDataType(3)
, this can be a viable way to trade without market data.
 
Does anyone else have problems with Lumber mini contract? I entered buy order for LBR Nov 2022, but I got this warning: "YOUR ORDER IS NOT ACCEPTED. This product is not available for trading."

However, if I enter buy order for old (soon to be replaced) Random Length Lumber LB Nov 2022, everything works fine without any warning.
 
Does anyone else have problems with Lumber mini contract? I entered buy order for LBR Nov 2022, but I got this warning: "YOUR ORDER IS NOT ACCEPTED. This product is not available for trading."

However, if I enter buy order for old (soon to be replaced) Random Length Lumber LB Nov 2022, everything works fine without any warning.

You sure it's LBRX, not LBRU? If that's all clear, then maybe your broker has not yet coded LBR into their system yet? Give 'em a call.
 
Hey everyone (especially Rob),

I've been thinking about including both the full-sized and the mini/micro contracts (e.g., ES/MES, MCL/CL, QG/NG, etc.) in my system and letting the tracking error minimization system (what Rob calls Dynamic Optimization) decide which to trade based on granularity and costs. The biggest issue I can think of is having two instruments in my correlation matrix with 100% correlations, which could mess things up, especially if you do any Fisher Transformations, which I do.

Any thoughts? A great idea? Or really stupid?

Thanks.
 
and, today seems the day for questions: Re Dynamic Optimisation:

I am trying to work out why GOLD_micro isn't represented in the optimised portfolio. It has one of the largest combined forecasts at -14.55, and its notional position size of -2.411 is larger than almost anything else.

I thought maybe costs, but it's cost is relatively low, ranking 160 out of 175 on the sorted SR costs list.

Not urgent, but a response might help my understanding (or mis-understanding) of DO.

Thanks
KH
 
and, today seems the day for questions: Re Dynamic Optimisation:

I am trying to work out why GOLD_micro isn't represented in the optimised portfolio. It has one of the largest combined forecasts at -14.55, and its notional position size of -2.411 is larger than almost anything else.

I thought maybe costs, but it's cost is relatively low, ranking 160 out of 175 on the sorted SR costs list.

Not urgent, but a response might help my understanding (or mis-understanding) of DO.

Thanks
KH
My MGC position is -1 at the moment (unrounded is -1.17), and I can see it was -4 on Sept 11., my current combined forecast is -16.7. Here's the position and forecast plots (the red line is combined forecast), but who knows, maybe your instrument composition makes things different somehow..
upload_2022-9-15_20-11-59.png
 
and, today seems the day for questions: Re Dynamic Optimisation:

I am trying to work out why GOLD_micro isn't represented in the optimised portfolio. It has one of the largest combined forecasts at -14.55, and its notional position size of -2.411 is larger than almost anything else.

I thought maybe costs, but it's cost is relatively low, ranking 160 out of 175 on the sorted SR costs list.

Not urgent, but a response might help my understanding (or mis-understanding) of DO.

Thanks
KH
I believe Rob currently has a position in Silver. Since that is highly correlated to Gold, it probably covers both positions. (I hope Rob will correct me if I'm wrong.)
 
maybe your instrument composition makes things different somehow..

Thanks for your response. The figures I quoted re Gold are from Rob's GitHub reports. I don't run DO mainly because I don't understand it, Carry is in the same boat.

I do have a gold position, it is my largest position calculated using Ch 15 calcs. I was just wondering why Gold, given how strong the signals are, isn't in Rob's optimised portfolio.

It was pointed out to me that the omission of Gold may be because of correlation to the current Silver position, but, even so, Gold has a much stronger signal than Silver and so should (in my mind) have a higher preference in the optimised portfolio.

KH
 
It was pointed out to me that the omission of Gold may be because of correlation to the current Silver position, but, even so, Gold has a much stronger signal than Silver and so should (in my mind) have a higher preference in the optimised portfolio.

KH
Gold has a stronger signal now than Silver, but what were the signals when Rob opened up the Silver position? It's also possible that Silver is more highly correlated to other instruments (like Copper) and that too is influencing the position.
 
Back
Top