Combining Technical Indicators and Machine Learning for Trading
Summary
The document explores how to build a trading system from traditional chart patterns and machine learning. It raises choices about classification targets, whether patterns should be labels or inputs, and whether a model can identify patterns directly from price data. The response describes an example support vector machine trained on changes in technical indicators to classify the next hour’s trend, using buy, hold, and sell labels.
For a trading application, the answer favors action labels over a forced trade each period, since frequent turnover can accumulate fees. It cautions that neural networks will not reliably recognize named formations without suitable context and labeled examples, and suggests image-based training when explicit pattern recognition is the goal. These are recommendations and an individual thesis example, not comparative evidence that one target design or model will work better. The document gives no backtest results or guidance on validation, execution, or controlling overfitting.
Key ideas
- Classification targets can represent buy, hold, and sell decisions rather than only price direction.
- A support vector machine example uses changes in technical indicators to classify a short-horizon trend.
- Reducing unnecessary trades may help limit the impact of transaction fees.
- Recognizing named chart formations requires suitable labeled context, such as image-based training.
- The recommendations are not supported by comparative backtest results in the document.
Tags
Full text
# How can I combine traditional trading patterns and machine learning algorithms to produce a trading system? # How can I combine traditional trading patterns and machine learning algorithms to produce a trading system? Traditionally, retail traders have leveraged on price patterns discovered by applying graphical tools such as flags, fractals, pennants, heads, shoulders, etc. However, while this method has been very profitable for many, it is often based on the individual's capability of empirically detecting/visualizing trends. Nowadays, machine learning and neural networks are perfect tools for pattern recognition. Coming to the question. Assuming one wants to trade price patters and is knowledgeable of machine learning and other statistical concepts. - How should the dependent variable of a classification algorithm be defined? Is it better to use a simple 0/1 (down/up price) or to use the traditional patterns as the dependent variables? - Alternatively, are the price patterns to be used as independent variables? Or are the machine learning and neural network models able to recognize patterns without levering on the empirically available pattern rules such as flags, pennants, etc., rather by using other predictors? Would be really nice to hear someone's opinion. ## Answer by Hamish Gibson (score 1, accepted) https://quant.stackexchange.com/a/53914 So I'll start with what I have done recently for my undergraduate thesis before relating it to your question. I trained a SVM on Technical Analysis data to classify the trend for the next hour. Unlike your strategy, I did not train the model with/for visual inspection of price patterns etc, but rather trained the model on the rate of change of several dozen technical analysis indicators. Now the labels that I chose for mine were `[1,0,01] (Buy/Hold/Sell)`. I chose this because these decisions are often what TA indicators themselves prescribe (Buy if fast signal line above slow line, hold, sell when fast line dips below slow line etc). $1.)$ For your case, I would recommend developing a strategy that trades on a `buy/sell/hold` basis. Otherwise, your system is conducting a transaction every time period $t$, the accumulation of fees would whittle away any remedial gains. $2.)$ NN would not be able to simply 'pick up' the flags, trend lines, triangular convergences etc on their own. It needs the context of price action mapped to appropriate labels to contextualise these pattern detections. I would use some image recognition based training so that a model could classify a 'head and shoulders' type pattern etc. Then it is obviously down to you how to prompt the model to trade on its discretion. I hope this answer helps. I'll be available in the comment section to discuss further if you need to.
Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.