Have you ever been intrigued with how hedge funds build trading strategies using complex technical indicators? How HFT hedge fund managers make volumes of trades by using simple mathematical stock indicators? This article is a great introduction to the world of algorithmic trading, and how to come up with your own simple trading strategy based on historical data.
This is the third post in the application of machine learning in trading series. If you haven’t already, I would recommend checking out the first two posts: Martingale Gambling Strategy and Understanding Tree-Based Learners.
In this article, we will explore multiple technical indicators for time-series stock price data and a theoretically optimal strategy that has been tuned to beat the benchmark strategy. The indicators developed in this project will be used to design an intuition-based and machine learning-based trading strategies in the forthcoming projects. Indicators use price and volume information to provide additional information through mathematical calculations about the current buying or selling potential of a particular stock. There are four major types of indicators: trend, momentum, volume, and volatility.
The technical indicators discussed in this paper are as follows:
The experimentation details, dates and rules have been mentioned below to ensure consistency:
Data:_ Historical stock prices data_
Symbol:_ JPM_
Time Period:_ January 1, 2008 to December 31, 2009_
Starting Cash:_ $100,000_
Allowable Positions:_ 1000 shares long, 1000 shares short, 0 shares._
Benchmark:_ The performance of a portfolio starting with $100,000 cash, investing in 1000 shares of JPM and holding that position._
Transaction Costs:_ Commission: $0.00, Impact: 0.00._
Technical indicators are defined as heuristic or mathematical calculations based on the price and volume (in some cases open interest). As stated in the introduction, there are four types of technical indicators: trend, momentum, volume and volatility. A handful of technical indicators such as Bollinger bands®, relative strength index (RSI), momentum, volatility (z-score) and MACD have been explored in this project that include trend, volatility and momentum-based indicators. In this section, we will be diving in deeper and discussing each technical indicator.
Bollinger Bands® is a technical indicator that is defined1 by a set of lines plotted two standard deviations above and below from a simple moving average (SMA) of the stock price. Bollinger Bands® were developed by John Bollinger. They comprise of three lines: a simple moving average (middle band), an upper band, and a lower band. The upper band and lower bands are typically 2 standard deviations above and below respectively from a 14-day simple moving average.
Upper Band = (Rolling Mean) + (2 * Standard Deviation)
Lower Band = (Rolling Mean) + (2 * Standard Deviation)
BB Value = (Prices — Rolling Mean) / (2 * Standard Deviation)
**Signal: **Standard deviation is a measure of volatility, and hence when the markets become more volatile the bands widen, and vice versa.
Buying position: When the stock price tends to falls below the lower band, it indicates a good buying position. In this case, BB Value is less than 0.
Selling position: When the stock price tends to rise above the upper band, it indicates a good selling position. In this case, BB Value is greater than 1.
#algorithmic-trading #data-science #hedge-funds #money-mindset #towards-data-science #algorithms