Machine Learning Logistic Regression to emulate traders’ behaviour

Domenico D'Errico
3 min readJan 19, 2024

--

Binary Classification Problem

In the dynamic world of financial markets, the ability to recognize patterns and make informed predictions is paramount. Traders and analysts often turn to machine learning to gain an edge, and among the diverse algorithms available, logistic regression stands out as a reliable and efficient tool for pattern recognition in trading.

Understanding Logistic Regression

At its core, logistic regression is a statistical method used for binary classification. In the context of trading, this means predicting whether a specific event will occur or not.

Interpretable and Transparent

One key advantage of logistic regression is its interpretability. The model provides clear insights into the impact of each input variable on the outcome. Traders can easily grasp how changes in market variables influence the probability of a certain event happening. This transparency is crucial in the high-stakes environment of trading, where understanding the rationale behind predictions is as important as the predictions themselves.

Efficiency and Simplicity

Logistic regression is computationally efficient and particularly effective when dealing with smaller datasets. Its simplicity makes it a suitable choice for pattern recognition, especially in situations where a linear decision boundary adequately captures the underlying relationships in the data.

Logistic Regression in Trading Applications

Logistic regression models adjusts the contribution of each feature to the final prediction by assigning weights making the process very similar to what happen in the trader’s mind.

Senior traders look at charts trying to recognize uncompleted patterns, in order to place a trade before their completion. In their mind they evaluate historical price formations (or features) and in an intuitively way, they weight them to come up with a final decision: to go long or short (with a given probability). They generally intuitively assign a probability for each trade to take the target, so they decide accordingly, sometime increasing sizes when the probability of success is higher, sometimes just deciding to not trade if the probability of success is low.

Machine learning guidelines

In order for Machine Learning models to emulate traders behaviors, the data scientists efforts need to convert to :

- focusing on binary classification such as
- using supervised learning approach by labelling any features
- engineering a few features from price/volumes combinations
- using Logistic Regression models

Related articles:

--

--

Domenico D'Errico

Quant developer for professional traders. Actually researching in Machine Learning applied to Technical Trading. For info write to: domderrico@gmail.com