Fully automated futures trading

If you trade on margin (which will most likely be the case for small accounts), i think you'll pay borrowing costs whether you're long or short.
For equity/stocks: in case you go short you always pay borrowing cost (to the one whom you are borrowing the stock from). In case you go long you only borrow money in case you buy more stock than you have cash in your account. If you don't exceed your account value you are not borrowing money from the broker and thus are you not paying any costs.
 
Hi all,

I have something I would like to hear your opinion on - rolling using spread orders. Do you think using spread orders is benefitial for amatures (like me)?

This morning I did roll some of my contracts using spread orders, hoping that I can save some amount of spread cost. However I sensed that I can easily lose more money than I can save, because who I am making deal with is most likely pros. Order price amatures set is tend to be quite arbitrary (might not be a right word here) and the order is filled only when the pros judged it is benefitial for them, no?

I saw similar discussion in the past in this thread, and had the impression that some prefers normal orders (sell and buy separately) than spread orders, but have not yet found a method that suits me well.

Sorry this is more related to futures trading 101 rather than automated futures trading. I have been looking for resources to learn such basics, but have not been successful so far.
 
I have something I would like to hear your opinion on - rolling using spread orders.

I've also been thinking about this.

I've always used outright orders to roll. I looked at spread orders once a few years ago, and in many cases it seemed more expensive than 2 outright orders.

I know Rob prefers spread orders, at least for some contracts. I would be interested in discussion of how to determine when to roll with spread orders vs outright.
 
I wonder if you've done a study on the marginal increase in sharpe you gain by adding another market. I suppose the increase won't be the same if you already trade 40 markets as opposed to 3 markets.
https://qoppac.blogspot.com/2016/03/diversification-and-small-account-size.html

Hi all,

I have something I would like to hear your opinion on - rolling using spread orders. Do you think using spread orders is benefitial for amatures (like me)?
it's been discussed.. My opinion is that if you're executing manually, then you can probably do that, but automating it might be more difficult and the benefit from it doesn't justify the extra coding effort, at least for small and slow systems (I don't do that, my execution layer treats all orders the same).
 
Last edited:
I've always used outright orders to roll. I looked at spread orders once a few years ago, and in many cases it seemed more expensive than 2 outright orders.
it's been discussed.. My opinion is that if you're executing manually, then you can probably do that, but automating it might be more difficult and the benefit from it doesn't justify the extra coding effort, at least for small and slow systems (I don't do that, my execution layer treats all orders the same).

Thanks tgibson11 and Kernfusion. I am inclined to go use outright orders (I learned a new terminology thank you) until I get a certain level of knowledge and experience.
 
My opinion is that if you're executing manually, then you can probably do that, but automating it might be more difficult and the benefit from it doesn't justify the extra coding effort, at least for small and slow systems (I don't do that, my execution layer treats all orders the same).
I agree with this and thus roll using outright orders. The contracts I use are liquid and the close and open orders are literally only seconds apart so I don't think that there will be a lot of price drift (to my disadvantage) when rolling this way.
 
I've also been thinking about this.

I've always used outright orders to roll. I looked at spread orders once a few years ago, and in many cases it seemed more expensive than 2 outright orders.

I know Rob prefers spread orders, at least for some contracts. I would be interested in discussion of how to determine when to roll with spread orders vs outright.

There are some contracts where using spreads is a massive advantage. An example would be Eurodollar, where the spread market is actually more liquid than the outright. And there are others where it makes no difference or is impossible. If you're going to get filled passively (eg buying at the bid), then two seperate orders will make you higher profits than a spread. If you're definitely going to have the cross the execution spread (eg selling at the bid), then two seperate orders will cost you more (so in Eurodollar, it's quite rare that I am filled passively so spreads are usually cheaper). The market risk of two seperate orders is probably a smaller concern, especially if you do the orders one contract at a time.

In the first iteration of my trading system (2014-2020) I used spreads and in a rather hacky way (the whole system was hacky, if I'm being honest!). In pysystemtrade (used for live trading since last year) there is a very nice system of multiple order stacks which handles spreads rather elegantly. But yes, it is much more complicated than if I just used outright orders. However an upside of this is that I can start trading spreads (and flys) as a market, without having to fiddle around with my trading infrastructure.

GAT
 
Well it's been a while since I've given you an update on what I'm up to.

I won't discuss performance in too much detail, as I'll probably try and give you a few figures at the end of the year (plus my normal massive blogpost for the UK tax year ending in April). Fundseeder, which wasn't working for a while but is now, says I'm up 5.2% for the year. For the last couple of months I'm down slightly, and my drawdown remains at ~15%. For the UK tax year I reckon I'm at about -5%.

And yes I did lose a bit in November when the good news came out, but against that my long only portfolio went absolutely gangbusters.

That's because I've gradually been rerisking it back into equities since mid March (I'm down to 10% risk allocation in bonds from a high of 54% on the 20th March, and I've reduced my cash to a minimum), buying cheap UK equities, and higher yielding ETFs, plus it's always had a bit of a value tilt (you can get the current target risk allocations here).

So not a huge surprise that my long only stuff did well last month. Since the start of the tax year I probably made something like 20% on my long only stuff even after , and the futures trading knocked about 1% off that. Net-net, that's pretty good. Compare and contrast to 2019-20 where long only was down 15% and futures trading improved it to -6.6%.

Risk is pretty low, hovering between 9% and 12% annualised. So there's no strong conviction for my positions.

Code:
********************************************************************************
               Risk report produced on 2020-12-03 23:36:29.996169              
********************************************************************************


Total risk across all strategies, annualised percentage 11.8

========================================
Risk per strategy, annualised percentage
========================================

                               risk
_ROLL_PSEUDO_STRATEGY  0.000000e+00
medium_speed_TF_carry  1.200000e+01
ETFHedge               1.555608e+11


============================================================================================================================================================================================================================================================
                                                                                                                      Instrument risk                                                                                                                      
============================================================================================================================================================================================================================================================

         daily_price_stdev  annual_price_stdev   price  daily_perc_stdev  annual_perc_stdev  point_size_base  contract_exposure  daily_risk_per_contract  annual_risk_per_contract  position   capital  exposure_held_perc_capital  annual_risk_perc_capital
EUROSTX               53.8               861.4  3486.0               1.5               24.7              9.0            31476.0                    486.1                    7778.0      -2.0  345002.7                       -18.2                      -4.5
GAS_US                 0.1                 1.6     2.5               4.0               64.3           7436.4            18695.0                    751.5                   12024.0      -1.0  345002.7                        -5.4                      -3.5
V2X                    0.8                12.3    21.6               3.5               56.8             90.3             1954.8                     69.4                    1110.3      -5.0  345002.7                        -2.8                      -1.6
BOBL                   0.1                 2.2   135.3               0.1                1.6            902.9           122129.7                    122.4                    1958.1       1.0  345002.7                        35.4                       0.6
WHEAT                  6.7               107.0   599.2               1.1               17.9             37.2            22281.2                    248.6                    3977.7       1.0  345002.7                         6.5                       1.2
US10                   0.3                 5.4   137.7               0.2                3.9            743.6           102424.2                    249.4                    3989.8       1.0  345002.7                        29.7                       1.2
AUD                    0.0                 0.1     0.7               0.6                9.3          74363.5            54657.2                    319.0                    5103.7       1.0  345002.7                        15.8                       1.5
KR3                    0.1                 0.9   111.6               0.1                0.8            680.8            75956.7                     39.3                     628.2       9.0  345002.7                       198.1                       1.6
EDOLLAR                0.0                 0.4    99.5               0.0                0.4           1859.1           185016.5                     46.2                     739.8       8.0  345002.7                       429.0                       1.7
MXP                    0.0                 0.0     0.0               0.7               11.2         371817.7            18386.4                    128.3                    2053.3       3.0  345002.7                        16.0                       1.8
JPY                    0.0                 0.0     0.0               0.5                8.2        9295442.6            89087.5                    457.4                    7319.2       1.0  345002.7                        25.8                       2.1
OAT                    0.4                 6.0   167.4               0.2                3.6            902.9           151194.9                    339.1                    5425.2       2.0  345002.7                        87.6                       3.1
PLAT                  18.7               299.9  1039.1               1.8               28.9             37.2            38635.6                    696.8                   11149.2       1.0  345002.7                        11.2                       3.2
SOYBEAN                7.0               112.1  1039.2               0.7               10.8             37.2            38641.2                    260.4                    4166.6       4.0  345002.7                        44.8                       4.8


=======================================================================================================
                                             Correlations                                            
=======================================================================================================

          KR3  US10   JPY  SOYBEAN   AUD  PLAT  EUROSTX   OAT  GAS_US  BOBL  WHEAT   MXP  EDOLLAR   V2X
KR3      1.00  0.10  0.03    -0.05 -0.20 -0.05    -0.07  0.15   -0.01  0.08  -0.17 -0.17     0.07  0.10
US10     0.10  1.00  0.33    -0.12 -0.18 -0.13    -0.44  0.50   -0.11  0.57  -0.20 -0.35     0.92  0.31
JPY      0.03  0.33  1.00     0.13  0.31  0.27    -0.21  0.24   -0.07  0.22   0.04  0.14     0.29  0.05
SOYBEAN -0.05 -0.12  0.13     1.00  0.35  0.20     0.23 -0.07   -0.06 -0.17   0.35  0.31    -0.10 -0.22
AUD     -0.20 -0.18  0.31     0.35  1.00  0.53     0.49 -0.14   -0.19 -0.19   0.24  0.63    -0.18 -0.58
PLAT    -0.05 -0.13  0.27     0.20  0.53  1.00     0.23 -0.11   -0.11 -0.17   0.15  0.28    -0.10 -0.32
EUROSTX -0.07 -0.44 -0.21     0.23  0.49  0.23     1.00 -0.16   -0.11 -0.33   0.15  0.51    -0.44 -0.71
OAT      0.15  0.50  0.24    -0.07 -0.14 -0.11    -0.16  1.00   -0.11  0.90  -0.27 -0.16     0.45  0.12
GAS_US  -0.01 -0.11 -0.07    -0.06 -0.19 -0.11    -0.11 -0.11    1.00 -0.11  -0.03 -0.17    -0.03  0.07
BOBL     0.08  0.57  0.22    -0.17 -0.19 -0.17    -0.33  0.90   -0.11  1.00  -0.23 -0.22     0.52  0.23
WHEAT   -0.17 -0.20  0.04     0.35  0.24  0.15     0.15 -0.27   -0.03 -0.23   1.00  0.26    -0.21 -0.15
MXP     -0.17 -0.35  0.14     0.31  0.63  0.28     0.51 -0.16   -0.17 -0.22   0.26  1.00    -0.38 -0.54
EDOLLAR  0.07  0.92  0.29    -0.10 -0.18 -0.10    -0.44  0.45   -0.03  0.52  -0.21 -0.38     1.00  0.32
V2X      0.10  0.31  0.05    -0.22 -0.58 -0.32    -0.71  0.12    0.07  0.23  -0.15 -0.54     0.32  1.00


********************************************************************************
                               END OF RISK REPORT                              
********************************************************************************

In terms of what I'm actually doing with my life, I've had quite a few webcasts (which mostly replaced planned physical conferences). One of these was interesting, as I had to create my system in a weird GUI environment which then got parsed into MT4. So if you're wondering if it's possible to run a continous futures trading system in MT4, it is.

Much to my surprise (as university funding isn't in great shape), I've been asked to teach again next year, so there is some prep to do. There will be a lot of remote students so I have to try and make things a bit more interesting. Perhaps a live video of me backtesting a trading strategy? Or should I go down the youtube guru trader route and post videos of me driving my car:

https://vcarsdna.com/images/vehicles/76/large/85c897154bfad55ab6ca78a3b5dc212d.jpg
85c897154bfad55ab6ca78a3b5dc212d.jpg


(This isn't my car, but it's the same age, model and colour. Actually, it's in better condition than my car and definitely cleaner. My wife has a nicer car. But it's not that nice).

Mostly though I've been writing code. I basically finished 'stage 4' of working on psystemtrade. Now I'm doing quite a lot of refactoring, and documentation writing

(Don't worry, I'm not turning into a proper programmer. I still have no tests)

I also have a list of relatively small bits of functionality I want to add. After that, and hopefully not too far into next year I will start some very serious pieces of research into new trading systems. I'm limiting myself to futures, but there is still quite a lot of space I can fill with just futures ideas. I've talked a bit about them before but here's a list of the main ones:

  • Optimise positions for limited capital
  • Short term mean reversion strategy, possible with a daily trend following overlay
  • Intramarket spreads: probably on VIX or V2X, Eurodollar, Crude, maybe some Ags
  • Intermarket spreads: eg across 10 year bond futures, V2X vs VIX
  • Cross sectional momentum
A challenge I'm still working on is how to trade a particular instrument as both an intramarket spread and an outright position (which will also cover intermarket spreads). The issue is my roll logic, and there are no easy solutions. I think the simplest is to partition the curve and say that these contracts are for spreads, whilst these are for outrights.

Refactoring in itself doesn't make money (as any CTO will tell you), but will create a system that is flexible enough to trade all of these ideas. My hope is that these newer systems will improve the consistency of my trading profits a little, and make more efficient use of the cash in my trading account.

Those improved profits will be nice, because the global cut in dividends has obviously hurt my cash (rather than mark to market) income, and it may take a few years to rebound.

For this year at least I did have a large cash pile from futures trading profits last year which I knew I would probably need as a buffer to avoid having to sell equities at depressed prices. I've also made more money from other stuff and book royalties than in previous years. In fact in 2020 for the first time I have made enough money in royalties that it qualifies as a proper job, albeit not a super high paid one. But given I haven't written any books this year, my hourly rate is effectively infinity. So that's pretty good.

I also plan next year to start thinking about my next book. I have a random list of ideas, which change in order of preference and content over time. I'd be curious to know which of these you guys think will sell a million copies and make me enough money to buy a youtube guru style car. Failing that, which you would like to read yourself:

- a sort of Talebian style treatsie on uncertainty in financial markets, but with more formulas and practical advice
- a book on ETF investing, factor investing for dummies. You know how my 3rd book is a simpler version of my 1st book? This would be a simpler version of my 2nd book, 'Smart Portfolios'. Love the symettery.
- a book on quantitative futures trading. Think Schwager with more equations, and a bit of 'the global futures almanac' thrown in.
- a book on writing and backtesting trading strategies in python. The differentation here is it won't use a predefined package, like Andreas' book uses zipline. Just pandas and the normal numpy/scipy stack. With a heavy focus on uncertainty and doing things properly.
- a textbook for my university course
- a sort of popular book on human and computer trading, and doing both

Hope the rest of the year goes okay. All other things considered, 2020 is starting to improve I feel.

GAT

I'd like to read a book on ETF investing, factor investing for dummies. I'm a dummy.
 
New identical trading server and backup/development machines now in situ (the mintbox on the top shelf is my old machine, now used for monitoring purposes)
The white cube in the muddle is a UPS ?
I'm using APC SMX3000LV with external battery packs, again, a total overkill, just how I like it :) But that setup has a second function to power up the house in case of power outages..
I've been eyeing the new APC lithium-ion units for about a year now, batteries in them last much longer (forever?), regular acid ones need to be replaced every 5 years, but lithium-ion is still too expensive..
 
Back
Top