Strategy Evaluation

Alpha factors drive an algorithmic strategy that translates into trades that, in turn, produce a portfolio. The returns and risk of the resulting portfolio determine the success of the strategy. Testing a strategy requires simulating the portfolios generated by an algorithm to verify its performance under market conditions. Strategy evaluation includes backtesting against historical data to optimize the strategy's parameters, and forward-testing to validate the in-sample performance against new, out-of-sample data and avoid false discoveries from tailoring a strategy to specific past circumstances.

In a portfolio context, positive asset returns can offset negative price movements in a non-linear way so that the overall variation of portfolio returns is less than the weighted average of the variation of the portfolio positions unless their returns are perfectly and positively correlated. Harry Markowitz developed the theory behind modern portfolio management based on diversification in 1952, which gave rise to mean-variance optimization: for a given set of assets, portfolio weights can be optimized to reduce risk, measured as the standard deviation of returns for a given expected level of returns. 

The capital asset pricing model (CAPM) introduced a risk premium as an equilibrium reward for holding an asset that compensates for the exposure to a single risk factor—the market—that cannot be diversified away. Risk management has evolved to become much more sophisticated as additional risk factors and more granular choices for exposure have emerged. The Kelly Rule is a popular approach to dynamic portfolio optimization, which is the choice of a sequence of positions over time; it has been famously adapted from its original application in gambling to the stock market by Edward Thorp in 1968.

As a result, there are several approaches to optimize portfolios that include the application of machine learning (ML) to learn hierarchical relationships among assets and treat their holdings as complements or substitutes with respect to the portfolio risk profile.

In this chapter, we will cover the following topics:

  • How to build and test a portfolio based on alpha factors using zipline
  • How to measure portfolio risk and return
  • How to evaluate portfolio performance using pyfolio
  • How to manage portfolio weights using mean-variance optimization and alternatives
  • How to use machine learning to optimize asset allocation in a portfolio context

The code examples for this chapter are in the 05_strategy_evaluation_and_portfolio_management directory of the companion GitHub repository.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.135.202.224