Auto-magnifier / quantifytools- Overview
Auto-magnifier shows a lower timeframe view of candles and volume bars inside any main timeframe candle by zooming into it. Candles and volume bars as they develop are shown chronologically from left to right. By default, magnifier is triggered when less than 3 candles are visible on the chart.
By default, 20 lower timeframe candles are displayed by splitting main timeframe into 20 parts. The amount of candles displayed is a target rate, meaning the script will use a lower timeframe that has the closest match to 20 candles and therefore will vary a bit. Users can override automatic timeframe calculation and opt in to display any specific lower timeframe or adjust amount of candles shown (e.g. 20 -> 30 candles) per each main timeframe candle.
Example
Main timeframe set to 30 minute, candles displayed set to 20 -> Magnifying using 2 minute candles (30 minute/20 candles = 1.5 min, rounded to 2 min)
Main timeframe set to 30 minute, override set to 5 minutes -> Displaying 5 minute candles
Size of volume bars is calculated using relative volume (volume relative to volume SMA20), lowest bar representing relative volume values of under or equal to 1x the moving average and from there onwards progressively growing.
- Limitations and considerations
Amount of candles shown might flow over from the background on smaller screen sizes, in which case you would want to decrease the amount shown. Opposite is true for bigger screens, this value can be increased as more candles fit.
This indicator involves a lot of tricks with text elements to make it work automatically by zooming in. Size of wicks, bodies and volume bars are calculated by adding more text elements on big candles and less text elements on smaller candles. This means the displayed candles won't be a 100% match, but a rather a fair representation of the view, e.g. candle is green = lower timeframe candle is green, candle has a big wick = lower timeframe candle has a big wick (but not a 100% match).
Example
Magnified lower timeframe chart vs. Actual lower timeframe chart
Most mismatch will be found on the price levels where lower timeframe candles are shown, which is sacrificed for the sake of getting a better readability on the overall shape of lower timeframe price action. Users can alternatively optimize calculations for more accuracy, giving a better representation of the price levels where candles truly originated. This typically comes with the cost of worse readability however.
Example
Optimized for readability vs. Optimized for accuracy
- Visuals
All visual elements are fully customizable.
Quantifytools
Broad market index / quantifytools- Overview
Broad market index is a market breadth based oscillator, depicting broad market trend by analysing ratio between symbols moving up and symbols moving down in a given market. When market breadth is positive, more symbols are going up and when negative, more symbols are going down. As markets tend to correlate, broad market trend dictates likely path for all individual symbols that make up the market.
This tool provides market breadth for US equities (based on NYSE advancers - decliners) and ability to build two custom breadth baskets with up to 39 symbols included in each. Market breadth can be customized with variety of smoothing options, weighting and threshold modes to find most optimal rules for trend following. Performance of the model is reflected on metrics showing percentage of up/down moves during bullish/bearish states.
Example
↑ 63% = 63% of price moves during positive breadth state are to the upside
↓ 59% = 59% of price moves during negative breadth state are to the downside
Breadth state is colorized on line and chart according to its state (negative/positive/equilibrium) and direction (trending up/down). Upper and lower bands depict historical turning points in breadth for identifying extremes in broad market trend. Triangles mark breadth thrusts, in other words abnormally large moves in breadth at either upper or lower extreme. Breadth thrusts can serve as early signs of broad market trend reverting.
- Concept and features
By default, market breadth is calculated based on NYSE advancers - decliners, usable for all major indices that depict broad markets in US equities (SP500, QQQ, IWM). Users can also build 2 custom breadth baskets consisting of up to 39 symbols for defining broad market on other asset classes, such as cryptocurrencies. Custom baskets are suitable for any chart that fairly represents a market as a whole.
Example
Basket consisting of cryptocurrencies = Use on CRYPTOCAP:TOTAL (all cryptocurrencies aggregated)
Basket consisting of healthcare stocks = Use on AMEX:XLV (healthcare sector ETF)
Breadth line can be further refined using various smoothing options (SMA, EMA, HMA, RMA, WMA), threshold method and weights. By default, threshold (dividing line between bullish and bearish states) is set to fixed at 0, depicting an equilibrium where equal amount of symbols are going up and down.
Threshold mode can also be set to Dynamic, switching threshold to a moving average of the breadth line. Fundamental functionality still remains, breadth line above threshold marks bullish state and below threshold marks bearish state. Difference here is that the threshold no longer depicts a point of equilibrium, but simply a smoothed version of the breadth line itself, which can catch turns in broad market trend earlier.
Breadth basket can be adjusted to volatility of the viewed chart, causing an overstating of breadth on high volatility and understating on low volatility. Weighting takes into account magnitude of up/down moves, which can provide better relevance for trend following purposes.
- Practical guide
Example #1 : Broad market trend
The utility of market breadth is based on the idea that markets correlate and individual symbols making up the market will eventually join the broad market trend. With this in mind, going against broad market is like swimming upstream, it's going to be the hard way. A well performing basket with clear skew for upside and downside on respective breadth states can be used to form directional bias for trades and risk on/off regimes for investing.
Example #2 : Broad market reversals
Thrusts signify two things: a historical extreme in breadth and an aggressive move to the opposite direction. Thrusts are valuable clues for exhaustion in broad market trend, potentially leading to a reversal.
Example #3 : Breadth/price divergences
Market breadth and price diverging signify events where most symbols that make up the market are going one way but a few high weight symbols (big tech for SP500) are going the other way. In other words, only a few symbols are moving the market while general interest and intention is to the other direction. Divergences in breadth and price are not ideal for sustainable trend and can be expected to eventually revert to the direction of broad market.
Open interest flow / quantifytools- Overview
Open interest flow detects inflows (positions opening) and outflows (positions closing) using open interest and estimates delta (net buyers/sellers) for the flows. Users are able to choose any open interest source available on Tradingview, by default set to BTCUSDT OI fetched from Binance. Using historical open interest flows, bands depicting typical magnitude of flows are formed for benchmarking intensity of flows. On the inflow side, +1 represents average inflows while +2 represents 2x above average inflows, a level considered an extreme. In a vice versa manner, -1 represents average outflows while -2 represents 2x above average outflows. Extreme inflows indicate aggressive position opening, in other words exuberance. Extreme outflows on the other hand indicate forced exiting of positions, in other words liquidations.
- Concept
Open interest flow is calculated using position of OI source relative to its moving average (by default set to SMA 10), referred to as relative open interest from hereon. When relative OI is positive (open interest is above its moving average), new positions are considered to enter the market. When relative OI is negative (open interest is below its moving average), existing positions are considered to exit the market. Open interest delta (side opening/closing positions, either net buyers/sellers) is calculated using relative price in a similar fashion to relative OI, but using close of viewed symbol as source. Price is considered to be up when relative price is positive, down when relative price is negative. Using relative OI and relative price in tandem, the following assumptions are applied:
Price up, open interest up = longs entering market
Price down, open interest up = shorts entering market
Price down, open interest down = longs exiting market
Price up, open interest down = shorts exiting market
Bands depicting magnitude of open interest flows are calculated using average turning points in relative OI. +1 and -1 represent levels where flows on average turn towards mean rather than continue to increase/decrease. These levels are then multiplied up to +2 and -2, representing two times larger deviations from the normal. When inflows are above 1, positions opening have reached a point where flows historically turn down. Therefore, anything above 1 would be abnormal amount of open interest entering, an extreme stretch being at 2 or above. Same logic applies to outflows, but in a vice versa manner (below -1 abnormal, extreme at -2)
Flow bursts further refine indications of aggressive inflows/outflows by taking into account change in open interest flows. Burst indications are activated when open interest is above its average turning point, coupled with a sufficient increase/decrease in flows simultaneously. Bursts are essentially a filtered version of abnormal flows and therefore a more reliable indication of exuberance/liquidations. Burst sensitivity can be adjusted via input menu, available in 5 settings. 1 sets OI burst requirements to loosest (more signals, more noise) while 5 sets OI burst requirements to strictest (less signals, less noise). Exact criteria applied to bursts can be viewed via input menu tooltip.
- Features
Users can opt for OI source auto-select for CRYPTO/USDT pairs. When auto-select is enabled and another chart is opened, corresponding open interest source is automatically selected as long as requirements mentioned above are met.
Open interest flows can be visualized as chart color, available separately for flow states and flow bursts.
Relative price line and flow guidelines (reminders for flow interpretation) can be enabled via input menu. All colors are customizable.
- Alerts
Available alerts are the following:
- Abnormal long inflows/outflows
- Abnormal short inflows/outflows
- Abnormal inflows/outflows from either side
- Aggressive longs/shorts (flow burst up)
- Liquidated longs/shorts (flow burst down)
- Aggressive or liquidated longs/shorts
- Practical guide
Open interest as a standalone data point does not reveal which side is likely opening/exiting positions and how extreme the participant behavior is. Using the additional data provided by open interest flows, moments of greed and fear can be detected. Smart money does not short into dips and buy into rips. When buyers or sellers have participated in a large move and continue to show interest even when efforts are not rewarded at an already overextended price, participants are asking for trouble.
Similar events can be observed when extreme outflows take place, indicating forced exits such as stop-losses triggering. When enough participants are forced out, price is likely to take the path of least resistance which is to the opposite direction.
Price based concepts / quantifytools- Overview
Price based concepts incorporates a collection of multiple price action based concepts. Main component of the script is market structure, on top of which liquidity sweeps and deviations are built on, leaving imbalances the only standalone concept included. Each concept can be enabled/disabled separately for creating a selection of indications that one deems relevant for their purposes. Price based concepts are quantified using metrics that measure their expected behavior, such as historical likelihood of supportive price action for given market structure state and volume traded at liquidity sweeps. The concepts principally work on any chart, whether that is equities, currencies, cryptocurrencies or commodities, charts with volume data or no volume data. Essentially any asset that can be considered an ordinary speculative asset. The concepts also work on any timeframe, from second charts to monthly charts. None of the indications are repainted.
Market structure
Market structure is an analysis of support/resistance levels (pivots) and their position relative to each other. Market structure is considered to be bullish on a series of higher highs/higher lows and bearish on a series of lower highs/lower lows. Market structure shifts from bullish to bearish and vice versa on a break of the most recent pivot high/low, indicating weak ability to defend a key level from the dominating side. Supportive market structure typically provides lengthier and sustained trending environment, making it an ideal point of confluence for establishing directional bias for trades.
Liquidity sweeps
Liquidity sweeps are formed when price exceeds a pivot level that served as a provable level of demand once and is expected to display demand again when revisited. A simple way to look at liquidity sweeps is re-tests of untapped support/resistance levels.
Deviations
Deviations are formed when price exceeds a reference level (market structure shift level/liquidity sweep level) and shortly closes back in, leaving participating breakout traders in an awkward position. On further adverse movement, stuck breakout traders are forced to cover their underwater positions, creating ideal conditions for a lengthier reversal.
Imbalances
Imbalances, also known as fair value gaps or single prints, depict areas of inefficient and one sided transacting. Given inclination for markets to trade efficiently, price is naturally attracted to areas that lack proper participation, making imbalances ideal targets for entries or exits.
Key takeaways
- Price based concepts consists of market structure, liquidity sweeps, deviations and imbalances.
- Market structure shifts from bullish to bearish and vice versa on a break of the most recent pivot high/low, indicating weak ability to defend a key level from the dominating side.
- Supportive market structure tends to provide lengthier and sustained movement for the dominating side, making it an ideal foundation for establishing directional bias for trades.
- Liquidity sweeps are formed when price exceeds an untapped support/resistance level that served as a provable level of demand in the past, likely to show demand again when revisited.
- Deviations are formed when price exceeds a key level and shortly closes back in, leaving breakout traders in an awkward position. Further adverse movement compels trapped participants to cover their positions, creating ideal conditions for a reversal.
- Imbalances depict areas of inefficient and one sided transacting where price is naturally attracted to, making them ideal targets for entries or exits.
- Price based concepts are quantified using metrics that measure expected behavior, such as historical likelihood of supportive structure and volume traded at liquidity sweeps.
- For practical guide with practical examples, see last section.
Accessing script 🔑
See "Author's instructions" section, found at bottom of the script page.
Disclaimer
Price based concepts are not buy/sell signals, a standalone trading strategy or financial advice. They also do not substitute knowing how to trade. Example charts and ideas shown for use cases are textbook examples under ideal conditions, not guaranteed to repeat as they are presented. Price based concepts notify when a set of conditions are in place from a purely technical standpoint. Price based concepts should be viewed as one tool providing one kind of evidence, to be used in conjunction with other means of analysis.
Price based concepts are backtested using metrics that reasonably depict their expected behaviour, such as historical likelihood of supportive price movement on each market structure state. The metrics are not intended to be elaborate and perfect, but to serve as a general barometer for feedback created by the indications. Backtesting is done first and foremost to exclude scenarios where the concepts clearly don't work or work suboptimally, in which case they can't be considered as valid evidence. Even when the metrics indicate historical reactions of good quality, price impact can and inevitably does deviate from the expected. Past results do not guarantee future performance.
- Example charts
Chart #1 : BTCUSDT
Chart #2 : EURUSD
Chart #3 : ES futures
Chart #4 : NG futures
Chart #5 : Custom timeframes
- Concepts
Market structure
Knowing when price has truly pivoted is much harder than it might seem at first. In this script, pivots are determined using a custom formula based on volatility adjusted average price, a fundamentally different approach to the widely used highest/lowest price within X amount of bars. The script calculates average price within set period and adjusts it to volatility. Using this formula, the script determines when price has turned significantly enough and aggressively enough to constitute a relevant pivot, resulting in high accuracy while ruling out subjective decision making completely. Users can adjust length of market structure basis and sensitivity of volatility adjustment to achieve desired magnitude of pivots, reflected on the average swing metrics. Note that structure pivots are backpainted. Typical confirmation time for a pivot is within 2-3 bars after peak in price.
Market structure shifts
Generally speaking, traders consider market structure to have shifted when most recent structure high/low gets taken out, flipping underlying bias from one side over to the other (e.g. from bullish structure favoring upside to bearish structure favoring downside). However, there are many ways to approach the concept and the most popular method might not always be the best one. Users can determine their own market structure shift rules by choosing source (close, high, low, ohlc4 etc.) for determining structure shift. Users can also choose additional rules for structure shift, such as two consecutive closes above/below pivot to qualify as a valid shift.
Liquidity sweeps
Users can set maximum amount of bars liquidity levels are considered relevant from the moment of confirmed pivot. By default liquidity levels are monitored for 250 bars and then discarded. Level of tolerance can be set to anything between 100 and 1000 bars. For each liquidity sweep, relative volume (volume relative to volume moving average) is stored and added to average calculations for keeping track of typical depth of liquidity found at sweeps.
Deviations
Users can set a maximum amount of bars price has to spend above/below reference level to consider a deviation to be in place. By default set to 6 bars.
Imbalances
Users can set a desired fill point for imbalances using the following options: 100%, 75%, 50%, 25%. Users can also opt for excluding insignificant imbalances to attain better relevance in indications.
- Backtesting
Built-in backtesting is based on metrics that are considered to reasonably quantify expected behaviour of the main concept, market structure. Structure feedback is monitored using two metrics, supportive structure and structure period gain. Rest of the metrics provided are informational in nature, such as average swing and average relative volume traded at liquidity sweeps. Main purpose of the metrics is to form a general barometer for monitoring whether or not the concepts can be viewed as valid evidence. When the concepts are clearly not working optimally, one should adjust expectations accordingly or take action to improve performance. To make any valid conclusions of performance, sample size should also be significant enough to eliminate randomness effectively. If sample size on any individual chart is insufficient, one should view feedback scores on multiple correlating and comparable charts to make up for the loss.
For more elaborate backtesting, price based concepts can be used in any other script that has a source input, including fully mechanic strategies utilizing Tradingview's native backtester. Each concept and their indications (e.g. higher low on a bearish structure, lower high on a bullish structure, market structure shift up, imbalance filled etc.) can be utilized separately and used as a component in a backtesting script of your choice.
Structure feedback
Structure feedback is monitored using two metrics, likelihood of supportive price movement following a market structure shift and average structure period gain. If either of the two employed tests indicate failed reactions beyond a tolerable level, one should take action to improve feedback by adjusting the settings. If feedback metrics after adjusting the settings are still insufficient, the concepts are working suboptimally for the given chart and cannot be regarded as valid technical evidence as they are.
Metric #1 : Supportive structure
Each structure pivot is benchmarked against its respective structure shift level. Feedback is considered successful if structure pivot takes place above market structure shift level (in the case of bullish structure) or below market structure shift level (in the case of bearish structure). Structure feedback constitutes as one test indicating how often a market structure state results in price movement that can be considered supportive.
Metric #2 : Structure period gain
Each structure period is expected to present favorable appreciation, measured from one market structure shift level to another. E.g. bullish structure period gain is measured from market structure shift up level to market structure shift down level that ends the bullish structure period. Bearish structure is measured in a vice versa manner, from market structure shift down level to market structure shift up level that ends the bearish structure period. Feedback is considered successful if average structure period gain is supportive for a given structure (positive for bullish structure, negative for bearish structure).
Additional metrics
On top of structure feedback metrics, percentage gain for each swing (distance between a pivot to previous pivot) is recorded and stored to average calculations. Average swing calculations shed light on typical pivot magnitude for better understanding changes made in market structure settings. Average relative volume traded at liquidity sweep on the other hand gives a clue of depth of liquidity typically found on a sweeps.
Feedback scores
When market structure (basis for most concepts) is working optimally, quality threshold for both feedback metrics are met. By default, threshold for supportive structure is set to 66%, indicating valid feedback on 2/3 of backtesting periods on average. On top, average structure period gain needs to be positive (for bullish structures) and negative (for bearish structure) to qualify as valid feedback. When both tests are passed, a tick indicating valid feedback will appear next to feedback scores, otherwise an exclamation mark indicating suboptimal performance on either or both. If both or either test fail, market structure parameters need to be optimized for better performance or one needs to adjust expectations accordingly.
Verifying backtest calculations
Backtest metrics can be toggled on via input menu, separately for bullish and bearish structure. When toggled on, both cumulative and average counters used in backtesting will appear on "Data Window" tab. Calculation states are shown at a point in time where cursor is hovered. E.g. when hovering cursor on 4th of January 2021, backtest calculations as they were during this date will be shown.
- Alerts
Available alerts are the following.
- HH/HL/LH/LL/EQL/EQH on a bullish/bearish structure
- Bullish/bearish market structure shift
- Bullish/bearish imbalance created
- Bullish/bearish imbalance filled
- Bullish/bearish liquidity sweep
- Bullish/bearish deviation
- Visuals
Each concept can be enabled/disabled separately for creating a selection indications that one deems relevant for their purposes. On top, each concept has a stealth visual option for more discreet visuals.
Unfilled imbalances and untapped liquidity levels can be extended forward to better gauge key areas of interest.
Liquidity sweeps have an intensity option, using color and width to visualize volume traded at sweep.
Market structure states and market structure shifts can be visualized as chart color.
Metric table can be offsetted horizontally or vertically from any four corners of the chart, allowing space for tables from other scripts.
Table sizes, label sizes and colors are fully customizable via input menu.
- Practical guide
The basic idea behind market structure is that a side (bulls or bears) have shown significant weakness on a failed attempt to defend a key level (most recent pivot high/low). In the same way, a side has shown significant strength on a successful attempt to break through a key level. This successful break through a key level often leads to sustained lengthier movement for the side that provably has the upper hand, making it an ideal tool for establishing directional bias.
Multi-timeframe view of market structure provides crucial guidance for analyzing market structure states on any individual timeframe. If higher timeframe market structure is bullish, it doesn't make sense to expect contradicting lower timeframe market structure to provide significant adverse movement, but rather a normal correction within a long term trend. In the same way, if lower timeframe market structure is in agreement with higher timeframe market structure, one can expect a reliable trending environment to ensue as multiple points of confluence are in place.
Bullish structure can be considered constructive on a series of higher highs and higher lows, indicating strong interest from bulls to sustain an uptrend. Vice versa is true for bearish structure, a series of lower highs and lower lows can be considered constructive. When structure does not indicate strong interest to maintain a supportive trend (lower highs on bullish structure, higher lows on bearish structure), a structure shift and a turn in trend might be nearing.
Market structure shifts are of great interest for breakout traders who position for continuation. Structure shifts can indeed be fertile ground for executing a breakout trade, but breakouts can easily turn into fakeouts that leave participants in an awkward position. When price moves further away from the underwater participants, potential for snowball effect of covering positions and driving price further away is elevated.
Liquidity sweeps as a concept is based on the premise that pivoting price is evidence of meaningful depth of liquidity found at/around pivot. If liquidity existed at a pivot once, it is likely to exist there in the future as well. When price grinds against liquidity, it is on a path of resistance rather than path of least resistance. Pivots are also attractive placements for traders to set stop-losses, which act as fuel for price to move to the opposite direction when swept and triggered.
Behind tightly formed pivots are potentially many stop-loss orders lulled in the comfort of having many layers of levels protecting their position. Compression that leaves such clusters of unswept liquidity rarely goes unvisited.
As markets strive for efficient and proper transacting most of the time, imbalances serve as points in price where price is naturally attracted to. However, imbalances too are contextual and sometimes one sided trading is rewarded with follow through, rather than with a fill. Identifying market regimes give further clue into what to expect from imbalances. In a ranging environment, one can expect imbalances to fill relatively quick, making them ideal targets for entries and exits.
On a strongly trending environment on the other hand imbalances tend to stick for a much longer time. In such environments continuation can be expected with no fills or only partial fills. Signs of demand preventing fill attempts serve as additional clues for imminent continuation.
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.
Liquidity prints / quantifytools- Overview
Liquidity prints detect points in price where buyers or sellers are being effectively absorbed, indicative of price being on a path of resistance. In other words, the prints detect points in price where hard way is likely in current motion and easy way in the opposite. Prints with ideal attributes such as prints into extended trends or into a deviation are marked separately as print confluence. Prints with important or multiple confluence factors give further color into potential strength and duration of print influence. Liquidity prints are detected using an universally applicable method based on price action (OHLC). The prints principally work on any chart, whether that is equities, currencies, cryptocurrencies or commodities, charts with volume data or no volume data. Essentially any asset that can be considered an ordinary speculative asset. The prints also work on any timeframe, from second charts to monthly charts. Liquidity prints are activated real-time after a confirmed bar close, meaning they are not repainted and can be interacted with once a confirmation is in place.
Liquidity prints are based on the premise that price acts a certain way when sufficient liquidity is found, in other words when price shows exhaustion of some sort. A simple example of such price action are wicks, attempted moves that were rejected within the same time period where move was initiated. This type of price action typically takes place when price is close to or at meaningful amount of bids in an order book. There's no guarantee the stacked orders can't be just cleared and moved through, but at face value it does not make sense to expect price moving the hard way. When sufficient amount of characteristics in price action are hinting proximate liquidity, a print is activated. As a barometer for print feedback quality, short term impact on price rate of change and likelihood of print lows/highs being revisited during backtesting period are tracked for each print. Peak increase/decrease during backtesting period is also recorded and added to average calculations. Liquidity prints can also be backtested using any script that has a source input, including mechanic strategies utilizing Tradingview's native backtester.
Key takeaways
Liquidity prints are activated when price is showing signs of grind against path of greater resistance, leaving path of least resistance to the opposite direction.
Liquidity prints with ideal attributes are marked separately as print confluence, giving further color into print strength and duration of influence.
Liquidity prints are backtested using price rate of change, print invalidation mark and peak magnitude metrics.
Liquidity prints can be backtested and utilized in any other Tradingview script, including mechanic strategies utilizing Tradingview's native backtester.
Liquidity prints are detected using price action based methodology. They principally work on any chart or timeframe, including charts with no volume data.
Liquidity prints are activated real-time after a confirmed bar close and are not repainted.
For practical guide with practical examples, see last section.
Accessing script 🔑
See "Author's instructions" section, found at bottom of the script page.
Disclaimer
Liquidity prints are not buy/sell signals, a standalone trading strategy or financial advice. They also do not substitute knowing how to trade. Example charts and ideas shown for use cases are textbook examples under ideal conditions, not guaranteed to repeat as they are presented. Liquidity prints notify when a set of conditions (various reversal patterns, overextended price etc.) are in place from a purely technical standpoint. Liquidity prints should be viewed as one tool providing one kind of evidence, to be used in conjunction with other means of analysis.
Liquidity print quality is backtested using metrics that reasonably depict their expected behaviour, such as historical likelihood of price slowing down or turning shortly after a print. Print quality metrics are not intended to be elaborate and perfect, but to serve as a general barometer for print feedback. Backtesting is done first and foremost to exclude scenarios where prints clearly don't work or work suboptimally, in which case they can't be considered as valid evidence. Even when print metrics indicate historical reactions of good quality, price impact can and inevitably does deviate from the expected. Past results do not guarantee future performance.
- Example charts
Chart #1: BTCUSDT
Chart #2: DXY
Chart #3: NQ futures
Chart #4: Crude oil futures
Chart #5: Custom timeframes
- Print confluence
Attributes that make prints ideal in one way or another are marked separately as print confluence, giving clue into potential strength and duration of print influence. Prints with important or multiple confluence factors can be considered as heavier and more reliable evidence of price being on a path of resistance. Users can choose which confluence to show/hide (by default all) and set a minimum amount of confluence for confluence text to activate (by default 1).
Confluence type #1: Trend extensions
Price trending for abnormally long time doesn't happen too often and requires effort to sustain. Prints taking place at extended trends often have a longer duration influence, indicating a potential larger scale topping/bottoming process being close. Trend extension confluence is indicated using a numbered label, equal to amount of bars price has been in a trending state.
Confluence type #2: Consecutive prints
Prints that take place consecutively imply heavier resistance ahead, as required conditions trigger multiple times within a short period. Consecutive prints tend to lead to more clean, aggressive and heavier magnitude reactions relative to prints with no confluence. Consecutive print confluence is indicated using a numbered label with an x in front, equal to amount of prints that have taken place consecutively.
Confluence type #3: Deviations
When price closes above/below prior print highs/lows and closes right back in with a print, odds are some market participants are stuck in an awkward position. When market participants are stuck, potential for a snowball effect of covering underwater positions is higher, driving price further away. Prints into deviations act similarly to consecutive prints, elevating potential for more aggressive reactions relative to prints with no confluence. Deviation confluence is indicated using a label with a curve symbol.
- Backtesting
Built-in backtesting is based on metrics that are considered to reasonably quantify expected behaviour of prints. Main purpose of the metrics is to form a general barometer for monitoring whether or not prints can be viewed as valid evidence. When prints are clearly not working optimally, one should adjust expectations accordingly or take action to improve print performance. To make any valid conclusions of print performance, sample size should also be significant enough to eliminate randomness effectively. If sample size on any individual chart is insufficient, one should view feedback scores on multiple correlating and comparable charts to make up for the loss.
For more elaborate backtesting, prints can be used in any other script that has a source input, including fully mechanic strategies utilizing Tradingview's native backtester. Print plots are created separately for regular prints and prints with each type of confluence.
Print feedback
Print feedback is monitored for 3 bars following a print. Feedback is considered to be 100% successful when all 3/3 bars show a supportive reaction. When 2/3 bars are supportive, feedback rate is 66%, 1/3 bars = 33% and 0/3 = 0%. After print backtesting period is finished, performance of given print is added to average calculations.
Metric #1 : Rate of change
Rate of change used for backtesting is based on OHLC4 average (open + high + low + close / 4) with a length of 3. Rate of change trending up is considered valid feedback for bullish liquidity prints, trending down for bearish liquidity prints. Note that trending rate of change does not always correlate with trending price, but sometimes simply means current trend in price is slowing down.
Metric #2 : Invalidation mark
Print invalidation marks are set at print low/high with a little bit of "wiggle room". Wiggle room applied is always 1/10th of print bar range. E.g. for a bullish print with bar range of 2%, invalidation mark is set to 0.20% below print low. For most prints this is practically at print low/high, but in the case of prints with high volatility a more noticeable excess is given, due to the expectation of greater adverse reaction without necessarily meaning invalidation. A low being above invalidation mark is considered valid feedback for bullish prints and a high being below invalidation mark for bearish prints.
Metric #3 : Peak increase/decrease
Unlike prior two metrics, peak increase/decrease is not feedback the same way, but rather an assisting factor to be viewed with feedback scores. Peak increase/decrease is measured from print close to highest high/lowest low during backtesting period and added to average calculations
Feedback scores
When liquidity prints are working optimally, quality threshold for both feedback metrics are met. By default, threshold is set to 66%, indicating valid feedback on 2/3 of backtesting periods on average. When threshold is met, a tick will appear next to feedback scores, otherwise an exclamation mark indicating suboptimal performance on either or both.
By default, the prints are filtered as little as possible, idea behind being that it is better to have more poor prints filtered with discretion/mechanically afterwards than potentially filtering too much from the get go. Sometimes filtering is insufficient, leading to failed reactions beyond a tolerable level. When this is the case, print sensitivity can be adjusted via input menu, separately for bullish and bearish prints. Print filter sensitivity ranges from 1 to 5, by default set to 1. Lower sensitivity sets looser criteria for print activation, higher sensitivity sets stricter criteria. For most charts and timeframes default sensitivity works just fine, but when this is not the case, filters can be tweaked in search of better settings. If feedback score threshold is met, it's better to keep filter sensitivity intact and use discretion, which is much more nuanced and capable than any mechanical process. If feedback scores are still insufficient after tweaking, depending on the severity of lack, prints should be vetted extra carefully using other means of analysis or simply avoided.
Verifying backtest calculations
Backtest metrics can be toggled on via input menu, separately for bullish and bearish prints. When toggled on, both cumulative and average counters used in print backtesting will appear on "Data Window" tab. Calculation states are shown at a point in time where cursor is hovered. E.g. when hovering cursor on 4th of January 2021, backtest calculations as they were during this date will be shown. Backtest calculations are updated after backtest period of a print has finished (3 bars). Assisting backtest visuals are also plotted on chart to ease inspection.
- Alerts
Available alerts are the following.
- Bullish/bearish liquidity print
- Bullish/bearish liquidity print with specified print confluence
- Bullish/bearish liquidity print with set minimum print confluence amount exceeded
- Visuals
Visual impact of prints can be managed by adjusting width and length via input menu. Length of prints is available in 3 modes (1-3 from shortest to longest) and width in 10 modes (1-10 from narrowest to widest).
Print confluence text can be embedded inside print nodes, eliminating visuals outside the chart.
Metric table is available in two themes, Classic and Stealth.
Metric table can be offsetted horizontally or vertically from any four corners of the chart, allowing space for tables from other scripts.
Table sizes, label sizes and colors are fully customizable via input menu.
-Practical guide
Key in maximizing success with prints is knowing when they are likely reliable and when not. In general, the more volatile and ranging the market regime, the better liquidity prints will work. Any type of volatile spike in price, parabola or a clean range is where liquidity prints provide optimal feedback. On the other hand low volatility and trending environments are suboptimal and tend to provide more mute/lagged or completely failed feedback. Anomalies such as market wide crashes are also environments where prints can't be expected to work reliably.
Being aware of events on multiple timeframes is crucial for establishing bias for any individual timeframe. Not often it makes sense to go against higher timeframe moves on lower timeframes and this principle of timeframe hierarchy also applies to prints. In other words, higher timeframe prints dictate likelihood of successful prints on lower timeframes. If hard way on a weekly chart is up, same likely applies to daily chart during weekly print influence time. In such scenarios, it's best to not swim in upstream and avoid contradicting lower timeframe prints, at least until clear evidence suggesting otherwise has developed.
Points in price where it anyway makes sense to favor one side over the other are key points of confluence for prints as well. Prints into clean range highs/lows with clean taps can be valuable for optimal entry timing. This is especially true if simultaneously previous pivot gets taken out, increasing odds of liquidity indicated by a print being swept stop-losses.
Prints that don't match underlying bias (e.g. bullish prints at range high, bearish prints at range low) should be avoided until clear evidence has developed favoring them, such as a convincing break through a level followed by a re-test.
Prints that are immediately rejected aggressively are more likely prints that end up failing. Next bar following a print closing below print lows/above print highs is a strong hint of print failure. To consider print still valid in such cases, there should be quick and clear defending of print lows/highs. Failed prints are an inevitable bummer, but never useless. Failed prints are ideal for future reference, as liquidity still likely exists there. Re-tests into these levels often provide sensible entries.
Stacked confluence doesn't come too often and is worth paying special attention to, as multiple benefitting factors are in place simultaneously.
From a more zoomed out perspective, any larger zone with multiple prints taking place inside are potential topping/bottoming processes taking place, also worth paying attention to.
Bar metrics / quantifytools— Overview
Rather than eyeball evaluating bullishness/bearishness in any given bar, bar metrics allow a quantified approach using three basic fundamental data points: relative close, relative volatility and relative volume. These data points are visualized in a discreet data dashboard form, next to all real-time bars. Each value also has a dot in front, representing color coded extremes in the values.
Relative close represents position of bar's close relative to high and low, high of bar being 100% and low of bar being 0%. Relative close indicates strength of bulls/bears in a given bar, the higher the better for bulls, the lower the better for bears. Relative volatility (bar range, high - low) and relative volume are presented in a form of a multiplier, relative to their respective moving averages (SMA 20). A value of 1x indicates volume/volatility being on par with moving average, 2x indicates volume/volatility being twice as much as moving average and so on. Relative volume and volatility can be used for measuring general market participant interest, the "weight of the bar" as it were.
— Features
Users can gauge past bar metrics using lookback via input menu. Past bars, especially recent ones, are helpful for giving context for current bar metrics. Lookback bars are highlighted on the chart using a yellow box and metrics presented on the data dashboard with lookback symbols:
To inspect bar metric data and its implications, users can highlight bars with specified bracket values for each metric:
When bar highlighter is toggled on and desired bar metric values set, alert for the specified combination can be toggled on via alert menu. Note that bar highlighter must be enabled in order for alerts to function.
— Visuals
Bar metric dots are gradient colored the following way:
Relative volatility & volume
0x -> 1x / Neutral (white) -> Light (yellow)
1x -> 1.7x / Light (yellow) -> Medium (orange)
1.7x -> 2.4x / Medium (orange) -> Heavy (red)
Relative close
0% -> 25% / Heavy bearish (red) -> Light bearish (dark red)
25% -> 45% / Light bearish (dark red) -> Neutral (white)
45% - 55% / Neutral (white)
55% -> 75% / Neutral (white) -> Light bullish (dark green)
75% -> 100% / Light bullish (dark green) -> Heavy bullish (green)
All colors can be adjusted via input menu. Label size, label distance from bar (offset) and text format (regular/stealth) can be adjusted via input menu as well:
— Practical guide
As interpretation of bar metrics is highly contextual, it is especially important to use other means in conjunction with the metrics. Levels, oscillators, moving averages, whatever you have found useful for your process. In short, relative close indicates directional bias and relative volume/volatility indicates "weight" of directional bias.
General interpretation
High relative close, low relative volume/volatility = mildly bullish, bias up/consolidation
High relative close, medium relative volume/volatility = bullish, bias up
High relative close, high relative volume/volatility = exuberantly bullish, bias up/down depending on context
Medium relative close, low relative volume/volatility = noise, no bias
Medium relative close, medium to high relative volume/volatility = indecision, further evidence needed to evaluate bias
Low relative close, low relative volume/volatility = mildly bearish, bias down/consolidation
Low relative close, medium relative volume/volatility = bearish, bias down
Low relative close, high relative volume/volatility = exuberantly bearish, bias down/up depending on context
Nuances & considerations
As to relative close, it's important to note that each bar is a trading range when viewed on a lower timeframe, ES 1W vs. ES 4H:
When relative close is high, bulls were able to push price to range high by the time of close. When relative close is low, bears were able to push price to range low by the time of close. In other words, bulls/bears were able to gain the upper hand over a given trading range, hinting strength for the side that made the final push. When relative close is around middle range (40-60%), it can be said neither side is clearly dominating the range, hinting neutral/indecision bias from a relative close perspective.
As to relative volume/volatility, low values (less than ~0.7x) imply bar has low market participant interest and therefore is likely insignificant, as it is "lacking weight". Values close to or above 1x imply meaningful market participant interest, whereas values well above 1x (greater than ~1.3x) imply exuberance. This exuberance can manifest as initiation (beginning of a trend) or as exhaustion (end of a trend):
Fair value bands / quantifytools— Overview
Fair value bands, like other band tools, depict dynamic points in price where price behaviour is normal or abnormal, i.e. trading at/around mean (price at fair value) or deviating from mean (price outside fair value). Unlike constantly readjusting standard deviation based bands, fair value bands are designed to be smooth and constant, based on typical historical deviations. The script calculates pivots that take place above/below fair value basis and forms median deviation bands based on this information. These points are then multiplied up to 3, representing more extreme deviations.
By default, the script uses OHLC4 and SMA 20 as basis for the bands. Users can form their preferred fair value basis using following options:
Price source
- Standard OHLC values
- HL2 (High + low / 2)
- OHLC4 (Open + high + low + close / 4)
- HLC3 (High + low + close / 3)
- HLCC4 (High + low + close + close / 4)
Smoothing
- SMA
- EMA
- HMA
- RMA
- WMA
- VWMA
- Median
Once fair value basis is established, some additional customization options can be employed:
Trend mode
Direction based
Cross based
Trend modes affect fair value basis color that indicates trend direction. Direction based trend considers only the direction of the defined fair value basis, i.e. pointing up is considered an uptrend, vice versa for downtrend. Cross based trends activate when selected source (same options as price source) crosses fair value basis. These sources can be set individually for uptrend/downtrend cross conditions. By default, the script uses cross based trend mode with low and high as sources.
Cross based (downtrend not triggered) vs. direction based (downtrend triggered):
Threshold band
Threshold band is calculated using typical deviations when price is trading at fair value basis. In other words, a little bit of "wiggle room" is added around the mean based on expected deviation. This feature is useful for cross based trends, as it allows filtering insignificant crosses that are more likely just noise. By default, threshold band is calculated based on 1x median deviation from mean. Users can increase/decrease threshold band width via input menu for more/less noise filtering, e.g. 2x threshold band width would require price to cross wiggle room that is 2x wider than typical, 0x erases threshold band altogether.
Deviation bands
Width of deviation bands by default is based on 1x median deviations and can be increased/decreased in a similar manner to threshold bands.
Each combination of customization options produces varying behaviour in the bands. To measure the behaviour and finding fairest representation of fair and unfair value, some data is gathered.
— Fair value metrics
Space between each band is considered a lot, named +3, +2, +1, -1, -2, -3. For each lot, time spent and volume relative to volume moving average (SMA 20) is recorded each time price is trading in a given lot:
Depending on the asset, timeframe and chosen fair value basis, shape of the distributions vary. However, practically always time is distributed in a normal bell curve shape, being highest at lots +1 to -1, gradually decreasing the further price is from the mean. This is hardly surprising, but it allows accurately determining dynamic areas of normal and abnormal price behaviour (i.e. low risk area between +1 and -1, high risk area between +-2 to +-3). Volume on the other hand is typically distributed the other way around, being lowest at lots +1 to -1 and highest at +-2 to +-3. When time and volume are distributed like so, we can conclude that 1) price being outside fair value is a rare event and 2) the more price is outside fair value, the more anomaly behaviour in volume we tend to find.
Viewing metric calculations
Metric calculation highlights can be enabled from the input menu, resulting in a lot based coloring and visibility of each lot counter (time, cumulative relative volume and average relative volume) in data window:
— Alerts
Available alerts are the following:
Individual
- High crossing deviation band (bands +1 to +3 )
- Low crossing deviation band (bands -1 to -3 )
- Low at threshold band in an uptrend
- High at threshold band in a downtrend
- New uptrend
- New downtrend
Grouped
- New uptrend or downtrend
- Deviation band cross (+1 or -1)
- Deviation band cross (+2 or -2)
- Deviation band cross (+3 or -3)
— Practical guide
Example #1 : Risk on/risk off trend following
Ideal trend stays inside fair value and provides sufficient cool offs between the moves. When this is the case, fair value bands can be used for sensible entry/exit levels within the trend.
Example #2 : Mean reversions
When price shows exuberance into an extreme deviation, followed by a stall and signs of exhaustion (wicks), an opportunity for mean reversion emerges. The higher the deviation, the more volatility in the move, the more signalling of exhaustion, the better.
Example #3 : Tweaking bands for desired behaviour
The faster the length of fair value basis, the more momentum price needs to hit extreme deviation levels, as bands too are moving faster alongside price. Decreasing fair value basis length typically leads to more quick and aggressive deviations and less steady trends outside fair value.