Fully automated futures trading

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

  1. Multi signal is the raw signal multiplied by a factor refecting the allocation in the portfolio and how much capital I have. Rather confusingly this doesn't correspond to anything I've written in my book (the system as described in my book, and in pysystemtrade, is deliberately simpler in terms of how the stages are put together - although they produce exactly the same result).

    These are the current raw signals (number in the third column after instrument code, ignore the other columns):

    Code:
           code  rawsignal  weight    pi  signal  vfactor  multiplier  optpos  position
    17      VIX      -2.54   0.025  3.14  -0.159    0.213       126.1    -4.3        -4
    16      V2X      -2.00   0.025  3.14  -0.125    0.981       123.7   -15.2       -14
    10      OAT      -0.42   0.028  3.14  -0.029    0.112       125.9    -0.4        -1
    0      CORN      -0.25   0.033  3.14  -0.021    0.210       126.3    -0.6        -1
    34  CRUDE_W      -0.21   0.040  3.14  -0.021    0.081       126.3    -0.2         0
    7      BOBL      -0.14   0.014  3.14  -0.005    0.277       124.8    -0.2         0
    4     WHEAT      -0.05   0.033  3.14  -0.004    0.114       126.1    -0.1         0
    35   GAS_US      -0.02   0.040  3.14  -0.002    0.107       126.3    -0.0         0
    33     PLAT       0.00   0.040  3.14   0.000    0.132       126.3     0.0         0
    31     GOLD       0.00   0.040  3.14   0.000    0.080       126.1     0.0         0
    27      JPY       0.00   0.033  3.14   0.000    0.122       126.1     0.0         0
    14     US20       0.00   0.007  3.14   0.000    0.090       126.1     0.0         0
    37  EUROSTX       1.27   0.000  3.14   0.000    0.202       125.9    -9.0        -9
    11    SHATZ       1.47   0.000  3.14   0.000    1.466       125.9     0.0         0
    9      BUND       0.00   0.014  3.14   0.000    0.107       125.9     0.0         0
    8       BTP       0.00   0.028  3.14   0.000    0.071       125.9     0.0         0
    5      KR10       0.00   0.014  3.14   0.000    0.271       122.8     0.0         0
    12     US10       0.00   0.007  3.14   0.000    0.217       126.1     0.0         0
    13      US2       0.36   0.007  3.14   0.006    0.674       126.1     0.5         1
    6       KR3       0.23   0.014  3.14   0.008    1.314       122.5     1.3         2
    15      US5       0.52   0.007  3.14   0.009    0.398       126.1     0.5         0
    26      GBP       0.28   0.033  3.14   0.023    0.150       126.1     0.4         1
    20      CAC       0.44   0.022  3.14   0.024    0.134       125.9     0.4         0
    30   COPPER       0.37   0.040  3.14   0.037    0.114       126.1     0.5         0
    36  EDOLLAR       0.44   0.040  3.14   0.044    0.620       126.3     3.5         3
    25      EUR       0.81   0.033  3.14   0.067    0.094       126.1     0.8         1
    21      SMI       1.24   0.022  3.14   0.067    0.100       125.9     0.8         1
    2   LIVECOW       1.09   0.033  3.14   0.091    0.105       126.1     1.2         1
    22   NASDAQ       1.83   0.022  3.14   0.099    0.058       125.9     0.7         1
    18    KOSPI       2.17   0.022  3.14   0.117    0.091       122.5     1.3         1
    29      NZD       1.58   0.033  3.14   0.131    0.191       126.1     3.2         3
    28      MXP       1.68   0.033  3.14   0.140    0.358       126.1     6.3         6
    32   PALLAD       1.49   0.040  3.14   0.149    0.058       126.3     1.1         1
    23    SP500       2.76   0.022  3.14   0.150    0.125       125.9     2.3         2
    1   LEANHOG       1.94   0.033  3.14   0.162    0.265       126.3     5.4         5
    19      AEX       3.00   0.022  3.14   0.163    0.072       125.9     1.5         1
    24      AUD       2.18   0.033  3.14   0.182    0.143       126.1     3.3         3
    3   SOYBEAN       1.22   0.067  3.14   0.203    0.081       126.1     2.1         2
    
    These are equivalent to the forecasts I describe in my book divided by 10. In principal then they should be capped at -2 and +2 (absolute cap of 20 used in the book). In practice I use a non linear mapping (described in this post https://qoppac.blogspot.co.uk/2016/03/diversification-and-small-account-size.html) which means that signals can be bigger than +/- 2, and in fact can be as high as +/- 3.

    VIX isn't actually capped at 20 then; it's just a coincidence that the multisignal is at that level.

    GAT
     
    #851     Jul 21, 2017
    HobbyTrading likes this.
  2. @globalarbtrader thank you for your explanation. I indeed assumed that "Multisignal" was another word for what you call "forecast" in your book.
    I recall your blog entry about using a non-linear mapping. I do something similar in my system.
     
    #852     Jul 21, 2017
  3. Hi Gat,
    I'm trading your chapter 15 system on 8 markets, with 30% volatility, and my forecasts seem quite different from yours. Should I be concerned, or is this likely due to the fact that our systems are different in terms of volatility target and quantity of markets?

    My recent forecasts:
    VIX -20 (capped); so this matches yours
    GAS_US -14; versus yours of -2
    US2 11; versus yours of 3.6
    LEANHOG 12; versus yours of 19.4
    PLAT -5; versus yours of 0
    GBP 1.4; versus yours of 2.8
    NASDAQ 9; versus yours of 18
    EDOLLAR 4; versus yours of 4.4

    Thanks, as always.
     
    #853     Jul 22, 2017
  4. tradrjoe

    tradrjoe

    They will never match exactly for many reasons. The correlation between your forecasts and GAT's forecasts is 0.87 - close enough for it not to matter in the long run (as long as your overall backtest looks similar)...
     
    #854     Jul 22, 2017
  5. Do you also use the non-linear mapping that @globalarbtrader refers to in his post above?
     
    #855     Jul 22, 2017
  6. To begin with you should compare your forecast against my raw forecast mutiplied by 10 (see the earlier post). Then they wouldn't be affected by vol target or quantity of markets (which is the joy of making forecasts). For example VIX, you should compare -2.54*10 = -25.4 against 20 for you. For GAS_US compare -0.02*10 = -0.2 for me against -14.

    Then as @HobbyTrading says I'm using a non linear transform to make best use of my relatively small account. I'm using a different set of forecasting rules, the basics in chapter 15, but also some others which I've talked about on my blog (breakout, different ways of measuring momentum, relative value carry, short bias in vol). Finally my forecast weights will be different from yours.

    @tradrjoe makes a good point. Your forecasts will probably be never the same, but I'd wager that our monthly returns would still be correlated 90%.

    As part of pysystemtrade I will see if I can work out a way of publishing daily my actual system diagnostics once I get the thing up and running (could take a while :) )

    GAT

    PS also I didn't primarily write my book, or do my blog, or this thread, so that people can have a system they can unthinkingly copy and use...
     
    #856     Jul 23, 2017
  7. Thanks for the replies, guys. That makes me feel better that I'm not messing something up. I'm not using the linear transform. GAT, you're right I should have quoted -25.4 for VIX (I was just thinking of the capped forecast), and -.2 for GAS_US (I accidentally added a decimal place).
     
    #857     Jul 23, 2017
  8. wintergasp

    wintergasp

    @globalarbtrader

    What has been your annualized sharpe ratio since the start of this thread ?

    Can you plot the backtest of your systems (gross of commissions & fees) VS. your actual trading ? It would be interesting to see the impact of manual operations such as roll-overs, missed trades, etc.
     
    #858     Aug 3, 2017
  9. truetype

    truetype

    AHL on the tape with good July numbers -- Alpha +2.6 Dim +2.3 Div +3.4 Evo +2.7.
     
    #859     Aug 4, 2017
  10. isotope1

    isotope1

    Here's some things I learnt for anyone else trying to implement this with Python:
    • Working with data on one machine? Try HDF5 in tables mode.
    • Working with data across many machines? Try Arctic (AHL's ticker plant).
    • Try concurrent.futures.ProcessPoolExecutor().map() for backtests. My first implementation took 10 minutes to backtest 45 instruments. Now it takes 20 seconds.
    • Vectorize everything.
    • Mongo is much better than SQL in every way when combined with Pandas. I no longer use SQL at all.
    • Docker is a good idea, especially for deploying.
    • Digital Ocean is much easier than AWS etc.
    • pytest is good
    • Want to buy a computer for backtesting? I bought an 8 core Xeon w/ 32GB RAM on ebay for £200. It must have cost thousands just a couple of years ago.
     
    #860     Aug 6, 2017
    sle and globalarbtrader like this.