Loading...

Plus+ Python

Short Term "Momentum Pinball" Trading Strategy Code & Results in Python

Short Term "Momentum Pinball" Trading Strategy Code & Results in Python


Strategy Description
Another trading strategy detailed in the book "Street Smarts: High Probability Short-Term Trading Strategies" by Laurence A. Connors and Linda Bradford Raschke helps better define the "Taylor Trading Technique" by George Douglass Taylor. "Momentum Pinball" The Momentum Pinball strategy is a trading strategy that combines elements of momentum trading and mean reversion; and helps traders mechanically define whether or not a trading day should be a "buy day" or a "sell day". There is no long term directional significance to this indicator and is used mainly for 1-3 day flips. The strategy is best defined as a momentum strategy because it tracks the relative strength (RSI) of the change in difference of closing prices through time.

Strategy Rules and Conditions
  • Calculate the difference of the change in closing prices each day for the one period rate of change (ROC). This "momentum" is simply the difference between day 1 and day 2 closing price
  • Next calculate a 3 period RSI of this change through time
  • RSI values less than 30 indicate a "buy day"
  • RSI values greater than 70 indicate a "sell day"
  • Entries are placed slightly above the high of the 1st hour of trading of the following day, and stops placed below that first hour (you will need hourly OHLCV data to properly backtest)
  • If profitable at the close of an entry, carry the trade overnight and exit on day 3


  • The Code
    We use the same basic data loading functions as in other Plus+ members scripts in order to load the historical OHLCV data from our site into a Pandas DataFrame. Afterwards we apply the strategy logic and save a CSV file with all data and signals included called "momentumPinball_signals.csv". Of course, every line of code is commented and easily understood, so modify to fit your purpose. Less than 50 lines of total code (including comments). This code does not include entries on the day following (T+1) signal date.

    Plus+ membership required

    Create a Plus+ account to view the live codebase.

    This article has a fully working, notebook-ready code block. Sign up for Plus+ to access it and the rest of the 20+ premium articles.

    Subscribe to Plus+ Browse Plus+ articles