Fully automated futures trading

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

  1. I can second that. When paper trading I wanted to be smart and adjusted the DO to do both "Start from Zero weights" and "Start from optimal weights" search and averaged them. Seemed like a good idea. Unfortunately I have had quite a few days with too much portfolio adjustments doing it that way. To be sure to not have these kind of side effects, unfortunately you have to test it for quite some time till longer term rolls come in and stuff like that.

    Don't bet the farm on some brain child.
     
    Last edited: Feb 12, 2025
    #4441     Feb 12, 2025
  2. corsair

    corsair

    As someone wise once said "no solutions, only tradeoffs"
     
    #4442     Feb 12, 2025
  3. corsair

    corsair

    Adding the buffer or any notion of portfolio distance from optimal to trigger a rebalance will help
     
    #4443     Feb 12, 2025
  4. Hi @globalarbtrader, just finished listening to your excellent interview on (https://thealgorithmicadvantage.com/podcast/033-rob-carver/). Lots of content to digest (and I feel like I need to re-read AFTS); but one quick question regarding minimum number of contracts per instrument. In your previous blog posts (such as here: https://qoppac.blogspot.com/2016/03/diversification-and-small-account-size.html) you wrote "There is around a 20% penalty to Sharpe if you can only hold one contract; around 5% with a maximum position of two. This falls to zero if you can hold 3 or 4 contracts," but on the podcast (I thought) you mentioned four contracts as the minimum size.

    I was wondering if your thinking had changed on the subject, or if it was just a case of simplification for the podcast audience? I've gotten up to 41 instruments (with a minimum of 2 contracts per instrument) on my static system; but would reconsider the tradeoff between instrument bredth and depth if you've found a higher number of contracts per instrument to be opitimal.
     
    #4444     Feb 28, 2025
  5. I think that that March 2016 blog post you linked to already has the answer to your question. It has a chart in the section titled "Putting it together". The orange line in it represents your situation of having two contracts per instrument. With 41 instruments you would have a Sharpe of around 0.68. If you now draw a horizontal line to intersect with the blue line you can see how many instruments you would need with three contracts per instrument to beat your current setup (i.e. same or better Sharpe ratio). It looks to be about 16 instruments. So if you can have at least 16 instruments for which you can have at least three contracts you would get a better result than your current setup.
    At least, that's how I interpret that graph.
     
    #4445     Feb 28, 2025
  6. Fair points. I guess what I am looking for is a rule of thumb about adding more contracts. In the past that rule has been: If I can hold two contracts of an instrument I don't currently have - and very highly correlated with something I already have - then add it. As a result not all instruments are at 2 max contracts (21 of the 41 are at 3+). Anyway will need to think about my rule of thumb here a bit more. My memory was that in @globalarbtrader file with optimal instrument selection for portfolios of various size; there were some instruments (I think live cattle or lean hogs) with a max of one contract included; beacuse they were so diversifying which overwhelms the # of contract consideration.

    The question about # of contracts is also relevant with choosing versions of an instrument (e.g. micro/mini full contract). I have a lot of the small contracts; and there is a tradeoff there between # of contracts you can hold and higher trading costs; and its not obvious when to switch contracts (sorry if @globalarbtrader has already covered this in depth - which he probably has - but I've missed it or just as likely forgot about it).
     
    #4446     Feb 28, 2025
  7. I seem to recall that Rob did have blog posts that cover the topic of "rule of diminishing returns", meaning that the increment in benefit becomes smaller when the list of instruments gets longer. I mean that going from 10 to 20 instruments is meaningful, but going from 90 to 100 is less useful. But I can't remember when that was posted, or how it was titled.
    That's why I stopped adding more instruments after I had around 55 of them. Although it was mostly automated, it did require some manual administration every now and then. I was too lazy to maintain a larger number of instruments.
     
    #4447     Feb 28, 2025
  8. Simplification

    The danger is if there is someone punting futures on a small account just trading a couple of markets with only enough cash for two contracts; to be honest they probably shouldn't be trading futures. Safer to say 'use 4 futures'. That also allows for risk and maximum position size changing a little. With 40 odd instruments and a decent sized account you're probably okay so you can afford to be nuanaced.

    For similar reasons I used four contracts as a rule of thumb in ST; but yes when I did the research I found that beyond 3 the improvement is very incremental with the figures you said.

    And those are the numbers I used in static system selection (which I no longer use myself of course; blogpost). If you look at the code I do something a bit fancier as I don't have an integer maximum position, from https://github.com/robcarver17/pysy...mall_system_optimise/optimise_small_system.py line #303 the penalisation I use is:

    Code:
    
    def net_SR_for_instrument(
        maximum_position, trading_cost, notional_SR=0.5, cost_multiplier=1.0
    ):
        return (
            notional_SR - (trading_cost * cost_multiplier) - size_penalty(maximum_position)
        )
    
    def size_penalty(maximum_position):
        if maximum_position < 0.5:
            return 9999
    
        return 0.125 / maximum_position**2
    Units are annualised SR, with a baseline SR of 0.5

    So for <1 contract, penalty is infinity, for 1 contract 0.125 penalty (so SR before costs 0.375 and it's a 25% penalty vs baseline of 0.5), for 2 contracts the penalty works out to 6.25%, for 3 it's 2.7% and so on. So numbers very much in line with those in my original research.
     
    #4448     Feb 28, 2025
    FrankieC84 likes this.
  9. You mean this: https://github.com/robcarver17/reports/blob/master/Static_selection_of_instruments

    Could do with an update, will do when I get home. That just runs the code I pointed to in the previous post - the methodology is in AFTS (chapter 4 from memory).

    For choosing micro or mini (or indeed selecting which of several listings globally to trade) the decision is quite simple - choose the contract with the smallest contract size (will map to minimum position directly assuming the same vol) that meets my minimum rules on liquidity and costs. That's automated in this report: https://github.com/robcarver17/reports/blob/master/Duplicate_markets_report

    Rob
     
    #4449     Feb 28, 2025
    FrankieC84 likes this.
  10. danw

    danw

    Due to spread trading volume getting reported in the CSI EOD data, I'm wondering if anyone adds an extra modifier to the liquidity check for certain instruments like this?

    This data coming from CSI just passed my liquidity threshold, however when I check the bid/ask on IB it's still showing concerning lack of liquidity on both sides. On the March contract one side (the ask) has no orders at all.

    I'm thinking I should have a list of special instruments like this where I require double/triple the volume number, or maybe have a fixed amount I subtract from the volume to account for these spread trades.
     
    #4450     Mar 3, 2025
    corsair likes this.