|
|
NEWS |
|
|
|
|
Resident trader How to profit from volatility - part 2 Will Kraa, October 22, 2007
 Please note that neither CompareShares nor the author holds any interest in, nor derives any benefit from the software provider mentioned in this article, AmiBroker.
Last week we looked at volatility and how calculations based on volatility can be used to give signals to warn of a change in trend. I mentioned that charting software can be used to calculate and display an indicator that is based on the Average True Range (ATR) and that is displayed below prices in an uptrend to save having to do this manually. This indicator would need to follow prices up but when the price reaches a high and then begins to trend down the indicator line must not follow prices down.
This indicator is calculated by subtracting a multiple of the ATR(10) from the price and therefore is suspended below it. Accordingly it is called a ‘Chandelier’ exit indicator.
Before going into more detail about this indicator there is another concept that is important to develop. If this indicator can signal that an uptrend is most likely over then it might, by the same reasoning, also give a signal that an uptrend is likely to be starting. To understand that we will retrace the reasoning for using it as an indication that a trend is over.
When the price of a share is trending up there are daily (or weekly) more or less random price movements up and down which are normal in any trend. It is only when the price moves well away from these normal fluctuations that we decide that this could be a sign that the uptrend may now be changing direction. We do this by multiplying the ATR(10) by a factor (2 to 3.5 usually) and subtracting it from the price.
Now let us reverse the whole procedure. The price is now in a downtrend and instead of calculating the volatility indicator below the price we calculate it above the price. This would mean that, after multiplying the ATR(10) value by a factor of 2 or more, we would add (not subtract) it to the closing price during a downtrend. This would make a line above the price action and we would consider that when the price crosses above the line the downtrend is likely to be over.
If the downtrend is finished it is now likely that an uptrend may be beginning and that of course might be a good time to buy! It makes sense to consider that if the line plotted below the price in an uptrend is a sell signal (when the price crosses below it) then when the opposite happens it should be a buy signal.
So have a look at the first chart of CTX back in November 2004. I have placed a vertical line at the lowest close in the month. As you can see the price has been in a downtrend and then reverses direction. Of course in hindsight it is easy to see where the lowest price is but at the time it would have been impossible to tell.

On this chart the lowest close is at $8.13 (values at the top of the chart) and on that day the ATR(10) has a value of $0.24. Adding 2ATR(10) to the price works out to be $8.13 + (2 x $.024) = $8.61 and the first red line on the chart is at that price. We can see that prices start to rise from the low and a few days later the closing price is above the line, giving the signal to buy. We can buy on the next day at the open at $8.67.
After a few days of sideways movement the new uptrend starts in earnest and it turns out to be a very good trade. Prices rise strongly and a high is made on the day marked by the red arrow. On that day the close is $11.10 and the ATR(10) is $0.27. Seeing this is now an uptrend we need to calculate a line below the price to give an exit signal and this works out at $11.10 – (2 x $0.27) = $10.56. After this high prices go down enough to fall to just below the line a few days into the new year.
The next day the price opens above the line and we have the option to stay with the trade or to take advantage of the higher price to make a better exit. Of course with hindsight we would say it is better to stay with the trade as prices go higher again. In fact the uptrend is by no means over and it is evident that the line we calculate is not perfect in signalling the turning point in trends. It may even be useful to exercise some discretion in the use of this line in cases like this.
There are things we can do to help in lessening the chances of getting false signals such as this one but for now we will concentrate on working on the concept of this indicator and the best way of displaying it. It is tedious and unnecessary to calculate this line manually as we have been doing so far.
What is needed is a formula that will enable the charting software to calculate a line which is below the price in an uptrend and above the price in a downtrend. This would mean that the line would ‘flip’ whenever the price crosses it. The formula needs to calculate the value of the ATR multiplied by a factor and in an uptrend keep it below the price candles and in a downtrend keep it above. When prices stop trending the line needs to stay horizontal until the closing price crosses the line.
It would also be necessary to be able to adjust the parameters of the formula such as the multiplier factor. We would then have a very simple component of a system where one line gives both buy and sell signals.
We do not need to wait till someone devises such a thing as it already exists. In fact I heard a sales promotion the other day where someone showed charts with an indicator which did this. The problem was that the formula was a proprietary one and to get it you would have to buy expensive software, subscribe to their data (which was the only sort you could use for it) and pay yearly subscriptions just to use this indicator.
Fortunately there is an easier and very much cheaper way to obtain it. I have been using it for years in AmiBroker, my favourite charting software, available for an extremely reasonable once only payment. (And don’t worry, I don’t sell it and get no reward or payment for promoting it.) There is a plugin written for AmiBroker which enables this indicator to be plotted. It was written by Geoff Mulhall and he kindly placed it on the AB website from which it can be downloaded. At the end of this article I will give the instructions for finding and using it and the formula that is used with it. To find out more about AmiBroker and how to get it refer to my AmiBroker article on this site.
The second chart shows the indicator on the same CTX chart. It is very easy to see where it shows the change from downtrend to uptrend (which is the buy signal) and just as easy to see the exit signal. The buy signal in this case was a very good one but the trend soon resumes after the sell signal. Things are rarely as simple as just having one indicator which tells you when to buy and sell and it will be necessary to have other criteria to confirm the signals. In the next article we will devote some time to that.

This trade is still quite a profitable one. The buy after the first arrow (at the opening next day) at $8.65 and the exit at $10.64 the day after the second arrow would have given a profit of $1.99 per share or 23% in two months. By using CFDs it would have been much better again because of the leverage. Even though using this indicator by itself gets you out of the trade before the trend is finished there is another entry signal given a few days later for another profitable trade.
It should also be noted that this indicator does not get you in and out of the trade at the very top and bottom. I have been in meetings (years ago) where someone flogging a trading system (at a very high price) would point to a chart and suggest how much money could be made by buying at the lows and selling at the highs but of course the reality is that it is not possible to do that except by pure and remote chance.
The fact is that the nearer we try to get to doing that the more we will be whipsawed in and out of trades and the happier the broker will be. It is part of devising a good trading system to determine the settings of this indicator which will provide the best compromise between either giving back too much profit near the end of a trade or having profits cut by false signals.
Some readers may have noted by now that there is another possible use for this rather versatile indicator. Trading the market these days does not necessarily mean buying something and then selling it.
If you go to your favourite whitegoods store and buy a refrigerator for instance it is not likely that you will get the one on display. In fact you probably want a brand new one that is in a box and has not been on display. So the salesperson does the paperwork, you pay for the fridge and a delivery time is arranged. Now the shop gets to work and orders a fridge. They are short one fridge which they have sold to you at a price and now they go to the distributor and buy one at a lower price to deliver to you. So they sell first and then buy and the difference is their profit.
It would be great if you could do the same in trading and in fact you can. Especially with CFDs for many shares it is easy to sell first (go short) and then buy them back later at (you hope) a cheaper price. You must know what you are doing so don’t try it unless you have a good system to use for this kind of trading.
This is where this indicator comes in handy. It gives sell signals which, under the right conditions, can be used to initiate a short trade. While the share is in a downtrend it stays above the price action to provide an exit signal for a short trade. You can see how it ‘flips’ when the signals are given. But keep in mind that there are more things to consider other than just using this indicator for short trades.
Now that we have the indicator and understand how and why it works we will be able to devote some time to finding how it may be used for best results. We can do that in the next article to work towards an example of a flexible trading system which can be adapted to be used in a variety of trading plans.
Note for those who already use, or would like to try out AmiBroker
If you have bought AmiBroker the instructions below will help you to install and use this indicator. If you just want to try AmiBroker you can download it and follow the same instructions. All the necessary parts are found in the public part of the AmiBroker website.
Instructions
To install the Chandelier indicator to AmiBroker follow these instructions:
Go to: http://www.amibroker.org/3rdparty/
and click on Chandelier.zip, click on save and save it where you can readily find it. To install it, unzip it, make sure to shut down AmiBroker and Copy the file ‘Chandelier.dll’ to C:\Program Files\AmiBroker\Plugins.
Restart AmiBroker and click OK for the warning message to say that a new plugin has been installed.
Now go to: http://www.amibroker.com/library/list.php
Scroll down to ‘Chandelier Plugin’ (a fair way down) and click on ‘Details’ on the right hand side. Read the Details and Description and go down to Formula and highlight and copy what is there. Make sure you highlight all the text etc. between ‘Formula’ and ‘Comments’ before copying it.
Now open AmiBroker and click on ‘Formula editor’ and paste the formula you just copied. Click on File>Save As and in the drop down box at the top of the ‘Save As’ window navigate to C:\Program Files\AmiBroker\Formulas\Custom. Save the formula as ‘Chandelier.afl’.
In Amibroker find a sheet which has stuff on it you don’t really use and if (as by default) there are two panes on the sheet, right click on one of them and go down to ‘Panes’ and click ‘Close’.
Click on the ‘Charts’ tab in the workspace on the left and click on the + beside ‘Custom’. Go to ‘Chandelier’ and right click on it and click ‘Insert’.
You should now have a new pane with the Chandelier chart. You can close the other pane if not needed and right click on the Sheet Tab at the bottom and rename the sheet ‘Chandelier’ so it is easy to find.
If you have any trouble go to the ‘Your 2 cents’ message board on this site and ask for help. I can try to help with any problems you might have with AmiBroker if you post your questions on the message board.
More articles from this week's CompareShares newsletter:
Analysis: Market crash signals Markets: Local market to drop on memories of '87 Stock picks for the long haul: Mineral Resources (MIN) and The MAC Services Group (MSL) Election: Who should win on November 24? Smart Investing: Rewind 1987: the lessons 20 years on Markets: US market plunges on crash anniversary Resident Trader: How to profit from volatility - part 2 Trading: Learn from the Barings Bank rogue trader's mistakes Stock of the week: Malachite Resources NL Expert Panel: Trading international shares using CFDs Commodities: Raging oil bull feeds euphoria Superannuation: Buying your dream home in your DIY fund Expert Panel: Why buy an instalment warrant instead of a share
Whatever your views, you can discuss this article - or any of Will's articles - on our message board Your 2 Cents. Email to a friend
Print this article
|
|