Introduction_In this series, I will look to summarise a collection of commonly used technical analysis trading models that will steadily increase in mathematical and computational complexity. Typically, these models are likely to be most effective around fluctuating or periodic instruments, such as forex pairs or commodities, which is what I have backtested them on. The aim behind each of these models is that they should be objective and systematic, i.e., we should be able to translate them into a trading bot that will check some conditions at the start of each time period and make a decision if a buy or sell order should be posted or whether an already open trade should be closed.Please note that not all of these trading models are successful. In fact, a large number of them were unsuccessful. This summaries series has the sole objective of describing the theory behind different types of trading models and is not financial advice as to how you should trade. If you do take some inspiration from these articles, however, and do decide to build a trading bot of your own, make sure that you properly backtest your strategies on both in and out of sample data and also in dummy accounts with live data. I will cover these definitions and my testing strategies in a later article.As already mentioned, this article will cover a summary of a trading model. In a separate series, I will describe exactly how we might go about coding one of these trading bots in MQL4 (the modified C++ language MetaTrader uses for algorithmic trading in the financial markets)._

Breakout models are one of the most commonly used and discussed types of technical strategies because they build a trading methodology on top of the most fundamental technical analysis method, support, and resistance. They ultimately aim to profit off the price breaking through these levels, the theory being once they make that break, they will continue to move in that direction.From an algorithmic trading point of view, it is fairly straightforward to decide when we enter a trade as we only have limited options available, each with its merits and issues. We could instruct a buy market order when the price closes above a resistance level or a sell market order when the price closes below support. In order to avoid false breakouts or fakeouts (when the price closes outside the support or resistance line but then reverses its direction, indicating that a breakout has not actually occurred) which market order might be prone to, we could place stop orders at a certain value below or above our S&R levels so that when we enter, we are sure that we have caught a breakout. The issue with this, naturally, is that we may already have missed a large part of the move by the time we enter the trade. In another scenario, we could wait for a second candle to confirm a breakout before entering the trade, but this gives us the same issue as the stop order method. We could also use a limit order, in which we expect the price to retract slightly back below the level before then continuing in its original direction. From a sentiment point of view, this strategy has some merit. Support and resistance levels are available to all traders, and many institutional ones, such as banks, may place large limit orders at these levels to try and sway a reversal. If a small reversal does happen before the breakout continues, then we benefit ourselves by entering a trade at a more optimal price. There are two obvious issues with this strategy, however. The first is that we hit a strong S&R level, and after bouncing off, the price continues to reverse, at which point we have entered a losing trade. The second is that the amount of traders pushing for a reversal at the level isn’t enough to bring the price back down to our limit level, leaving us with an unactivated limit order and a price traveling in the direction that we could have made a profit from had we entered the trade.The far harder factor in determining in this scenario is establishing support and resistance levels. There are plenty of videos online that teach you how to observe and plot these levels visually. They begin by looking at the longer timeframe charts and moving to the shorter ones, iteratively plotting lines in which the prices appear to touch or come close to on at least 2 separate occasions. This, however, is not a method we can use in algorithmic trading because we want a purely objective method of identifying these levels.

Fig. 2 — The visual method for identifying S&R levels on the EUR/USD daily chart

There are a few ways in which we can do this. We can plot support as the lowest point and resistance as the highest point in the last x bars. Whilst this only entails one “price-touch,” it can be considered a slightly weaker level, suggesting that a breakout is more likely. Dynamic levels can also be employed, with a moving average that we hope the price will breakthrough. A third method is to create upper and lower bands, with Bollinger Bands, for example. In this case, when we see a bar break through one of the bands, we place a trade in the direction of the movement. If we want to specifically try and mimic the traditional visual methods of drawing S&R levels, we could consider some machine learning methods. A clustering algorithm that groups price levels could give us a good indication of where we place our lines (i.e., the x most frequent price clusters are considered key levels).

#trading #commodities-trading

Algorithmic Trading Models — Breakouts
2.25 GEEK