Fully automated futures trading

Not old enough to be a boomer. I'm gen-X, as I have frequently had to tell my (Gen Z) children.

GAT
Quite. Sorry wasn’t suggesting you were that old for a moment :). I have heard a derogatory meme being spread that anyone who gets into Bitcoin is now apparently a boomcoiner. Let’s see if it catches!
 
No. The 10% method is a simplification. I've had enough complaints about the book being too complicated without making it worse. But it makes no theoretical sense to have a different sized buffer if you have a max posiion on, or a zero position.

GAT

I understand. For me the book was very clear and understandable, I would not mind if it was significantly more complicated than it was (I guess I'm in the minority). Just asking if you're using +/-10% range of forecast at 10 or some other percentage. I'm using 10% (of "forecast at 10") and so far it looks quite effective at reducing trading frequency.
 
I understand. For me the book was very clear and understandable, I would not mind if it was significantly more complicated than it was (I guess I'm in the minority). Just asking if you're using +/-10% range of forecast at 10 or some other percentage. I'm using 10% (of "forecast at 10") and so far it looks quite effective at reducing trading frequency.

https://github.com/robcarver17/pysystemtrade/blob/master/sysdata/config/defaults.yaml
Code:
Line 233 (I know! You got to line 230 and stopped reading)

# buffering / position inertia
buffer_method: position
buffer_size: 0.10  ###<----- yes it's 10%!

GAT
 
Feels like it's time for a progress report, as it's my birthday and I'm feeling introspective.

Performance has been good; a quick check on the tape reveals my drawdown is down to less than 4% and I'm up more than 10% for the tax year (perhaps 8% for the calendar year because the first two months were down).

pysystemtrade is in a pretty stable condition, with both the production and sim code pretty decently refactored to the point where I'm confident I can keep it well maintained. Today I decided to release 'version 1.0'; about 5.5 years after it's first release - incredible how time flies!

Right now I'm working on adding lots of markets, as per the recent blog post. This is pretty tedious stuff which involves backfilling data from barchart, running a load of scripts, etc etc etc. I have another 75 (!) markets to do in the current batch (markets I can get data for, and which pass my trading filters). Then there another 100 or so markets for the next batch (markets I can get data for, but which don't currently pass my trading filters).

The main constraint is the 100 tickers a day I can download from barchart (eg two instruments with 12 years of quarterly rolls), and the fact I'd kill myself if I spent more than a couple of hours on this a day. I'm probably going to take at least 2 months to get through the curent batch, and another 3 months for the next batch (it could be quicker, as Barchart doesn't always have more than a few years of data, and it's possible there are markets that aren't on barchart at all). I could speed things up by looking at buying the data elsewhere, but the manual process means I actually check everything quite carefully.

The other thing I'm doing, also flagged up in the post, is to substitute several of my existing markets for the relevant micro or mini contract. This is slightly easier, but you just need to be a bit careful. First, I make sure I close my positions in the relevant contracts by setting my trade control to 'reduce only'. I now have to wait for all the positions to be closed. If it gets close to a roll, and they aren't closed, I'll have to close them manually.

Then once I have no active positions in the relevant instrument, I change the IB and instrument configuration so that it is using the new ticker and multiplier. I then get the prices to pull in manually and make sure there is no jump. This is also a good time to do a futures roll if one is due. Finally I turn off the 'reduce only' flag and check that the new positions are opened up okay. Obviously this means historic positions can't be compared, but that doesn't bother me.

Running alongside that I need to do some profiling and optimisation work (just got a copy of https://www.oreilly.com/library/view/high-performance-python/9781492055013/). With around 230 instruments pysystemtrade will be very slow indeed even on my 32GB/i7 trading servers, if it runs at all! Even so, I'd probably never run a fully blown backtest (up to 35 years of daily data plus 7 years of hourly data, 230 instruments, rolling optimisations...). Instead, I'll do things like run single instrument systems with one period optimisation to get the forecast weights and FDM; then with those fixed do a single period optimisation to get the instrument weights and IDM. In production I'll only pull in say the last two years of data for the nightly backtest.

Once I've sped things up a bit, but not neccessarily before I've finished eithier batch one or batch of adding new instruments, I'm going to look into my idea of modifying the system to make better use of limited capital. At the moment I have the very hacky solution I wrote about here. I probably get asked about this more than anything, and I'm as excited as anyone to see if my idea works, but the profiling has to come first!

Other projects to follow that are, in no particular order:

- I have a bunch of other changes and potential trading signals I want to look at putting into the core model. A lot of this is stuff I've blogged about over the last couple of years but not implemented.
- Some completely new systems: fast mean reversion, intermarket RV eg spreads, intramarket RV spreads (calendar spreads).
- The next book... :-)

GAT
 
Back
Top