Fully automated futures trading

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

  1. isotope1

    isotope1

    Perfect, that's just what I needed!

    Thank you! :)
     
    #431     Jul 5, 2016
  2. BobbieJ

    BobbieJ

    GAT, just looking at your code, I am trying to understand how one could go about applying risk limits to various asset classes. your code applies instrument weights to all markets in one go without any regard to which asset class a given market belongs to. This approach may end up with increased risk allocation to commodities since there are more commodity futures than other asset classes.

    One way to deal with this issue is to choose an equal number of markets from each asset class, i get that. But what if you wanted to constrain asset classes in some meaningful way, how would you do that? (Or would you do that?)
     
    #432     Jul 6, 2016
  3. A simple way of doing this with fixed weights is to use what I call handcrafted weights, which essentially is a top down process where you allocate a certain amount to each sector, and then carve up the allocation within a sector (my actual live trading weights look like this). You don't need to code this, you can do it in a spreadsheet.

    Or you can add constraints to the optimisation. In reality this is the most complex method to do properly, especially if you're doing bootstrapping as you need to avoid making inefficient use of your constraints. I'd avoid this.

    Or you can run the optimisation as a bottom up process, optimising within asset classes first, and then across them. This is an approach I've used extensively in the past.

    GAT
     
    #433     Jul 7, 2016
  4. BobbieJ

    BobbieJ

    Thanks, the last method makes sense. It would require a two step optimization process, first to calculate instrument weights within an asset class, then second step for asset class weights if i understand correctly.

    Would you equalize sharpes when calculating asset class weights or not? Also, how would you deal with the fact each asset class have a different number of markets? If you didnt equalize sharpes, I would guess the asset class with most number of markets would get the highest weight since more markets = more diversification = higher (backtested) sharpe. So maybe equalizing sharpes would be better
     
    #434     Jul 7, 2016
  5. I don't agree.

    Actually I would equalise Sharpes on a per instrument basis, but not on a per asset class basis.

    I'd do the first inside asset class optimisation using estimated correlations and equalised sharpes (preferably boostrapped as well).

    I'd then calculate expected asset class SR based on the internal correlation of the asset class and the identical SR for each instrument. That would still mean that the more numerous asset classes would get a slightly higher weighting, although this would only be coming from their internal correlation not just from luck if they happened to perform better.

    I think I want to overweight asset classes with more instruments; although the overweighting wouldn't be as great as if you did equal weights across instruments. Even if all asset classes had zero internal correlation (unlikely!) then relative asset class weights would be proportional to the square root of the number of assets.

    eg with 3 instruments, 2 in asset class A, 1 in B
    Equal weights across instruments: 66.6% in asset class A, 33.3% in B
    Your suggestion (implies equal sector weights) 50% in A, 50% in B
    My method: 1.414 in A, 1 in B; normalised 59% in A, 41% in B

    Hope that makes sense
    GAT
     
    #435     Jul 7, 2016
  6. BobbieJ

    BobbieJ

    Thanks, I like your approach, makes a lot of sense. You let the correlation benefit decide the asset class sharpe. One final question: would you equalize market sharpes within an asset class or within the portfolio? Two approaches would result in different asset class sharpes, might be worth trying both but i'm wondering what you would be inclined to do. I think I would equalize sharpes across all markets in the portfolio and let the correlation benefit do the heavy lifting as you suggest.
     
    #436     Jul 7, 2016
  7. The latter - all assets in the portfolio get the same sharpe ratio

    GAT
     
    #437     Jul 7, 2016
    BobbieJ likes this.
  8. itb

    itb

    Hi GAT,

    I was playing with your system https://github.com/robcarver17/pysystemtrade and I wonder: what is the (functional, design?) reason of having the two folders syscore and systems? I can`t pinpoint what the big picture difference is between the scripts in the two folders.

    Thanks,
    itb
     
    #438     Jul 16, 2016
  9. It will probably become more obvious when there is a complete system rather than just a backtesting framework, but the idea is that syscore will contain a lot of shared "core" stuff. I might end up moving stuff around of course - there's some stuff in syscore that doesn't really belong there and will probably end up moving.

    GAT
     
    #439     Jul 16, 2016
  10. traider

    traider

    Hi GAT,

    I am currently reading your book I must say it has really filled in all the gaps in my 5 years of experience with the markets. I have several questions about an old chart you posted in page 6 of this thread.

    [​IMG]

    If you don't mind sharing,

    1) Why does breakout outperform momentum by such a huge margin? I ask because you provided some correlations in your blog for ewmac vs breakout and it seems that breakout and momentum should be pretty similar in terms of performance.
    Is the breakout rule in this picture similar to http://qoppac.blogspot.sg/2016/05/a-simple-breakout-trading-rule.html or a vastly different animal?

    2) What is the difference between relative carry and carry?

    3) What is the difference between momentum and normmom?

    4) What is the difference between globaltrend vs momentum?

    5) Can you elaborate a bit more about crosssectionasset?

    Thank you so much!
     
    #440     Jul 17, 2016
    isotope1 likes this.