Volatility patterns / quantifytools- Overview
Volatility patterns detect various forms of indecisive price action, on a larger scale as a compressed range and on a smaller scale as indecision candles. Indecisive and volatility suppressing price action can be thought of as a spring being pressed down. The more suppression, the more tension is built and eventually released as a spike or series of spikes in volatility. Each volatility pattern is assigned an influence period, during which average and peak relative volatility is recorded and stored to volatility metrics.
- Patterns
The following scenarios are qualified as indecision candles: inside candles, indecision engulfing candles and volatility shifts.
By default, each indecision candle is considered a valid pattern only when another indecision candle has taken place within 3 periods, e.g. prior inside candle + indecision engulfing candle = valid volatility pattern. This measurement is taken to filter noise by looking for multiple hints of pending volatility, rather than just one. Level of tolerated noise can be changed via input menu by using sensitivity setting, by default set to 2.
Sensitivity at 1: Any single indecision candle is considered a valid pattern
Sensitivity at 2: 2 indecision candles within 3 bars is considered a valid pattern
Sensitivity at 3: 2 indecision candles within 2 bars (consecutive) is considered a valid pattern
The following scenarios are qualified as range patterns: series of lower highs/higher lows and series of low volatility pivots.
A pivot is defined by highest/lowest point in price, by default within 2 periods back and 2 periods forward. When 4 pivots with qualities mentioned above are found, a box indicating compressed range will appear. Both required pivots and pivot definition can be adjusted via input menu.
- Influence time and metrics
By default, influence time for each volatility pattern is set to 6 candles, a period for which spike(s) in volatility is expected. For each influence period, average relative volatility (volatility relative to volatility SMA 20) and peak relative volatility is recorded and stored to volatility metrics. All metrics used in calculations are visible in "Data Window "tab. Average and peak volatility during influence period will vary depending on chart, timeframe and chosen settings. Tweaking the settings might result in an improvement and is worth experimenting with.
- Visuals
By default, indecision candles are visualized as yellow lines and range patterns as orange boxes. Influence time periods are respectively visualized as colored candle borders, applied as long as influence time period is active. All colors are fully customizable via input menu.
- Practical guide
Volatility patterns depict moments of equal strength from both bulls and bears. While this equilibrium is in place, price is stagnant and compresses until either side initiates volatility, releasing the built up tension. On top of hedging and playing the volatility using volatility based instruments, some other methods can be applied to take advantage of the somewhat tricky areas of indecision.
Example #1: Trading volatility
Volatility is not a bad thing from a trading perspective, but can actually be fertile ground for executing trade setups. Trading volatility influence periods from higher timeframes on lower timeframes gives greater resolution to work with and opportunities to take advantage of the wild swings created.
Example #2: Finding bias for patterns
Points of confluence where it anyway makes sense to favor one side over the other can be used for establishing bias for indecisive price action as well. At face value, it makes sense to expect bearish reactions at range highs and bullish reactions at range low, for which volatility patterns can provide a catalyst.
Example #3: Betting on initiation direction
Betting on direction of the first volatile move can easily go against you, but if risk/reward is able to compensate for the poor win rate, it's a valid idea to consider and explore.
Compression
GamCP Multi-timeframe v0.1Measures compression on different timeframes, on demand. A high compression precedes high volatilty.
v0.1 - by mufaxor
Volume CompressorTurns volume into a more informative representation, ready to be further analyzed
...
Rationale
Volume
Back in the "before the quant" days I was a big fan of market & volume profile. Thing is J. Steidlmayer had lotta different ideas & works aside of profiling, it's just most of them ain't got to mainstream, one of them was "Hot / Cold volume" (yes, you can't really google it). From my interpretation, the idea was that in a given asset there is a usual constant volume that stays there no matter what, and if it ever changes it changes very slow and gradually; and there's another kind of, so to say, 'active' volume that actually influences price dynamics and very volatile by its nature. So I've met concept lately, and decided to quantify & model it one day when I'll have an idea how. That day was yesterday.
Compression
When we do music we always use different kinds of filters (low-pass, high pass, etc) for equalization and filtering itself. That stuff we use in finance as well. What we also always use in music are compressors, there dynamic processors that automatically adjust volume so it will be more consistent. Almost all the cool music you hear is compressed (both individual instruments (especially vocals) and the whole track afterwards), otherwise stuff will be too quite and too weak to flex on it, and also DJing it would be a nightmare. I am a big adept of loudness war. So I was like, how can I use compression in finance, when ima get an idea? That day was yesterday as well.
Volume structure
Being inspired by Steidlmayer's idea, I decided to distinguish volume this way:
1) Passive / static volume. The ~ volume that's always there no matter what (hedges, arbitrages, spread legs, portfolio parts etc etc), doesn't affect things;
2) Active / dynamic volume. The volume that flows from one asset to another, really matters and affects things;
3) Excess volume. The last portion of number 2 volume, that doesn't represent any powerful value to affect things.
Now it's clear that we can get rid of number 1 and number 3, the components that don't really matter, and concentrate on number 2 in order to improve information gain, both for ourselves and for the models we feed this data. How?
Model
I don't wanna explain it all in statistical / DSP way for once.
First of all, I think the population of volumes is log-normally distributed, so let's take logs of volumes, now we have a ~ normally distributed data. We take linearly weighted mean, add and subtract linearly weighted standard deviation from it, these would be our thresholds, the borders between different kinds of volumes explained before.
The upper threshold is for downward compression, that will not let volume pass it higher.
The lower threshold is for upward compression, all the volumes lower than this threshold will be brought up to the threshold's level.
Then we apply multipliers to the thresholds in order to adjust em and find the sweet spots. We do it the same way as in sound engineering when we don't aim for overcompression, we adjust the thresholds until they start to touch the signal and all good.
Afterwards, we delete all the number 1 and number 3 volume, leaving us exclusively with the clear main component, ready to be processed further.
We return the volumes to dem real scale.
About the parameters, based on testing I don't recommend changing the thresholds from dem default values, first of all they make sense statistically and second they work as intended.
Window length can and should be adjusted, find your own way, or leave the default value. ML (moving location) length is up to you as well.
So yeah, you can see now we can smooth the data and make it visually appealing not only by applying a smooth filter over it.
All good TV?
[CBB] Volatility Squeeze ToyThe main concept and features of this script are adapted from Mark Whistler's book "Volatility Illuminated". I have deviated from the use cases and strategies presented in the book, but the 3 Bollinger Bands use his optimized settings as the default length and standard deviation multiplier. Further insights into Mark's concepts and volatility research were gained by reading and watching some of TV user DadShark's materials (www.tradingview.com).
This script has been through many refinements and feature cycles, and I've added unrelated complimentary features not present in the book. The indicator is better studied than described, and unless you have read the book, any short summary of the material will just make you squint and think about the wrong things.
Here is a limited outline of features and concepts:
1. 3 Bollinger Bands of different length and/or deviation multiplier. Perhaps think of them as representing the various time frames that compression and expansion cycles and events manifest in, and also the expression of range, speed and price distribution within those time frames. You can gain insight into the magnitude of events based on how the three bands interact and stay contained, or not. If volatility is significant enough, all "time frames" represented by the bands will eventually record the event and subsequent price action, but the early signals will come from the spasms of the shortest, most volatile band. Many times the short band will contract again before, or just as it reaches a longer band, but in extreme cases, volatility will explode and all bands at all time frames will erupt in succession. In these cases you will see additional color representing shorter bands (lower time frame volatility in concept) traveling outside of longer bands. It is worth taking a look at the price levels and candles where these volatility bands cross each other.
2. In addition to the mean of the bands, there are a variety of other moving averages available to gauge trend, range, and areas of interest. This is accomplished with variable VWAP, ATR, smoothing, and a special derived loosely from the difference between them.
3. The bands are also used to derive conditions under which volatility is considered compressed, or in "squeeze" . Under these conditions the candles will turn yellow. Depending on your chart settings and indicator settings, these zones can be completely useless or drag on through fairly significant price action. Or, the can give you fantastic levels to watch for breakouts. The point is that volatility is compressed during these conditions, and you should expect the inevitable once this condition ends. Sometimes you can find yourself in a nice fat trend straight away, other times you may blow an account because you gorged your position based on arbitrary bar color. It's not like that. Pay attention to the highest and lowest bars of these squeeze ranges, and carefully observe future price action when it returns to these squeeze ranges. This info is more and more valuable at higher time frames.
The 3 bands, a smoothed long trend VWAP, and the squeeze condition colored bars are all active by default. All features can be shown or hidden on the control panel.
There are some deep market insights to mine if you live with this one for a while. As with any indicator, blunt "buy/sell here" approaches will lead to loss and frustration. however , if you pay attention to squeeze range, band/moving average confluence, high volume and/or large range candles their open/close behavior around these areas and squeeze ranges, you will start to catch the beginning of some powerful momentum moves.
Enjoy!
ATR Volume DivergenceThe indicator measures ATR relative to VOLUME of each candle, marks the candles where there is more volume than in the previous one, but a lower ATR - signifying a compression in price movement - resistance. It also marks the candle where there is a greater ATR than in the previous candle, but lower volume - signifying an expansion in price movement - vacuum.
P.S. Bring indicator to FRONT to see the colored candles clearly
Baekdoo compressed multi EMA box and its crossover indicatorHi forks,
I'm trader Baekdoosan who trading Equity from South Korea. This Baekdoo compressed multi EMA box and its crossover indicator tells us good trading time for swing trading.
Here is the idea. As you can see formula, I put ema of 5 days to 100 days.
and draw box when all disparity of the EMAs are less than 5%
I put those value in input variable as 105 (100 means same as max/min disparity ratio, 105 means max is 5% greater than min). This can be used 110 (10% of box) based on your needs.
Once box are drew, I put indicator when it crossover the box with 5 times larger than 60 days' highest volume. Then I put triangle indicator. This will be good trading point for short-mid term trading. you can check historical chart to evaluate this.
Hope this will help your trading on equity as well as crypto. I didn't try it on futures . Best of luck all of you. Gazua~!
Compression support&resistance [LM]Hello traders,
I would like to present you Compression support&resistance script. The idea behind is to look for areas of price compression(inside bar candles). Basically the S/R lines are created after three candles that are formed in certain pattern and volume conditions. First candle of pattern is usually the most volatile and fist inside bar after volatile candle high and low creates S/R lines in order to look for breakouts or for future bounces of the S/R line. Also by default volume has to be decreasing from candle to candle, although this condition can be controlled by setting.
It has various settings as my other S/R scripts for multi timeframe analysis. The current timeframe uses line API but for multi timeframe I use plot lines. There are two filters. Volume filter for declining volume of the pattern candles and volatility filter which renders line only in case that pattern occurs after some % change has happened within some lookback period.
Credit also for this indicator goes to @berkek as he took time to explain it to me.
Hope you will enjoy it,
Lukas
Pascal's 4h Compression BreakoutThis indicator aims to identify areas of price compression, by looking for two consecutive "inside candles" on the 4h chart.
An inside candle is simply when the current candle's high is lower than the previous candle's high, and the current candle's low is higher than the previous candle's low.
Once price compression is identified, the indicator draws a range based on the highest high and the lowest low of the two inside candles.
1) A break above the range is bullish.
2) A break below the range is bearish.
The script ALSO paints candles in blue that are likely to become strong horizontal S/R levels. This is, again, based on a candle pattern.
Please note:
1) This indicator is only meant to be used on BITMEX:XBTUSD (on the 4h or 1h chart).
2) You will have to apply some discretion to profitably trade with this indicator. Use SFPs and horizontal S/R levels to judge if a breakout is worth trading.
Finally, use the indicator at your own risk. I am not responsible for any losses you may incur.
My objective with this indicator g is to hopefully give you something that you can build upon, and NOT a script to blindly copy trade.
The concept of market compression is powerful. There are countless ways in which you can build a system around it.
This is just the tip of the iceberg.
Cheers.
(JS) Squeeze Pro 2This is my version of the updated classic indicator created by John Carter. I plan on adding a Squeeze Overlay script in the future that will pair with this one as well for additional signals.
So to break down the Squeeze, what it is, how it works, etc - you have to look at the components that make it up.
1. Bollinger Bands
2. Keltner Channels
3. Momentum
The momentum in this indicator is smoothed out using linear regression (shout out to Lazy Bear, it's a much simpler way to do it, imo).
The momentum is what is displayed on the indicator as a histogram, its purpose is obvious (to show momentum).
Now what is a Squeeze? A squeeze occurs when Bollinger Bands tighten up enough to slip inside of Keltner Channels.
This is interpreted as price is compressing and building up energy before releasing it and making a big move.
Traditionally, John Carter's version uses 20 period SMAs as the basis lines on both the BB and the KC.
In my version, I've given the freedom to change this and try out different types of moving averages.
His original squeeze indicator had one Squeeze setting, though this new one has three .
The white dot Squeeze , call it a "low squeeze", an "early squeeze", whatever you'd like - this is the easiest Squeeze to form based on its settings.
The red dot Squeeze is the original from the first Squeeze indicator.
And finally, the yellow dot squeeze , call it a "high squeeze", "power squeeze", once again whatever you want - is the most difficult to form and suggests price is under extreme levels of compression.
From what I've witnessed John Carter say in the past, the squeeze is meant to be used for continuation.
Now to explain the parameters:
Squeeze Input - This is just the source for the Squeeze to use, default value is closing price.
Length - This is the length of time used to calculate the Bollinger Bands and Keltner Channels.
Bollinger Bands Calculation Type - Selects the type of moving average used to create the Bollinger Bands.
Keltner Channel Calculation Type - Selects the type of moving average used to create the Keltner Channel.
Color Format - I have created 5 different color schemes, this allows you to choose one.
Draw Divergence - Self explanatory here, this will auto-draw divergence on the indicator.
Gray Background for Dark Mode - This is something I put on all my indicators to make them more visually appealing.
Moving on to the alerts, I have made some basic alerts to notify certain indicator conditions (I had to revise it back from the prior version, as V4 of PineScript limits outputs).
6th Dot Alerts - This will inform you when a certain Squeeze makes it 6 dots in. Why 6 dots? That is what John Carter said to be his preference.
12th Dot Alerts - Think of this as a "prolonged Squeeze" alert. I feel like if they do run this long you likely need to go up in resolution, but some traders prefer certain time increments so this is for them.
End of Squeeze Alerts - Self explanatory again - once a Squeeze has concluded this will provide you with a notification.
Start of Squeeze Alerts - Opposite of the alert above, notifications come when a Squeeze begins.
Zero Line Alerts - This will inform you of when the momentum makes a bullish or bearish move across the zero line.
I hope that I've done well enough explaining the indicator and how it works, for any further information on it I suggest you check out Simpler Trading and get linked up with John Carter over there.
He does lots of videos, webinars, and of course you can always get the official indicator and his signals there too.