Fully automated futures trading

You are welcome about that time notation. By the way, do you now also have to modify your code to use the Decimal class which IB uses for all prices? Others have complained that they needed to review their entire code base for this.

The second issue is harder: during the day I reconnect to the same instance of the gateway multiple times (to refresh historical prices, for the actual trading, etc.), and before it was fine, but from a recent version update the subsequent reconnects to the same instance can't initiate streaming of real-time prices, for some FX instruments usually the first one I'm requesting (I use them to get accurate FX-rates) i.e. I call reqMktData, no errors, but the bid\ask\last\lastClose just don't start coming.
I am not familiar with the latest Gateway&API releases. However, I do remember from a previous version that timing between a disconnect and successive reconnect is important. Suppose you ran m_client.eConnect("127.0.0.1", 7497, 2), followed by the actions you want to do. Then, once your activities are completed, you run m_client.eDisconnect(). After this you have to wait a couple of minutes before you can run m_client.eConnect("127.0.0.1", 7497, 2) again. IB informed me that their servers need time to reset everything to a blank slate. When learning this I changed my approach and use a unique number each time I connect : m_client.eConnect("127.0.0.1", 7497, hhmmss), with hhmmss being the current time. This solved all communication issues for me.
 
About macro trends, I incorporate them as a signal in my trading strategy. I think the signals are intuitive, make economic sense, out of sample performance is quite good (see QGMIX good track record despite fees eating almost 0.20 of Sharpe ratio) and long term correlation with TF is high but not extreme. Also, signals are probably as slow as trend ones, even it depends on the actual implementation.
The downside is that the process is quite cumbersome as you need to scrape data from the web to generate signals.
Why don't you plan to trade them explicitly?

My first job in hedge funds was actually to build a systematic global macro trading strategy; the downside is indeed the data: low frequency, hard to get, subject to revisions, often has different meanings across countries. All to end up with something that was pretty correlated to trend and carry, at least when I did it. So not an experience I wish to repeat.

My take on macro trends will be a bit different. Basically the idea is to decompose my massive asset universe into a smaller number of latent factors, then eithier trend follow those or mean revert them which will provide a hedge effectively against the undiversifiable component of trend following individual instruments. A bit more of a quant spin on my asset class trend model.

Rob
 
I've already spent several evenings moving to the new gateway version (10.19i or whatever) (and the API, as the helper classes also change with each new version and I neglected to update them for a number of years)., Because I just know that sooner or later I'll also get such an email and will be forced to migrate from my old AND PERFECTLY WORKING setup..

Have to say I'm glad I switched to using ib_insync which manages all these issues for me, and makes it easier to update the gateway. And we all know that regular upgrade cycles are less painful in the long run. But then I don't always practice what I preach - I'm supposed to 'regularly' switchover my production boxes but its been quite a few months since my current server has been switched off....

Rob
 
Thanks I'd forgotten about that paper.

Rob
FYI, I just added an 'informed trading" system/filter (using faster signals and ignores trading costs) to my system based on the idea in this AQR paper, but since I'm running something similar to DO (what I call Tracking Error Minimization [TEM]) I created a separate TEM for the informed trading system and use that as a kind of filter on my main system (which includes trading costs).
I hope that kind of makes some sense. It was actually very easy to implement and took no time at all, but only after spending a couple of week thinking about how to get it down.
 
Hi,

i'm using IBKR API to send bracket order with BUY LMT, SELL LMT and SELL STP
When i run the code it returns :
ERROR -1 2104 Market data farm connection is OK:uscrypto
ERROR -1 2104 Market data farm connection is OK:usfarm.nj
ERROR -1 2104 Market data farm connection is OK:usfuture
ERROR -1 2104 Market data farm connection is OK:cashfarm
ERROR -1 2104 Market data farm connection is OK:usopt
ERROR -1 2104 Market data farm connection is OK:usfarm
ERROR -1 2106 HMDS data farm connection is OK:cashhmds
ERROR -1 2106 HMDS data farm connection is OK:ushmds
ERROR -1 2158 Sec-def data farm connection is OK:secdefil
ERROR 1 10268 The 'EtradeOnly' order attribute is not supported.
ERROR 2 10268 The 'EtradeOnly' order attribute is not supported.
ERROR 3 10268 The 'EtradeOnly' order attribute is not supported.

Why is it returning all these error messages?
Thank you
 
The first couple of lines are notifications, to indicate that the connection to the various servers is OK. Notifications have an indicator-1.
You have one error, with code number 10268. Check the API documentation for the details of this error.
 
Anyone else ever seen one of these? I am pretty sure that a couple of cotton contracts (largest nr of contracts I hold in a deliverable commodity) doesn't constitute a large reportable position but I received this notice today.

"Dear Sir/Madam:

The Commodity Futures Trading Commission (the “CFTC” or “Commission”) operates a large trader reporting program to collect certain information on market participants, and uses that information in connection with a number of mission-critical objectives that help ensure the integrity of the futures markets.

As part of the large trader reporting program, the Commission routinely collects certain identifying information, on CFTC Form 40, Statement of Reporting Trader (“CFTC Form 40”), from any trader that holds or controls a reportable futures or options position (“reportable position”), as established by Commission regulations 15.01 and 15.03.

The Commission has received information from your carrying broker that indicates that you hold or control a reportable position."
Today I seem to be the chosen one: I received an email from the CFTC instructing me to fill out a Form 40. The email text is different, but the requirement is the same.
I recently started trading the micro bitcoin future. Guess that my position size has triggered this?
What happened after you filled out the form? Were you asked to submit updates?
 
Today I seem to be the chosen one: I received an email from the CFTC instructing me to fill out a Form 40. The email text is different, but the requirement is the same.
I recently started trading the micro bitcoin future. Guess that my position size has triggered this?
What happened after you filled out the form? Were you asked to submit updates?
No updates were required. I assume this is the prelim stage for the cftc to keep a record of any “large trader” in case one of them breaches the commodity limits so they can take swift action if required. That’s my assumption anyway.
 
No updates were required. I assume this is the prelim stage for the cftc to keep a record of any “large trader” in case one of them breaches the commodity limits so they can take swift action if required. That’s my assumption anyway.
I have not checked the actual online form. Was it easy to fill out? I wonder whether there is a place where I can indicate that I’m a retail trader, trading my own funds only. To make it clear that I’m not a professional trader, or working for a trading company.
 
I have not checked the actual online form. Was it easy to fill out? I wonder whether there is a place where I can indicate that I’m a retail trader, trading my own funds only. To make it clear that I’m not a professional trader, or working for a trading company.
Quite easy. I wrote to Michael Zieff explaining the same thing. He was helpful. But I don’t believe they care. The criteria for reporting is size regardless of whether you are classified as retail or professional.
 
Back
Top