Fully automated futures trading

Discussion in 'Journals' started by globalarbtrader, Feb 11, 2015.

  1. 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.

    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.
     
    #3611     Dec 23, 2022
    Kernfusion likes this.
  2. 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
     
    #3612     Dec 23, 2022
  3. 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
     
    #3613     Dec 23, 2022
    Kernfusion likes this.
  4. newbunch

    newbunch

    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.
     
    #3614     Dec 29, 2022
    wopr, Kernfusion and KevinBB like this.
  5. 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
     
    #3615     Dec 29, 2022
  6. 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.
     
    #3616     Dec 30, 2022
  7. 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?
     
    #3617     Dec 30, 2022
  8. Elder

    Elder

    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.
     
    #3618     Dec 30, 2022
    HobbyTrading likes this.
  9. 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.
     
    #3619     Dec 30, 2022
  10. Elder

    Elder

    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.
     
    #3620     Dec 30, 2022
    HobbyTrading likes this.