TradingView
LazyBear
4 Feb 2015 pukul 04.22

Volatility Switch Indicator [LazyBear] 

Bitcoin / U.S. dollarBitstamp

Huraian

The Volatility Switch (VOLSWITCH) indicator, by Ron McEwan, estimates current volatility in respect to historical data, thus indicating whether the market is trending or in mean reversion mode. Range is normalized to 0 - 1.

When Volatility Switch rises above the 0.5 level, volatility in the market is increasing, thus the price action can be expected to become choppier with abrupt moves. When the indicator falls below the 0.5 level from recent high readings, volatility decreases, which may be considered a sign of trend formation.

Trading strategy as suggested by Ron McEwan is:
- If VOLSWITCH is less than 0.5, volatility decreases, which may be considered a sign of trend formation
- If VOLSWITCH is greater than 0.5, market is in high volatility mode. Can be choppy. Use RSI to look for OB/OS levels.

I have implemented support for 2 lengths (14 and 21) Note that, Pine doesn't support loops. Once it is introduced, I will publish an updated version.

Building a strategy out of this is straightforward (refer to my strategy explanation above), I strongly encourage new Pinescript coders to try to a plotarrow() based overlay indicator to get more familiar with Pine.

More info:
---------
The Volatility (Regime) Switch Indicator [S&C Feb 2013]: traders.com/Documentation/FEEDbk_docs/2013/02/McEwan.html

Complete list of my indicators:
-------------------------------------
docs.google.com/document/d/15AGCufJZ8CIUvwFJ9W-IKns88gkWOKBCvByMEvm5MLo/edit?usp=sharing
Komen
kyosho866
The volatility switch result is different from what's shown on Thinkorswim, why is that?
For example, AAPL on daily chart, 2023-1-5 on thinkorswim platform is 0.3333. Tradingview is 0.71, big difference and total opposite meaning!
What info do you guys (experts) need to find out?
odupontdk
what is the original pinescript version? i have some difficulty to convert it in V5 on the following part:
vswitch21=((vola21[1] <= vola21 ) + (vola21[2] <= vola21 ) + (vola21[3] <= vola21 ) +
(vola21[4] <= vola21 ) + (vola21[5] <= vola21 ) + (vola21[6] <= vola21 ) +
(vola21[7] <= vola21 ) + (vola21[8] <= vola21 ) + (vola21[9] <= vola21 ) +
(vola21[10] <= vola21 ) + (vola21[11] <= vola21 ) + (vola21[12] <= vola21 ) +
(vola21[13] <= vola21 ) + (vola21[14] <= vola21 ) + (vola21[15] <= vola21 ) +
(vola21[16] <= vola21 ) + (vola21[17] <= vola21 ) + (vola21[18] <= vola21 ) +
(vola21[19] <= vola21 ) + (vola21[20] <= vola21 ) + 1) / 21

i have the error:
Syntax error at input 'end of line without line continuation'

how can i solve it?
thanks for your help
ChartArt
Awesome! Thank you very much. It looks promising to filter very trending / non-trending areas in my first charts using it.
LazyBear
YW. Looking fwd to ur charts with tuned params :)
QuantitativeExhaustion
Excellent description. I will be giving VOLSWITCH a try.


Can't wait for the loops!
LazyBear
Thanks JR.
skhizakhe
This is great stuff, looking forward for your updated version with buy and sell signal in it. Keep up the good work.
sniperlive
Hi, good job on coding this indicator. I know it's pretty old but is there any chance this can be updated to version 5?
DrMastercoin
sounds like hurst exponent
AhmedMF
I took me some time to understand but it is very good indicator. It will surely help me enter a position, by avoid choppiness, correct me if i am wrong. brilliant indicator
Lebih