TRADERS´ basics 59

Adaptive and Optimised Donchian Channels Monest Channels

Channels are at the heart and soul of , from as early as its conception. However, up to this day, they come with a lot of subjectivity. This implies that it is hard to implement them algorithmically. Yet, computers and automation might have been the single most important driver in the wide spread adoption of the technical analysis discipline. This article will show how to objectify and optimise the calculation of horizontal channels and, hence, the lines they are made up of.

08/2011 www.tradersonline-mag.com TRADERS´ basics 60

Ranges Rock for a resistance line. Figure 1 Ranges are quite important in shows an upper Donchian channel the analysis of charts and the line (resistance) with a look back automation of it. They give birth period of 36 days and a lower to the timecompression needed Donchian channel line (support) for new trends to develop and with a window of 20 days. When for existing trends to turn. Even you go back in time, starting at the the most well known systems right side of the chart, the highest like William O’Neil’s CANSLIM high over the past 36 days was approach, Weinstein’s stage 3.29, while the lowest low over analysis and a lot of trend the past 20 days was 2.26. These following strategies depend lines are annotated on the chart as on them to make decisions D36 and D20. concerning the possible start Perhaps, by now, you already of a trend, phase or stage. noticed the fact that the most Consolidation, also known as recent bar is not included to a base, from where an existing calculate the highest high or the trend continues its run, is another lowest low, because that would example where ranges emerge. mean that our channel lines The detection of ranges is never could be violated, as, for Dirk Van Dycke where horizontal channels come instance, a higher high for the into the picture. One of the oldest current bar than the highest high Dirk Van Dycke is actively and and perhaps most popular ways over the look back period, would F1) Donchian Channels independently studying the of describing horizontal channels implicate that our current high markets since 1995 with a focus is by using the definition provided would be the upper Donchian on technical analysis, market to us by Richard Davoud channel, by definition. Idem ditto dynamics and behavioral finance. Donchian (†). for lower Donchian channel lines. He writes articles on a regular Furthermore, one could basis and develops software Donchian Channels redefine Donchian lines using the partly available at his website Perhaps Donchian’s channels, close. Our D20 from the example, tools.monest.net. Holding master named after himself, are even by this definition, would then degrees in both Electronics Engi- better known as an x-bar become the lowest close over neering and Computer Science, high/low. But they are merely de past 20 bars, while our D36 he teaches software develop- the implementation of the would stand for the highest close ment and statistics at a Belgian mathematical minimum (min) over the past 36 days. University. He’s also an avid and maximum (max) functions. There is really not much to all reader of anything he can get his What these channels stand for, is Donchian Channels are amongst the oldest and most basic channels this. In fact, Donchian channels in technical analysis. They are also known as x-bar high/low channels. hands on. He can be reached at basically the looking back over a are so simple, one might think But they are not completely objectively defined as, in this example, a 36 day upper Donchian Channel can be replaced with a 100 day upper [email protected]. certain period and calculate the there is nothing to add at this Donchian Channel at the same price. lowest low in this interval, for a point. These channels should Source: tools.monest.net support line, or the highest high do be able to help us detect

08/2011 www.tradersonline-mag.com TRADERS´ basics 61 horizontal channels in an fully see they are totally objective in price representing the vertical price already moved substantially longer the maximum Donchian automated way. But they do not. both their definition and their dimension. We need to stop before reaching one of the Channels line gets as we increase implementation, since they do not thinking of horizontal channels channel lines, giving late warning or decrease its height by the Not so Fast need any parameters and they as having only one dimension, as to any outbreak. A too a smallest increment possible (i.e. The truth is, there is a lot of adapt themselves to the context we probably get tricked into this channel is not meaningful as a tick – being most often one subjectivity left with Donchian of price, time and . exactly because of the horizontal the longer a channel gets the cent). So to calculate the upper channels, as with many indicators What are they all about? nature of the separate channel more people come to recognise Monest Channel line we start by in technical analysis. The Looking at Figure 1 again, you lines. A horizontal line may not it and use it and thus the more measuring the length that prices question hereby arises what the can see that D36 is the same line have a height in itself, it sure has meaningful it becomes as an stay lower or equal to our most look-back-period should be. Do as D100. What this means is that a vertical coordinate on a chart, analysis instrument. So, how can recent close. Next we calculate we take a 50 bar high or a 60 bar our highest high over the past 36 which makes for a width of the we have both maximum length the same length for a price one high? Answering this question days, happens to and minimum width, or, cent higher. The extra length based on back test results, be the same highest as that is not possible, we get is the first derivative at imposes the danger of curve- high over the past a optimal trade-off? those price levels. It basically fitting on your system. 37 days. But also This sounds a lot more comes down to how much bars Secondly, they are static, the same highest Implementation our channel line gets longer if we meaning they do not account for high over the past complex than it really is. The answer to this widen our channel with one cent any context adaption, such as 38 days. In fact, we question is given to us to the upside. The same goes absolute versus relative prices have to go back, up by classic high school for the lower Monest Channel or, to a lesser degree, volatility. to a 100 days, before we find yet channel as the difference between math to solve max/min problems line while decrementing each A channel that is $10 in width in a new higher high. So if we would the heights of both channel lines through the use of derivatives. time with one cent. By doing a $10 stock has not the same have arbitrarily chosen a look the channel is made up of. There is one problem though, this incrementally for every cent, importance as the same $10 back period of 36 or higher but Secondly there are opposing we do not know the function we can get the optimum as the channel in an $100 stock. Even if anywhere less than 100, we would forces at work, since the wider describing a price chart and, as biggest increase in length we you would think about expressing not have optimal usage of our we make a channel, i.e. the range a consequence, neither do we gain for any cent we widened the channel-width in percentage channels when interpreting them of historical prices it captures, the know the functional description channel line during the iteration. to stock price, this would not without a chart. For a 36 day look longer its channel lines will get. of the relationship between width Figure 2 shows the length we account for volatility. Defining back period we could have gotten Look at it this way; if you expand and height of any channels. can go back without encountering width in terms of volatility (like an extra 64 days in length, without the lines enough, eventually all We will probably never know. prices for each distance form the ATR units) would be far better. widening the channels. historical prices will lie between Luckily, there is a simple trick last close. So on the x-axis is the Still, the issue about adaptivity So let us go over this again them. Length and width of any to circumvent this problem as distance form the latest close. and subjectivity stands, because for a moment as we outline a channel are, as a matter of fact, we can use discrete derivatives. The y-axis gives us the length at of the look back period that has few important thoughts. First functional interdependent of Now, don‘t you stop reading. This that distance. Both Monest bands to be chosen arbitrarily and up of all, we need to stop focusing each other. Length is inversely sounds a lot more complex than are shown in the same figure for front. So which look back period merely on the look back window reciprocal to width. it really is. convenience but have nothing to would you choose? of Donchian Channel lines, Of course for a channel to be The first derivative of a function do with each other. which only accounts for the useful it cannot be too wide. On gives us the speed at which The same goes for the lower Monest Channels horizontal dimension. Instead the other hand the longer it gets that function is ascending or Monest Channel line while Meet Monest Channels, relieving we should calculate the largest the stronger a breakout signal descending. Translated to our decrementing each time with one us from the disadvantages of possible Donchian Channel may be. A too wide a channel price charts, this simply means cent. By doing this incrementally Donchian Channels. As you will line in length for a given price, might not be as useful, since we are going to look at how much for every cent, we can get the

08/2011 www.tradersonline-mag.com TRADERS´ basics 62 optimum as the biggest increase implement and freely available at are not concerned with length, F2) Optimal Donchian Channels in length we gain for any cent we tools.monest.net where you not nor width, in isolation. We are widened the channel line during only can visualise them on charts mainly interested in their balance. the iteration. for most American and European That is why the scanner lets Let us go back to our example stocks. It is also possible to scan you specify both dimensions from Figure 1, as Figure 2 charts over the whole stock universe without discarding the relevance this gain in length for every in a myriad of ways, looking to the other, thereby using the increase in width by one cent. for Monest Channel based on advantage of every ‘free’ length What this chart is telling us, is how their length, width, strength and that arbitrarily chosen Donchian much longer the Monest Channels breakouts. You can even make Channel would ride past. become at every distance in price use of almost all other classic from the last close. technical analysis tools, while Conclusion Look at the chart. You will searching. Monest Channels free us of see that the length of the upper Monest Channels’ first any parameters left to the Monest Channel line (annotated application is, of course, the If we look for the maximum Donchian Channel length we can get at discretion of the trader. They every price offset from the close of the most recent bar, we can spot as UMC), jumps from 32 days to detection of bases or ranges take in consideration both the largest increase in length. That is the place where we can find the optimal balance between width and length of the Monest Channels. 101 days if we increase its height from where consolidated trends length and width of the channel, So on the x-axis is the distance form the latest close. The y-axis gives from 11 cents to 12 cents above can lift off again or from where thus optimising the balance us the length at that distance. Both Monest bands are shown in the same figure for convenience but have nothing to do with each other. the last close. Since the last close new trends can arise. The between both dimensions. Source: Custom Excel was 3.04, this means pulling up channels provide also one more Their inception creates the the channel line from 3.15 to 3.16 way traders can place stops possibility to automatically and increasing it by 69 days in length. systematically as the channels, objectively detect the same The biggest increase we get for a by the specifics of their definition, horizontal channels and support F3) Monest Channels one cent increase in height. will coincide with swing points and resistance lines traders in The lower Monest Channel line and find significant intermediate different timeframes are drawn to, is shown as LMC. This optimum tops and bottoms. as time compression reaches a is found the same way. Lowering A careful reader might argue climax, leading to a breakout. Of the channel line from 1.94 to there is still the question of how course every chart will have his 1.93 gets us the largest increase far one must go back searching upper and lower Monest Band. in length, going from 79 to 106 the maximum gain in length for In a secure trend this will lead days, an increase of 27 days. If an additional increase in width to one of the bands being quite we look further, the LMC length by one cent. In math theory the lengthy while the other being very goes of the chart if we lower it to answer would be to go as far short. Though this might seem a 1.54, increasing the length with as possible. In our context, this disadvantage at first it can lead 254 days for a total of 361 days. would be as far as historical to the detection of trends. Further This kind of increase indicates a data is available. However research, nevertheless, will have very important low, in this case Pickup of the chart setup in Figure 1, now with Monest Channels from a practical standpoint the to point this out. added. In this implementation the channels use the highest close even the all time low. implementation on tools.monest. for the upper Monest Channel line and the lowest close for the lower net cuts of its search as soon Monest Channel line. Usage as channel lines drift away more Source: tools.monest.net Monest Channels are easy to than 20% from the last close. We

08/2011 www.tradersonline-mag.com