Rajandran R Founder of Marketcalls and Co-Founder Algomojo. Full-Time Derivative Trader. Expert in Designing Trading Systems (Amibroker, Ninjatrader, Metatrader, Python, Pinescript). Trading the markets since 2006. Mentoring Traders on Trading System Designing, Market Profile, Orderflow and Trade Automation.

PercentRank Based Smooth ATR to Predict Change in Volatility – Amibroker AFL Code

1 min read

Is there a way where one can identify market regime shift from low volatility zone to high volatility zone and vice versa? How I can identify stocks with increasing volatility? Is there a way one can identify the regime shift in volatility? These are the bugging question from many short-term traders.

To kickstart ATR is a measure of volatility and not a directional indicator. when the market participants are active & interested eventually it will result in large trading range. However, if the participants are uninterested which will result in smaller trading range. And the volatility behavior can be seen in cycles where the market moves from high volatile zones to low volatile zones and vice versa.

PercentRank Based Smooth ATR – Nifty Daily Charts

But ATR values alone we cannot use it to predict the change in regime shift from low to high or high to low volatility shift. In order to predict the regime-shift, we need to smooth the ATR. Here smoothing of the ATR data points are done using linear regression to reduce lag in end result and equally responsive as the actual ATR values.

Now Percentrank is applied over smooth ATR to predict the change in regime shift. Percent rank value of 100 indicates that the smooth ATR is the highest for the given lookback range, while a value of 0 indicates that the smooth ATR value is the lowest for the given lookback range(Default lookback range = 20 bars).

From Zero to Increasing Percent Rank indicates regime change from low volatility zones to high volatility zone (Blue Color)

whereas,

From 100 to Decreasing Percent Rank indicates regime shift from high volatility to low volatility zone. (Red Color)

Here are the Amibroker AFL codes for Percent Rank based smooth ATR and colored candles according to the high volatility or low volatility zones. High volatility zones are colored blue and low volatile zones are colored red. Exploration feature is added to find increasing/decreasing Percent rank with values.

Note: Exploration can be used only on 1 recent bar or 1 recent day if on a daily timeframe to get accurate values.

PercentRank Based Smooth ATR Colorcoded Candles – Amibroker AFL Code

https://gist.github.com/cae0915971521a8e2391d65444a26827

PercentRank Based Smooth ATR – Amibroker AFL Code

https://gist.github.com/ee564bc82fdd7cd5603f3133d4f25570

Rajandran R Founder of Marketcalls and Co-Founder Algomojo. Full-Time Derivative Trader. Expert in Designing Trading Systems (Amibroker, Ninjatrader, Metatrader, Python, Pinescript). Trading the markets since 2006. Mentoring Traders on Trading System Designing, Market Profile, Orderflow and Trade Automation.

What is QuantZilla?

Quantzilla is 75+ hours of code mentoring program designed for noncoders who want to learn the coding program right from designing indicators, scanners, trading...
Rajandran R
58 sec read

Things to Consider While Building a Bracket Order Execution…

Building a Bracket Order Strategy is the most demanded request we got from most of the algomojo traders. This article explains the list of...
Rajandran R
12 min read

PlaceOrder – Multi Broker Exectuion Code Snippets for Amibroker

This tutorial explains how to build a button trading right from scratch and with a click of a button how you can send orders...
Rajandran R
7 min read

One Reply to “PercentRank Based Smooth ATR to Predict Change in Volatility…”

  1. PercentRank Based Smooth ATR – Amibroker AFL Code

    Hello Sir

    Can you please share python code for this indicator ?

    It would be of great help

Leave a Reply

Get Notifications, Alerts on Market Updates, Trading Tools, Automation & More