Watch how to download trading robots for free

Interesting script?
So post a link to it -
let others appraise it

You liked the script? Try it in the MetaTrader 5 terminal


Alb stochastic - indicator for MetaTrader 5

Mladen Rakic

votes: 9
2018.09.08 19:16

A version of stochastic that is using adaptive (variable) periods for calculation instead of using fixed length average calculation. This version is using adaptive lookback method

Of adaptive lookback

The Adaptive lookback is truly a market-driven indicator used to determine the variable lookback period for many different indicators, instead of a traditional, fixed figure.

It is based on the frequency of market swings - the time between swing highs or swing lows. A swing high is defined as two consecutive higher highs followed by two consecutive lower highs; a swing low is defined by two consecutive lower lows followed by two consecutive higher lows. As swing points typically accompany reversals, they occur more frequently in choppier and volatile markets than in trends.

Adaptive lookback period is determined as :

  1. Determine the initial number of swing points (swing count parameter) to use in the calculation.
  2. Count the number of price bars it takes for the n swing points to form.
  3. Divide step 2 by step 1 and round the result.
  4. as an addition, adjust the "speed" of the produced period using the speed parameter - the smaller the speed parameter, the "slower" the average, and vice versa


This makes the variable lookback period grow in calm or trending markets, and shorten in range-bound and volatile markets. For a trend-following system you would like the opposite to prevent being whipsawed, therefore this indicator and it's usage as a period modifier is more suitable for short-term traders and counter-trend systems (so, in all systems where maximal speed of reaction and signaling is required).

Of stochastic

The stochastic slowing (smoothing) parameter is left as the original is - ie: it is not adaptive. It was done so in order to give you more precise control of the stochastic (since if the smoothing was adaptive too, you would not be able to control the smoothness of the produced stochastic)

Alb average Alb average

Alb average

Stochastic - with normalized zones Stochastic - with normalized zones

Stochastic - with normalized zones

Phase change index - JMA Phase change index - JMA

Phase change index - JMA

RSI of alb average RSI of alb average

RSI of adaptive lookback average