Algorithmic Trading with Technical Indicators in R

Chris Kuo/Dr. Dataman
Analytics Vidhya
Published in
12 min readSep 11, 2020

--

Feature engineering is one of the fun, creative, and essential steps in machine learning. It transforms raw data into a form of very meaningful information for a model to forecast the future. The predictability of a model relies on good features, which in turn relies on your domain knowledge.

Many experienced stock market traders who evaluate trading rules or charts have already engaged in some form of feature engineering — whether they realized it or not. For example, a moving average is a feature that characterizes the movement of a stock price. All the technical indicators (RSI, MACD, stochastic oscillators, Bollinger Bands, etc.) are some forms of features too. These features can be fed into a machine learning model, or used as trading signals. There can be hundreds, if not thousands, of trading strategies to capture market anomalies or predict future trends.

In this post I will walk you gently to build your algorithmic trading code in R. R has several powerful quantitative finance libraries because of its long development history including quantmod, TTR, and PerformanceAnalytics. If you are new to algorithmic trading, you will be ready to start your algorithmic trading. You can download the code from this GitHub.

Time Series Articles

--

--