Fully automated futures trading

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

  1. Elder

    Elder

    Thanks. I may attempt to code something up when I get time but it looks a bit more involved at first glance. The attraction of Garch is the relative ease with which you can estimate params using MLE.
     
    #2291     Sep 28, 2020
  2. sef88

    sef88

    Hi @globalarbtrader

    I'm an avid follower of your blog, books on trading and podcast.

    I've a question on the bootstrapping technique on expanding window that you used in your backtesting for optimization of portfolio. But I believe that you used it for finding the weights of your trading rules such as MA crossover, breakout and carry. (https://qoppac.blogspot.com/2015/10/a-little-demonstration-of-portfolio.html)

    When you apply bootstrapping on let's say first 5 years of data (1260 days) with 100 simulations run,
    - In each simulation run, are you taking sampling with replacement of 1260 daily returns? And when you expand to 6 years of data, would it be 1512 days..so on and forth?
    - If it's the above, could we be sacrificing the possible serial correlation properties of daily returns?
    - I'm thinking of the following instead: Instead of sampling daily returns, I sample X days continuous period (say 1 or 3 years) 100 times. In each run, I would derive a set of weights of W1, W2, W3.. for my rules based on optimized sharpe/sortino ratio; and I would find the average optimized weights based on 100 runs. And I apply the average optimized weights on out of sample data.
    - If I were to adopt the third point, what would be advantage/ disadvantage as compared to your approach?

    Thanks! Keen to seek other's opinions too!
     
    #2292     Oct 2, 2020
  3. Yes, you could indeed use block bootstrapping (that's the fancy name for what you've described). Minor note, I use weekly returns not daily; firstly it's computationally faster and with the length of data series I tend to use you're not sacrificing any informational content, secondly using daily biases correlations downwards in my dataset because the markets close at different times.

    Incidentally, I'm not using bootstrapping so much nowadays, I prefer handcrafting (which I only formally implemented some time after that blog post, in a series of posts starting with this one).

    GAT
     
    #2293     Oct 2, 2020
  4. Any questions for the TTU podcast I'm recording tommorrow morning?

    beset
    Rob
     
    #2294     Oct 2, 2020
  5. sef88

    sef88

    Hi Rob

    Thanks for your reply. Just curious, are you doing handcrafting even for deriving weights amongst your trading rules (e.g. exp MA crossover difference, breakout and carry)?

    And on your forecast scalar to scale up to average absolute of 10 (https://qoppac.blogspot.com/2016/01/pysystemtrader-estimated-forecast.html), does your system update it daily or do you re-estimate periodically..say once a year.

    Would also like to seek your advice on the following - as I've limited capital and could only trade a few instruments. In my backtest of estimating parameters such as trading rules weights and forecast scalars, would you recommend estimating them based on largest possible universe of instruments or should it be constrained to the basket of instruments that I intend to trade? Based on law of large numbers and assumption that all instruments are similar, I'm learning towards the former.

    For Chapter 6 of your Leveraged Trading book, you mentioned that back then for spot currencies, you're able to borrow AUD at 2% and earn 2.25% in USD. I was looking at the interactive brokers spot rates as of now, it seems like across all the currencies, there are no viable opportunities for positive carry. Is this positive carry only available in futures contract?

    Apologies for multiple questions as I'm in the midst of building my systematic trading system.

    Jr
     
    #2295     Oct 2, 2020
  6. Yes

    I update them.... never

    Yes, agreed, largest possible basket.

    You have to seperate out the carry, and the interest rate margin (which is a cost). The carry determines the sign of your position, the costs determine whether you should trade at all. Take the example in chapter 8 (page 203 of print edition) (rounded slightly to make figures easier):

    I pay 2% to borrow AUD and earn 1.0% as a deposit rate. Average is 1.5%
    I pay 2.75% to borrow USD and earn 2.25% as a deposit rate. Average is 2.5%

    Carry if short AUDUSD would be the average of 1.5% and 2.5% which is 1.0%

    If I'm short AUDUSD I'd actually earn 2.25% and pay 2%, which is 0.25%. My cost is1 - 0.25 = 0.75% a year
    If I'm long AUDUSD I'd actually earn 1% and pay 2.75% which is -1.75%. My cost is -1% - 1.75% = 0.75%

    (by construction, these are the same)

    I then work out what 0.75% is in risk adjusted terms, and decide if I can trade or not.

    Wheras in AUDUSD right now spot is 0.71540 and future is 0.71510. So I can earn 0.00030 of carry over the next 17 days on a short position, which annualises to about 0.9% a year (rates have changed a litle from when I did the example in the book). Ignoring the opportunity cost of margin, I will earn that if short and pay it if long (there are holding costs from rolling, but they are relatively small).


    The short answer is that the interest margin charged by most brokers makes spot FX completely uneconomical, unless you are day trading (which, if you've read the book, is equally stupid).

    GAT
     
    #2296     Oct 2, 2020
  7. sef88

    sef88

    Thanks Rob for your detailed reply.

    Indeed, the interest margin charged by most brokers are exorbitant.

    On the last 2 lines above, when you quote,
    - Why do you have to take 1%-0.25% = 0.75%. Where is this 1% from? Is it from the carry you mentioned above?
    - And cost -1% - 1.75% = 0.75%? Should it be -2.75% instead?

    Also looking at rates from Interactive Brokers now, is what I interpreted correct?

    Rates paid to me: https://www.interactivebrokers.com/en/index.php?f=46385
    Rates charged to me: https://www.interactivebrokers.com/en/index.php?f=46376&p=m

    I pay 1.6% to borrow AUD and earn 0% as a deposit rate. Average is 0.8%
    I pay 1.59% to borrow USD and earn 0% as a deposit rate. Average is 0.795%

    Carry if short AUDUSD would be = 0.8% - 0.795% = 0.005%

    Just to be clear, this only applies to futures and that' what makes futures contract more economical? :)
     
    #2297     Oct 2, 2020
  8. Yes, the 1% is the theoretical carry that we should earn on a long position

    Sorry the correct calculation is:

    If I'm long AUDUSD I'd actually earn 1% and pay 2.75% which is -1.75%. My cost is -1% - (- 1.75%) = 0.75%

    Yes

    The advantage of futures or any dated instrument (could be dated spread bets or CFDs) is that the carrying cost (interest) is built into the price and so (ignoring bid/ask) it is always the same for long and short

    best
    Rob
     
    #2298     Oct 2, 2020
    sef88 likes this.
  9. sef88

    sef88

    Thanks for your thoughtful replies!
     
    #2299     Oct 2, 2020
  10. Rob, I have read your latest blog entry (https://qoppac.blogspot.com/2020/10/should-i-run-my-trading-system-at-fixed.html) but have problems with the conclusion, and thus with the question in the title of it.
    You seem to reject the usage of a fixed risk target such as you recommended in your book "Systematic Trading". You now suggest to use something else:
    I don't completely understand what you mean by this. Can you please give an example how you would implement this? e.g. for one instrument, or for a portfolio of instruments?
     
    #2300     Oct 10, 2020