Fully automated futures trading

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

  1. Former is for the correlation of substrategy returns, latter is the correlation of the underlying instrument returns. So the latter is more appropriate for a risk report, and DO calculations. The former you'd use for IDM estimation and instrument weight estimation.

    Rob
     
    #4051     Apr 7, 2024
    wopr likes this.
  2. wopr

    wopr

    I've been playing with DO implementation, and stumbled upon what could be a slight improvement so wanted to share.

    I've been trading Rob's implementation of DO for about 2 years now, and I've been noticing that I would sometimes have a position on in an instrument that has optimal unrounded, eg. 0.17, and have nothing on in something with optimal unrounded 1.7. Digging into this, I think it is because since the algo is greedy, if the 0.17 one has a big notional, it will take that as that will reduce the tracking error the most in that step. Then it never gets to the 1.7 one, as the notional is much smaller.

    I've made the following modification: instead of starting from 0 weights for all instruments as the starting point for the DO, start from the
    Code:
    round(unrounded_optimal_position)
    . I then increase/decrease the weight towards optimal unrounded weight in the DO iterations.
    That does indeed reduce the occurrences I've mentioned above. It also prevents the situation of forecast flipping - when forecast is around 0, original implementation has to switch position (I believe buffering deals with that to an extent). The reason it prevents that situation is that if the optimal unrounded is [-0.49, 0.49], we'll start from 0 anyways, so variations around 0 forecast/optimal unrounded are not as impactful.

    Running a backtest on 104 instruments, about 20 years of data, I get lower average tracking error, 3.81% vs 4.65% with the original method.
    Here's a chart with difference over time.
    upload_2024-4-8_17-50-54.png

    The downside is that on average, you hold a lot more positions, for the same backtest, average positions held is 22 for Rob's method vs 29 for my modified version.

    Risk is almost exactly the same, slightly smaller for my method.

    Has anybody played with something similar? Would be interested to see if anyone could replicate these results.
     
    #4052     Apr 8, 2024
  3. Hello globalarbtrader,

    How much upfront capital is needed to trade your portfolio of algos?

    Thank you,
     
    #4053     Apr 8, 2024
  4. Now that looks like a very nice idea... I may well steal it.

    Rob
     
    #4054     Apr 8, 2024
    wopr and newbunch like this.
  5. cholo

    cholo

    Hi wopr,

    I implemented the DO using Mixed Integer Programming and always have positions in much more instruments. I posted about it months ago. Today I have positions in 50 instruments for ~600k capital. Probably it is more relevant if you trade lots of micro contracts like I do.

    I uploaded my first implementation in Python and C# here, but I need to update it with the version I'm running in production. This does not have any buffering. But in case you want to have a look:

    https://github.com/golforado/tracking-portfolio

    Thanks,
    Luis
     
    #4055     Apr 8, 2024
    Kernfusion and wopr like this.
  6. wopr

    wopr

    Hi Luis, thanks for posting!
    I saw that and actually spent a good week trying to make that work, but I just couldn't figure it out. You defined the problem slightly differently and I couldn't figure out how to replicate it, I think I got confused by the target risk multiplier.
    Added to that that I couldn't really find a solver that would work (I still can't figure out how to download CPLEX :D) and was reasonably priced, I gave up. Would be very interested in the refreshed version with buffering though.

    Thanks for mentioning that you also have more positions on, makes me think that my approach here is in the right direction. I'm running a bit more capital, and 45 positions on at the moment.
     
    #4056     Apr 8, 2024
  7. As I said about 4 posts ago:

    Personally I think the absolute minimum account size to trade futures is probably around the 50k mark

    Rob
     
    #4057     Apr 8, 2024
    MarkBrown and SimpleMeLike like this.
  8. There's a CPLEX Optimization Studio Free Edition, even though it has limitations (1000 variables/ contraints)
     
    #4058     Apr 8, 2024
  9. newbunch

    newbunch

    Everyone wants to be "fully" automated until the exchanges change things on you.

    For anyone trading BAX futures, I got this from IB:

    BAX to CORRA futures Migration
    Dear Trader,

    Since you either have positions or have previously traded in Montreal Exchange listed BAX contracts, we want to make you aware that on 04/26/24, trading on all BAX contracts (except June 2024 expiration) would cease. All BAX contracts expiring after June 2024 will be converted to CORRA equivalents.

    The conversion will take place on 04/27/24; we expect that customer accounts would reflected updated CORRA positions by the start of trading on 04/29/24. Note also that June 2024 BAX futures will remain listed and trade until the standard expiration date.

    The Montreal Exchange FAQ – Transitioning to CORRA documentation can be found here.​

    Personally, I just have to add the CORRA contracts to my system and it won't be confused by the fact that my BAX contract disappeared and a corresponding CORRA contract appears (assuming I have an open position in BAX, which I currently do). Still, I hate anything that would possibly break my system if I had been on vacation or not paying attention.
     
    #4059     Apr 8, 2024
    Kernfusion likes this.
  10. Kernfusion

    Kernfusion

    I'm also trading this one, but never had an actual position in it, probably that's why IB didn't send me this email, thanks for sharing!
     
    #4060     Apr 8, 2024
    newbunch likes this.