# 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.

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.