Strategizing - Python Programming for Finance p.21




Hello and welcome to part 9 of the Python for Finance with Quantopian tutorials. In the previous tutorials, we covered a quick run through of coming up with an Alpha Factor, analyzing it, using it in a trading strategy and analyzing the back test of that strategy. Here, what I'd like to do now that we've done one pass through everything is to address a typical strategy work-flow and make more of an attempt to come up with something useful.

To begin, I will reference the introduction to Alphalens post on Quantopian. There, we have a simplified workflow that is:

  1. Universe Selection: define the universe of tradeable components; the universe should be broad but have some degree of self similarity to enable extraction of relative value. It should also eliminate hard to trade or prohibited instruments.
  2. Single Alpha Factor Modeling: define and evaluate individual expressions which rank the cross section of equities in your universe.
  3. Alpha Combination: combine many single alphas into a final alpha which has stronger prediction power than the best single alpha. This is often due to the noise in each alpha being canceled out by noise in other alphas, allowing signal to come through.
  4. Risk Model: define and calculate the set of risk factors you want to use to constrain your portfolio.
  5. Portfolio Construction: implement a process which takes your final combined alpha and your risk model and produces a target portfolio that minimizes risk under your model.
  6. Execution: implement a trading process to transition the current portfolio (if any) to the target portfolio.

We basically skipped #3, and didn't do much in the way for #4 or #5. In the next few videos, I would like to have us go a bit more into hunting for further alpha factors, combining them, and then building a portfolio off of it.

The video for this tutorial addresses some of the other considerations for a strategy, along with many of the issues with our previous algorithm were.

The next tutorial:





  • Intro and Getting Stock Price Data - Python Programming for Finance p.1
  • Handling Data and Graphing - Python Programming for Finance p.2
  • Basic stock data Manipulation - Python Programming for Finance p.3
  • More stock manipulations - Python Programming for Finance p.4
  • Automating getting the S&P 500 list - Python Programming for Finance p.5
  • Getting all company pricing data in the S&P 500 - Python Programming for Finance p.6
  • Combining all S&P 500 company prices into one DataFrame - Python Programming for Finance p.7
  • Creating massive S&P 500 company correlation table for Relationships - Python Programming for Finance p.8
  • Preprocessing data to prepare for Machine Learning with stock data - Python Programming for Finance p.9
  • Creating targets for machine learning labels - Python Programming for Finance p.10 and 11
  • Machine learning against S&P 500 company prices - Python Programming for Finance p.12
  • Testing trading strategies with Quantopian Introduction - Python Programming for Finance p.13
  • Placing a trade order with Quantopian - Python Programming for Finance p.14
  • Scheduling a function on Quantopian - Python Programming for Finance p.15
  • Quantopian Research Introduction - Python Programming for Finance p.16
  • Quantopian Pipeline - Python Programming for Finance p.17
  • Alphalens on Quantopian - Python Programming for Finance p.18
  • Back testing our Alpha Factor on Quantopian - Python Programming for Finance p.19
  • Analyzing Quantopian strategy back test results with Pyfolio - Python Programming for Finance p.20
  • Strategizing - Python Programming for Finance p.21
  • Finding more Alpha Factors - Python Programming for Finance p.22
  • Combining Alpha Factors - Python Programming for Finance p.23
  • Portfolio Optimization - Python Programming for Finance p.24
  • Zipline Local Installation for backtesting - Python Programming for Finance p.25
  • Zipline backtest visualization - Python Programming for Finance p.26
  • Custom Data with Zipline Local - Python Programming for Finance p.27
  • Custom Markets Trading Calendar with Zipline (Bitcoin/cryptocurrency example) - Python Programming for Finance p.28