Creating an Algorithmic Trading Strategy Using Python and Logistic Regression

An automated machine learning strategy to determine the optimal stocks for algorithmic trading.

Cameron Shadmehry
Hands-Off Investing

--

With the increasing popularity of machine learning, many traders are looking for ways in which they can “teach” a computer to trade for them. This process is called algorithmic trading (sometimes called algo-trading).

Algorithmic trading is a hands off strategy for buying and selling stocks that leverages technical indicators instead of human intuition.

In order to implement an algorithmic trading strategy though, you have to narrow down a list of stocks you want to analyze. This walk-through provides an automated process (using python and logistic regression) for determining the best stocks to algo-trade.

I will dive deeper into the logic and code below, but here is a high-level overview of the process:

  1. Import the historical data of every stock using yahoo finance.
  2. Pull in over 32 technical indicators for each stock using the technical analysis library.
  3. Perform a logistic regression on each stock using 5, 30, and 60…

--

--