Fully automated futures trading

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

  1. Nice. As is CL.
     
    #2621     Feb 24, 2021
  2. Kernfusion

    Kernfusion

    Ouch :)
    upload_2021-2-26_18-56-48.png

    This week was a wild ride! first the system made a lot in a couple of days and then it lost it all even faster, ending up pretty-much where it started :)
    Btw, my risk overlay has been active since Feb 11 at about 1.2 level (i.e. my overall positions have been reduced by ~1.15-1.2)
     
    #2622     Feb 26, 2021
  3. wopr

    wopr

    Rob, do you know if there is a video of your presentation from Wednesday on Risk targeting?
     
    #2623     Mar 5, 2021
  4. It was recorded but not by me. Probably best to contact the organisers

    GAT
     
    #2624     Mar 5, 2021
    wopr likes this.
  5. spawnxxx

    spawnxxx

    Here it is: https://thalesians.com/videos/
     
    #2625     Mar 8, 2021
    wopr likes this.
  6. Kernfusion

    Kernfusion

    Was checking out the current situation with crypto-mining, so basically a graphics card like nVidia 3070 RTX which does about 54.76 Mega Hashes per sec, consumes ~250w of power and costs ~1.2k (+ maybe 400$ for the rest of the computer) can currently generate 152$ per month mining Ethereum.
    upload_2021-3-13_23-54-9.png

    The problem of course is that the mining difficulty also tends to increase over time:
    upload_2021-3-13_23-55-44.png
    so it might turn out that just when this hardware has paid for itself, it'll need a full upgrade..

    So I think a futures-trading computer is still a better proposition :)
     
    #2626     Mar 14, 2021
    meatyoaker likes this.
  7. #2627     Mar 14, 2021
    Kernfusion likes this.
  8. wopr

    wopr

    Hey folks, an update from me.
    Nothing exciting really, sitting in a 10% drawdown.
    upload_2021-3-25_10-18-0.png

    I've been trying to get accurate trade confirmations from IB, and unless your orders are filled synchronously (eg. you send an order and your system waits for it to get filled and updates your database) seems like this is not easy to get.
    I'll document some of the issues here in case other find it useful.

    I'm using somewhat standard setup, IB Gateway with IBC.
    As we know, IB Gateway can only return trades from today (I don't know exactly when do they make the cutoff). I then went with Flex Reports as that's the solution mentioned quite a bit, but that has its own problems.
    If you use Activity flex reports, you can specify a custom date range (eg. trades from the last week), but the trades can be delayed quite a bit - currently, in my Flex report I can't see any trades from last 48 hours.
    If you use Trade Confirmation Flex Query, that is hardcoded to only trades for today, and you can't change that, even though the documentation helpfully suggests you can. I've spent an hour chatting with customer support to see if there's a way to do this, and there's not.
    Also, what's not helpful with Flex reports is that from what I see they don't retain the Order Ref - I've double checked that I'm setting it on the orders and I can see it in the TWS.

    Customer support rep suggested that I use REST API, but that's another gateway to host and run and I don't want to do that. So that leaves us with the problem, unless you use TWS as your "gateway" which can return last 7 days of trades (I can't find info on why Gateway can do only today), you're stuck.

    My current solution will likely be to write a wrapper service around IB Gateway that will be always up and do all the housekeeping, which does seem like a lot of work for something as simple as "get me the trades for last 7 days".

    How do you folks do this, and do you have a need to fetch trades from last X days at all?
     
    #2628     Mar 25, 2021
  9. Kernfusion

    Kernfusion

    Hey wopr,
    I'm doing I guess what you described first., as I took the route of implementing event-based system from the beginning, I listen to every IB order update, as well as commission updates (actually I think there's 2-3 different callbacks that the IB sample code gives, and I'm subscribing to all of them in real-time), and I record every change to my DB connecting these pieces of information by IB Order ID, marking the last order state-update as latest.
    So in the orders table I have full history of every order how it evolved, which is collected in real-time (useful for troubleshooting), but when I actually use that data for my reports I only use latest record for every distinct order. in the db it looks like this:

    upload_2021-3-25_18-49-32.png

    And this has to work correctly, because my system always compares the position it thinks it has (based on this table) with what the broker thinks my position is, and if they don't match, the trading in this instrument is halted and I have to go and manually resolve this (which does happen maybe once every 3 months or so..).

    Otherwise, the situation is pretty-much the same as you've described, the system keeps slowly loosing money, which is painful to watch, so I'm trying not to :) Also not too many positions across the board at the moment (I guyess they call it 'risk-off' period?)

    Did one interesting thing though: I ran a backtest with the full set of instruments I trade in the paper environment (~36) and full capital (~500k$, which in reality I don't have :( ), but I chocked the system's risk by halving the risk overlay parameters (the ones that limit my normal risk to 2x of the base expected risk, correlation breakdown to 2.5x and simultaneous volatility-spike to 3x), and the results looked very good, in fact the P&L, return and Sharpe were pretty-close to the "full 36 instrument system" and much better that the current PROD system with 20 instruments and 200k. The average margin usage increased of course but not because of spikes it became evenly-higher, and the average realized risk increased too but only a little.
    This is probably a pretty-hacky way of doing this, so I'm only playing with it., but there's seems to be a good potential there in trading a larger instrument universe on the same capital, while intelligently preserving the same risk-level and more evenly utilizing available margin..
     
    Last edited: Mar 25, 2021
    #2629     Mar 25, 2021
    wopr likes this.
  10. Handle123

    Handle123

    Best to be short Copper
     
    #2630     Mar 25, 2021