TuringTrader showcase algorithms

Discussion in 'Trading Software' started by Felix168, Dec 20, 2018.

Thread Status:
Not open for further replies.
  1. Felix168

    Felix168

    As a showcase for TuringTrader's capabilities, I have implemented the algorithms described in the following books:
    • Muscular Portfolios, by Brian Livingston
    • Dual Momentum Investing, by Gary Antonacci
    • The Ivy Portfolio, by Mebane T. Faber
    • Stocks on the Move, by Andreas F. Clenow

    See this blog post here:
    https://www.turingtrader.org/2018/12/showcase-algorithms-from-various-books/


    Cheers, Felix
     
  2. MarkBrown

    MarkBrown

    Smarter Trading by Perry Kaufman
    The Logical Trader by Mark B. Fisher
     
  3. Felix168

    Felix168

    Thanks for the suggestions Mark, I'll have a look at these.

    My list was by no means intended to be complete; I simply chose some publicly available algorithms, to showcase TuringTrader's capabilities. Is there a specific technique in the books you mentioned, that you would like to see implemented with TuringTrader?
     
  4. qlai

    qlai

    You don't provide any of historical data, everything needs to be loaded in?
     
  5. Felix168

    Felix168

    Hi Qlai,

    good question. I unfortunately cannot legally redistribute my historical data. The project includes data setup files for the instruments used in the demos (and I just added setup files for a few ETFs used in the showcases). With these setup files, TuringTrader will pull data from freely available sources.

    Best regards, Felix
     
  6. jharmon

    jharmon

    Re Clenow strategy - you've got some serious survivorship bias in your code. Otherwise, your engine looks interesting.
     
    Last edited: Dec 22, 2018
  7. Felix168

    Felix168

    Hi JHarmon,

    regarding the survivorship bias - you are correct that I do not consider current membership in the S&P500, which is a criterion in Clenow's original strategy. Also, the list of instruments is incomplete, I use about 200 of the top liquid instruments while Clenow used the full S&P500. However, my list of instruments includes quite a few delisted instruments.

    In order to fix the survivorship bias, I often change the benchmark from S&P500 to an artifical benchmark created from equally weighting the instruments used in the simulation. Another way to fix this is on the data side, by removing the quotes for those times in which specific instruments where not part of the index. TuringTrader will dynamically add/remove instruments from the simulation.

    Anyways - the code was not meant to be perfect, but more to show how portfolio algorithms can be implemented with TuringTrader.

    Cheers, Felix
     
  8. gkishot

    gkishot

    Would you please provide CAGR returns for the algorithms? What was their return in 2018?
     
    Last edited: Dec 22, 2018
  9. Felix168

    Felix168

    Hi Gkishot,

    I didn't publish the returns, because this is not supposed to be a book review of any kind. What I wanted to show is, that portfolio algorithms can be implemented in an elegant and concise manner with TuringTrader.

    Having said that, all of the algorithms mentioned in the post are roughly on par with S&P in the long term, typically trailing in bullish years and with a better downside protection in bearish times.

    An algorithm combining many of the concepts shown in this showcase, along with performance data, can be found here: https://www.bertram.solutions/services/products/portfolio-2018-48-1/

    Cheers, Felix
     
    gkishot likes this.
  10. jharmon

    jharmon

    Sure - but, as published, it still has survivorship bias - it's really not a good simulation of the Clenow strategy at all. I've actually read and implemented the Clenow strategy using historical index constituents and the backtest result is very different from the current constituents and even using the current top 200 liquid instruments is an alternative form of selection bias. I'm not arguing for or against S&P 500 as an investable universe, but in a backtest you need to have a rolling set of constituents that are valid for that particular date, not just valid for the current date.
     
    #10     Dec 24, 2018
Thread Status:
Not open for further replies.