Range Based Look Back Technique

By Lawrence

stockxpertcom_id17033201_jpg_7f097fa818d5f6e25b8921070b4f7527Indicator traders and trading system designers often use stock indicators from their trading platforms to construct their trading engagement methods and trading models. There are two problems when approaching the markets this way. First, you are using tools created by others that may have hidden issues. Specifically, it may not fit your risk profile while you have no idea it is the case. Second, the standard indicators are mostly designed with fixed look back period which does not truly represent the changing environment of the market you are trading.

Interestingly, the solution to improve the reliability of these indicators also solves the issue of assuming excessive risk with standard indicators.

Problem With Indicators Having Fixed Look Back Period

As a trader, price is the ultimate factor we have to deal with. After all, price dictates the amount of money we can commit to a position, the profits and the losses. Hence the absolute measure of price movement, the range coverage, is of great importance.

To make the point easier to understand, let’s think of the moving averages you use. Classic approach is to apply multiple moving averages to the market and try to study if there exists certain patterns among the indicators. The problem with the concept is that you may be able to derive patterns that have a positive expectancy but you may not be able to fully utilize them.

How so?

One good example of these moving average based setups is a pullback. You may have a pullback to your favourite moving average, yet the longer term moving average is far away from the price and your favourite moving average. Until you can refine your rules based on various scenarios of the moving average combinations to account for the changing risk relatively to the distance from the far away moving averages, the pullback rarely turn a profit by itself.

The problem here is that the moving averages are not responding to what has happened in the market. They are a time-based statistical sampling of the data series using your fixed period as input. Since the data series themselves are time based summary statistics (i.e. open, high, low and close of a bar) already, the artificially imposed look back period for these indicators do not really produce extra information from the data series.

In other words, when the market is moving at the pace the moving averages represent, you get a good read of the market condition. When the market is moving at a pace not represented by the moving averages, your reading of the market based on the moving averages are just constructs from your imagination, no matter how you twist the rules you use on the patterns.

Turn The Indicators Meaningful By Holding The Volatility Constant

How do we correct this incompatibility of what the market is doing vs. what your indicators are telling you then?

You can change your overall view of the market through the lens of controlled volatility. By using dynamically adjusted look back period on all the indicators you use, you can solve this problem quite easily.

Think of the classic 20, 50 and 100 period moving average combination. These moving averages are known to be lagging indicators. The reason is that they have to play catch up from time to time with the price when a market moves quickly.

Instead of using fixed look back periods, if these moving averages are controlled by the range coverage, the lagging issue will be taken care of automatically.

Now, imagine you are using moving averages that are based on 5 points, 10 points and 25 points range of the underlying data series. These moving averages are meaningful. They represent the averages at the designated volatility you have chosen. You have a filtered view of the market with meaningful indicator values.

As a summary, using fixed look back period on an indicator on time based charts is taking random samples from the market based on an arbitrary number you have chosen. Using a fixed volatility to determine the look back period on an indicator, you partitioned the data through a different dimension to unveil more information from the data.

Better Than Classic Adaptive Approach

This approach of range driven look back period on indicators is not the same as the old adaptive approach.

Adaptive indicators tend to focus on weight adjustment of the inductive step in indicator calculation. That is similar to the standard deviation calculation which has less information provided to the user in comparison to the mean deviation which gives you a fresh look of the data series on every bar within the moving window.

You can think of this range driven look back technique as an upgrade to the old adaptive approach. The old adaptive approach focuses too much on driving the indicators more sensitive to the price movements. This makes them more prone to optimization abuse.

The range driven look back approach focuses on finding meaningful information from the data first (i.e. theoretical correctness) at volatility levels you are comfortable with (i.e. controlled risk). By having this better technical framework, you will get better consistencies in developing functional trading setups and signals.

Alternative To Range Bar

Range bars is one of the better approaches to put a data series under control for obtaining better indicator readings. Comparing to range bars, the range based look back technique has the advantage of:

  • keeping the time element intact which is very useful when price pattern can be integrated much more easily
  • sampling at the natural closing price levels where we know already how important they are from STOPD
  • easily to work with as we human need to anchor our pace by time

I am not saying range bars are not good. In fact they are great tools for mechanical trading due to their ability to produce clean signals in very high resolution charts. I’ll say discretionary traders are better off using the range based look back approach than range bars just because of the last reason stated above.

Range To Period Algorithm

The algorithm is very simple. You just need to find the minimum number of bars necessary to produce the range you specified. That will be the number used as input to your indicators – moving average, n bars highest high or mean deviation calculations. This value can change quickly from bar to bar depending on how fast the market is moving.

Following is an example of range2period calculation using 10 point range with minimum look back set to 10 and maximum look back set to 30.


When the market is moving in tight range, the look back period will expand to the maximum.

As the market enters high volatility periods, the look back period drops quickly.

When Applied To Moving Average

Following is the same chart with 20 period simple moving average (red line) and using the range to look back results above as input to the dynamic simple moving average (blue line).


Notice how lagging the red line is and how responsive the blue line is.

When Applied To Deviation

I have already shown the dynamic mean deviation comparison in its own article. Here is the chart with the moving averages showing at the same time.


As stated in the other article, what the dynamic mean deviation based on 10 points range (red line) does in the chart is the quick reduction of volatility readings and no overshoot after volatility dies down.


Range based look back period technique is a great framework for any traders who prefer using indicators over chart patterns. This technique overcomes many weaknesses in existing indicators. It also promotes better risk control as volatility constraint is embedded into the indicators in the first place. This leads to less dependency on using optimization to figure out money management criteria.

The algorithm suggested in this article can be replaced with other volatility measures to get the desired responsiveness in look back period changes. It will be a very good exercise for the readers to test out similar concepts to see how that will affect the indicators dynamically.



Free indicators and trading strategies can be downloaded from our software store.


  • MidKnight February 24, 2014 at 7:48 pm

    Thanks for this article, I never ever considered this! I’ll share my code in the forum for the “other” platform.

    With kind regards,

    • Lawrence Chan February 25, 2014 at 10:36 am

      Sounds good!

    • Han777 January 19, 2017 at 11:44 pm

      Thanks MIdknight. Where did you post your code and what search terms would find it? Is your code for Ninjatrader

  • You must be logged in to comment. Log in