:: Subscribe to our newsletter
Articles / Directory
Latest version of TraderCode(v5.6) includes new Technical Analysis indicators, Point-and-Figure Charting and Strategy Backtesting.

Latest version of NeuralCode(v1.3) for
Neural Networks Trading.

ConnectCode Barcode Font Pack - enables barcodes in office applications and includes an add-in for Excel that supports mass generation of barcodes.

InvestmentCode, a comprehensive suite of
Financial calculators and models for Excel is now available.

Launch of
Free Investment and Financial Calculator for Excel.

Release of
SparkCode Professional - add-in for creating Dashboards in Excel with sparklines

ConnectCode Duplicate Remover - a powerful add-in for finding and removing duplicates entries in Excel

Launch of
TinyGraphs - open source add-in for creating sparklines and tiny charts in Excel.

True Range

If in a new trading day, a stock start it's trading at a higher or lower price than the previous day's closing price, then a gap is said to have occurred. Welles Wilder feels that this gap needs to be taken into account when measuring fluctuations.

The True Range of a stock price (as defined by Wilder) will need to take into account the gaps. He thus suggests True Range to be calculated as the Greatest number among the following values:

· Difference between the current High and the current Low
· Absolute difference between the current High with the previous Close
· Absolute difference between the current Low with the previous Close

Open the Wilders.xls file, launch the Visual Basic Editor, and key in the following into Module1.

Function TrueRange(ByVal high As Double, ByVal low As Double, ByVal previousclose As Double) As Double
Dim returnValue As Double
diffHighLow1 = Math.Abs(high - low)
diffHighLow2 = Math.Abs(high - previousclose)
diffHighLow3 = Math.Abs(previousclose - low)
If (diffHighLow1 > diffHighLow2) Then
returnValue = diffHighLow1
returnValue = diffHighLow2
End If
If (diffHighLow3 > returnValue) Then
returnValue = diffHighLow3
End If
TrueRange = returnValue
End Function

Click on the Cell M3.
Key in “=TrueRange(C3,D3,E2)”.
Drag this cell downwards to the end of the Stock Prices.
Click on Cell M1 and type in “Wilder’s True Range”

If you chart the Wilder’s Moving Average and Wilder’s True Range, the following is what you will be getting.

Average True Range

The Average True Range is calculated as the average of the True Ranges using Wilder's method of moving average. The Average True Range is not used to predict prices but for determining the daily activity level of a stock. Low Average True Range indicates a stock is trading within narrow ranges without much swing while High Average True Range indicates period with sharp swings of prices.

Click on the Cell N3.

Key in “=TrueRange(C3,D3,E2)”. We initialize the first True Range to be our first Average True Range. Some technical analysts will initialize the first value with a 14 Day Simple Moving Average of the True Range.

Click on the Cell N4.

Type in “=ROUND((N3*13+M4)/14,2)”.

Drag this cell downwards to the end of the Stock Prices.

Click on Cell N1 and type in “Wilder’s Average True Range”

You can proceed to chart out the Average True Range versus the True Range.
Back to Automated Stock Trading Main Page


Copyright (c) 2007-2015, ConnectCode Pte Ltd. All Rights Reserved.

Trademark Acknowledgements

Microsoft and Microsoft Excel are registered trademarks of Microsoft Corporation. Avery is the trademark of Avery Dennison Corporation. All other product names are trademarks, registered trademarks, or service marks of their respective owners