Using Interpretable Machine Learning to Develop Trading Algorithms – DataDrivenInvestor

11 min read

One problem with many powerful machine learning algorithms is their uninterpretable nature. Algorithms such as neural networks and their many varieties take numbers in and spit numbers out while their inner workings, especially for sufficiently large networks, are impossible to understand. Because of this, its difficult to determine exactly what the algorithms have learned. This non-interpretability loses key information about the structure of the data such as variable importance and variable interactions.

However, other machine learning (ML) algorithms dont suffer these drawbacks. For example, decision trees, linear regression, and general linear regression provide interpretable models with still-powerful predictive capabilities (albeit typically less powerful than more complex models). This post will use a handful of technical indicators as input vectors for this type of ML algorithm to predict buy and sell signals determined by asset returns. The trained models will then be analyzed to determine the importance of the input variables, leading to an understanding of the trading decisions.

For simplicity, indicators readily available from FMPs data API will be used. If replicating, other indicators can easily be added to the dataset and integrated into the model to allow more complex trading decisions.

For demonstration, the indicators used as input to the ML models will be those readily available from FMPs API. A list of these indicators is below.

An n-period simple moving average (SMA) is an arithmetic moving average calculated using the n most recent data points.

FMP Endpoint:

https://financialmodelingprep.com/api/v3/technical_indicator/5min/AAPL?type=sma&period=10

The exponential moving average (EMA), is similar to the SMA but smooths the raw data by applying higher weights to more recent data points.

where S is a smoothing factor, typically 2, and V_t is the value of the dataset at the current time.

Continued here:
Using Interpretable Machine Learning to Develop Trading Algorithms - DataDrivenInvestor

Related Posts

Comments are closed.