Code Monkey home page Code Monkey logo

tactical-asset-allocation's Introduction

Tactical Asset Allocation (pyTAA)

This package features a set of tools to backtest systematic, low-frequency strategies and compare various tactical asset allocation (TAA) programs. Asset allocation in general is about finding a balance between risk and reward whilst accounting for investment goals, time frames and risk preferences. Asset allocation often comes in three forms: Strategic, Tactical and Dynamic. Tactical asset allocation takes a more active investment approach and can be characterized as follows:

  • Active management of portfolio strategy that shifts allocation based on market trends or economic conditions (e.g. stocks, bonds, cash, commodities)
  • Benefits are diversification, drawdown control and overall risk management (MDD <20%, SR > 0.75)
  • Typically strategies are absolute return (returns uncorrelated to markets/betas), relative return (beat benchmark) and total return (targeted return)

Package

This package is a current WIP and I update it whenever I find time. The goal of this package is to demonstrate different TAA techniques and how they perform through different economic cycles. Whilst each strategy is unique, they all share certain common characteristics, e.g. momentum signals or dual momentum sorts. The package tries to break down these characteristics into individual modules that can be used on their own.

Installation

You can find the package on PyPi and install using pip:

pip install pytaa

Portfolio Strategies

For an overview of various TAA strategies please have a look at the src/taa/strategy/README.md file. You can also check out the reference list at the bottom for more information. Many of these strategies have been taken from this source.

References

  • Antonacci, Gary. ‘Risk Premia Harvesting Through Dual Momentum’. SSRN Scholarly Paper. Rochester, NY, 1 October 2016. https://doi.org/10.2139/ssrn.2042750.
  • Blitz, David, and Pim van Vliet. ‘Dynamic Strategic Asset Allocation: Risk and Return Across Economic Regimes’. SSRN Scholarly Paper. Rochester, NY, 1 July 2009. https://doi.org/10.2139/ssrn.1343063.
  • Butler, Adam, Mike Philbrick, Rodrigo Gordillo, and David Varadi. ‘Adaptive Asset Allocation: A Primer’. SSRN Scholarly Paper. Rochester, NY, 31 May 2012. https://doi.org/10.2139/ssrn.2328254.
  • Eychenne, Karl, Stéphane Martinetti, and Thierry Roncalli. ‘Strategic Asset Allocation’. SSRN Scholarly Paper. Rochester, NY, 1 March 2011. https://doi.org/10.2139/ssrn.2154021.
  • Keller, Wouter J., and Jan Willem Keuning. ‘Breadth Momentum and the Canary Universe: Defensive Asset Allocation (DAA)’. SSRN Scholarly Paper. Rochester, NY, 12 July 2018. https://doi.org/10.2139/ssrn.3212862.
  • Keller, Wouter J., and Jan Willem Keuning. ‘Protective Asset Allocation (PAA): A Simple Momentum-Based Alternative for Term Deposits’. SSRN Scholarly Paper. Rochester, NY, 5 April 2016. https://doi.org/10.2139/ssrn.2759734.
  • Kritzman, Mark, Sébastien Page, and David Turkington. ‘Regime Shifts: Implications for Dynamic Strategies’. Financial Analysts Journal, 2012, 18.
  • WifeyAlpha, Tactical Asset Allocation, https://twitter.com/WifeyAlpha/status/1502576435134877701

Disclaimer

The content is for informational purposes only, you should not construe any such information or other material as legal, tax, investment, financial, or other advice.

tactical-asset-allocation's People

Contributors

oronimbus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

tactical-asset-allocation's Issues

Implementation of other TAA strategies in Main.ipynb

Thank you Oronimbus! This code is a great resource for these trying to implement and compare Tactical Asset Allocation Strategies in Python. It'd be great if you could show in the Main.ipynb how to implement the other strategies in pytaa / strategy / static in particular GTAA and AAA. Or otherwise provide some comments to show how to implement your own strategies. Thanks again!

Use autoversioning with `setuptools`

  • Had some issues uploading to PyPi using scm. Need to do some more investigations.
  • Change pyproject.toml:
[project]
dynamic = ["version"]

[tool.setuptools_scm]
version_scheme = "release-branch-semver"
  • Change setup.py:
setup(use_scm_version=True)

References:

Incorrect indexing on RBAA sample code

On the line
cond_2 = np.where(strategy_data.reindex(signal_2.index) > signal_2, 1, 0)[:,:-1]
compared with strategy_data.reindex(signal_2.index) > signal_2 (dataframe format)
when you index by [:,:-1] (exclude last column)
The VNQ column is excluded, you intended to compare the price of all asset except cash to its 12m SMA. You should exclude the first column instead.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.