Quantitative Analysis: Price Channels

One of their major strength is their ability to use both price action and volatility. Price bands or channels are trading indicators composed of two lines. The upper line is a sort of resistance line (Area of abundant supply) while the lower line is a sort of support line (Area of strong demand).

Over years, technical analysts have developed several price channel indicators; some of these include the Bollinger bands, Donchian channels, Keltner Channels, Volatility Channels, Standard Error Bands, Adaptive Price Channel and Moving Average Envelopes.

Bollinger Bands

Probably, Bollinger bands is the most popular one. Its middle line is simply a moving average.

By calculating the standard deviation of past prices and adding/subtracting it to the middle line, we can build the upper/lower line of the Bollinger bands.

Bollinger bands indicator is built-in QuantShare. Here is how to reference this indicator in QS language:

Upper Line:

BBandsUpper(20, 2, _masma)

The above line creates the upper band by adding 2 standard deviations to the 20-bar simple moving average.

Lower Line:

BBandsLower(20, 2, _masma)

Donchian Channels

Donchian boundaries are based on high and low of previous N-Periods.

Keltner boundaries are set around a moving average. It is based on the average true range or the high/low range.

Volatility Channels

The volatility channels use the highest and lowest previous values to determine the upper and lower lines.

The indicator can be downloaded here: Volatility Channels Indicator

Upper Line:

VolatilityChannels(20, 0)

Lower Line:

VolatilityChannels(20, 1)

Standard Error Bands

This price channel indicator is based on the alpha and beta coefficients of the linear regression of the past N-prices.

The indicator can be downloaded here: Standard Error Bands

It also requires the following functions: calcA and calcB.

Adaptive Price Channel

The adaptive price channel uses the highest high and lower low values of the price series over a non-fixed lookback period. The lookback period follows changes of the 30-bar standard deviation of the close series.

Quantitative trading analysis using R

Several techniques are available for navigating the financial markets. Technical analysis, which mainly centers on price patterns and trends to project price action, is the basis that most traders use to place trades. And, an example of technical analysis that is growing in popularity is quantitative trading analysis. It refers to a method of trading that employs supercomputer analysis as well as complicated algorithms to hunt out profitable yields in the market. A common tool used in carrying out quantitative trading analysis is the R programming language .

Initially designed by Ross Ihaka and Robert Gentleman at the University of Auckland, R refers to a functional language for statistical computation and graphics. R can be said to be an open source implementation of the S language, which was developed by AT&T, and has been a major milestone in how people interpret financial data. Notably, under the GNU General Public License, R has been made available to the public free of charge and it can be customized easily to reflect the needs of the user. The language can be downloaded at r-project/ and it has versions for various operating systems.

The R programming language has greatly borrowed from the S-Plus language. The syntax of the two languages is considered to be closely related. Some notable features of R include availability of built-in tools for time series, regression etc, collection of intermediate tools for data analysis, efficient data handling capabilities, ease of production of properly-designed publication-quality plots, and enhanced graphing and visualization capacities.

It is important to note that R is a rich and a well-suited language for carrying out quantitative trading analysis in the financial markets. When used properly, it’s a valuable strategy one can use for making decisions on whether to enter or exit the market. And, a common way of using R in quantitative trading is for momentum identification. This technique looks for momentum in financial data, aiming to identify trends or hidden relationships, to forecast price action. The markets usually form trends that last for an extended period of time. Traders using R may employ the strategy with the aim of discovering possible trends in the market.

Quantitative trading analysis using R is not as complicated as it may seem. The infrastructural design for the language has already been done for the user. Therefore, this enables the users to concentrate on what they are trying to achieve instead of focusing on the nitty-gritty of how to realize it. More over, its user-friendliness and price are very essential elements to the investment industry in the current price-conscious world. Lastly, R is designed such that it can be extended for specific uses. Importantly, there is ready assistance from the R community through discussion forums, mailing lists, and other means.

The benefits of R are making an increasing number of traders to start using it for quantitative trading. Most of all, it is loved for its open source nature and the community around it that is dedicated at ensuring the problems of its members are amicably addressed. R has a very big contributor base, which also continues to grow day after day. More so, novel add-on packages are being created on a constant basis to increase the user-experience of its practitioners. As such, the use of R for generating trading signals will continue even in the coming years.

Here is a simple example that can be used for merging two trade series using different securities. Note that this aims to result in a derived time series. And, the spread between the two financial instruments is more than 0.5.

xy .5, "y"]

Although this may be difficult to grasp for those seeing it for the first time, members of the R community undertaking time series analysis see it as bread and butter.

In conclusion, quantitative trading analysis using R is easy to use and it’s a very good method for identifying trade opportunities in the financial markets. R has an extensive supporting community that is always willing to address the problems of its members. More over, using it does not increase expenses in terms of product licensing or proprietary language expertise. R deviates from the complexity of analysis present in the current world of investment. Therefore, it is an innovative tool that makes quantitative analysis easier rather than harder.