lib_fvgLibrary "lib_fvg"
further expansion of my object oriented library toolkit. This lib detects Fair Value Gaps and returns them as objects.
Drawing them is a separate step so the lib can be used with securities. It also allows for usage of current/close price to detect fill/invalidation of a gap and to adjust the fill level dynamically. FVGs can be detected while forming and extended indefinitely while they're unfilled.
method draw(this)
Namespace types: FVG
Parameters:
this (FVG)
method draw(fvgs)
Namespace types: FVG
Parameters:
fvgs (FVG )
is_fvg(mode, precondition, filter_insignificant, filter_insignificant_atr_factor, live)
Parameters:
mode (int) : switch for detection 1 for bullish FVGs, -1 for bearish FVGs
precondition (bool) : allows for other confluences to block/enable detection
filter_insignificant (bool) : allows to ignore small gaps
filter_insignificant_atr_factor (float) : allows to adjust how small (compared to a 50 period ATR)
live (bool) : allows to detect FVGs while the third bar is forming -> will cause repainting
Returns: a tuple of (bar_index of gap bar, gap top, gap bottom)
create_fvg(mode, idx, top, btm, filled_at_pc, config)
Parameters:
mode (int) : switch for detection 1 for bullish FVGs, -1 for bearish FVGs
idx (int) : the bar_index of the FVG gap bar
top (float) : the top level of the FVG
btm (float) : the bottom level of the FVG
filled_at_pc (float) : the ratio (0-1) that the fill source needs to retrace into the gap to consider it filled/invalidated/ready for removal
config (FVGConfig) : the plot configuration/styles for the FVG
Returns: a new FVG object if there was a new FVG, else na
detect_fvg(mode, filled_at_pc, precondition, filter_insignificant, filter_insignificant_atr_factor, live, config)
Parameters:
mode (int) : switch for detection 1 for bullish FVGs, -1 for bearish FVGs
filled_at_pc (float)
precondition (bool) : allows for other confluences to block/enable detection
filter_insignificant (bool) : allows to ignore small gaps
filter_insignificant_atr_factor (float) : allows to adjust how small (compared to a 50 period ATR)
live (bool) : allows to detect FVGs while the third bar is forming -> will cause repainting
config (FVGConfig)
Returns: a new FVG object if there was a new FVG, else na
method update(this, fill_src)
Namespace types: FVG
Parameters:
this (FVG)
fill_src (float) : allows for usage of different fill source series, e.g. high for bearish FVGs, low vor bullish FVGs or close for both
method update(all, fill_src)
Namespace types: FVG
Parameters:
all (FVG )
fill_src (float)
method remove_filled(unfilled_fvgs)
Namespace types: FVG
Parameters:
unfilled_fvgs (FVG )
method delete(this)
Namespace types: FVG
Parameters:
this (FVG)
method delete_filled_fvgs_buffered(filled_fvgs, max_keep)
Namespace types: FVG
Parameters:
filled_fvgs (FVG )
max_keep (int) : the number of filled, latest FVGs to retain on the chart.
FVGConfig
Fields:
box_args (|robbatt/lib_plot_objects/36;BoxArgs|#OBJ)
line_args (|robbatt/lib_plot_objects/36;LineArgs|#OBJ)
box_show (series__bool)
line_show (series__bool)
keep_filled (series__bool)
extend (series__bool)
FVG
Fields:
config (|FVGConfig|#OBJ)
startbar (series__integer)
mode (series__integer)
top (series__float)
btm (series__float)
center (series__float)
size (series__float)
fill_size (series__float)
fill_lvl_target (series__float)
fill_lvl_current (series__float)
fillbar (series__integer)
filled (series__bool)
_fvg_box (|robbatt/lib_plot_objects/36;Box|#OBJ)
_fill_line (|robbatt/lib_plot_objects/36;Line|#OBJ)
Fvg
Fair Value Gaps (Volumetric) | Flux Charts💎 GENERAL OVERVIEW
Introducing a brand new Fair Value Gaps (FVG) indicator, now with Volumetric Zones! You can now see the total volume of FVG zones, as well as their bullish & bearish volume ratio.
Features of the Volumetric FVG Indicator :
Render Bullish / Bearish FVG Zones
See Total Volume Of The FVG Zones
See The Ratio Of Bullish / Bearish Bar Volume Of FVG Zones
Combination Of Overlapping FVG Zones
Variety Of Zone Detection/ Sensitivity / Filtering / Invalidation Settings
High Customizability
🚩UNIQUENESS
The ability to render the total volume of FVGs as well as bullish / bearish volume ratio is what sets this FVG indicator apart from others. Also the ability to combine overlapping FVG zones will result in cleaner charts for traders.
⚙️SETTINGS
1. General Configuration
Zone Invalidation -> Select between Wick & Close price for FVG Zone Invalidation.
Zone Filtering -> With "Average Range" selected, algorithm will find FVG zones in comparison with average range of last bars in the chart. With the "Volume Threshold" option, you may select a Volume Threshold % to spot FVGs with a larger total volume than average.
FVG Detection -> With the "Same Type" option, all 3 bars that formed the FVG should be the same type. (Bullish / Bearish). If the "All" option is selected, bar types may vary between Bullish / Bearish.
Detection Sensitivity -> You may select between Low, Normal or High FVG detection sensitivity. This will essentially determine the size of the spotted FVGs, with lower sensitivities resulting in spotting bigger FVGs, and higher sensitivities resulting in spotting all sizes of FVGs.
Show Historic Zones -> If this option is on, the indicator will render invalidated FVG zones as well as current FVG zones. For a cleaner look at current FVG zones which are not invalidated yet, you can turn this option off.
IMGBasic - HTF Structure / Order Blocks / Breakers - V1.0IMG Indicators Overview
The IMG Indicators are crafted as comprehensive educational tools for price action traders. They incorporate a variety of concepts including:
1. Multiple Timeframe Analysis
2. Order Blocks (OB)
3. Breakers (BRKR)
4. Fair Value Gaps (FVGs)
5. Overlaps of OB and FVG
6. Overlaps of BRKR and FVG
7. Analysis of Internal and External Liquidity
8. Strategies for Identifying Potential Entries, Stop-loss, and Target Levels
9. Risk Management and Position Sizing
These Price Action concepts can be applied to any market (Stocks / Options / Forex / Futures / Crypto ) and any timeframe.
Introduction to the IMG Basic Indicator
The IMG Basic Indicator serves as the foundational level within the IMG suite of indicators. Its core function is to acquaint traders with elementary price action concepts such as:
1. Higher Timeframe Market Structures through Multiple Timeframe Analysis
2. Higher Timeframe Order Blocks
3. Higher Timeframe Breakers
4. Breaks in Higher Timeframe Market Structure
Higher Timeframe Market Structure:
Market Structure can be defined using several techniques. The IMG indicators employ the Close through High/Low technique, which necessitates a candle close through a structural level to validate a structural break and designate a new range.
Example: H12 Market Structure visualisation on a H12 Chart with annotations:
By selecting a particular Market Structure timeframe in the settings, the indicator immediately illustrates both current and historical market structures for the chosen timeframe across all subordinate timeframes, subject to the limitations of your Tradingview subscription.
Example: H12 Market Structure visualisation on a H1 Chart with annotations:
Higher Timeframe Order Blocks (OB)
An Order Block represents the last candle of the opposite direction preceding a Market Structure Break. For instance, a bullish Order Block is identified as the final bearish candle leading to a bullish market structure break, and vice versa for bearish Order Blocks.
Example: H12 OB visualisation on a H12 Chart with annotations:
When activated, the indicator will highlight the Higher Timeframe Order Blocks responsible for a Market Structure Break on all subordinate timeframes relative to the chosen Market Structure Timeframe.
Note: if multiple OBs exist, the indicator will display the OB closest to the new range extreme
Example: H12 OB visualisation on a H1 Chart with annotations:
Higher Timeframe Breaker Blocks (BRKR)
A Breaker Block is identified as the most recent Order Block that has been breached by price, followed by an opposite Market Structure Break. For example, a bullish Breaker Block is the last bearish Order Block that price has passed through, followed by a bullish structural break, and the inverse is true for bearish Breakers.
Example: H12 Breaker visualisation on a H12 Chart with annotations:
Once enabled, the system will display Higher Timeframe Breaker Blocks after an opposite Market Structure Break is confirmed on all subordinate timeframes.
Example: H12 Breaker visualisation on a H1 Chart with annotations:
ALERTS: Higher Timeframe Market Structure Breaks (HTF MSBs)
The system provides notifications of confirmed Market Structure Breaks based on the selected Higher Timeframe Market Structure Timeframe. For instance, selecting a weekly structure will trigger an alert when price closes through a weekly structural level, and the same logic applies to other timeframes like D, H12, H4, H1 etc.
To enable alerts, right-click on the indicator and select “Add Alert on IMG ...”. You may customise the alert name as desired and then click 'Create' to finalise the alert setup.
General Note:
There is no system, indicator, algorithm, or strategy that can provide absolute certainty in predicting market movements. Use trading indicators as a tool to assist with trading decisions and manage your risk wisely.
For a complete user manual / knowledge base on the IMG Indicators, click on the User Manual link in the signature below
Stay safe and Happy Trading!
Displacement Order Blocks ~ DOB [Liquidity_Pro]Displacement Order Blocks (DOB)
This indicator shows order blocks with displacement (FVG required) and leans heavily on ICT’s generous and insightful teachings to define midlines for FVG, IFVG, and order blocks. The market structure definitions follow TradingHub’s (TH) rules filtering out inside bars.
It offers alerts for price in order block, liquidity sweep, break of structure (BOS), change of character (CHoCH), and inducement (IDM).
The TH model was chosen because it's programmatic allowing clear structure definitions that allow us to mark inducements (S/O to @albatherium for publishing the first TH market structure indicator).
TH’s Single Candle Order Block (SCOB) rules have also been helpful in refining order block definition, for example in the Transfer case. ICT fans will see when back testing this, that it moves the focus closer to the FVG.
In developing this indicator, we've tried to offer great aesthetic flexibility, to keep the chart uncluttered and to avoid exceeding Trading View’s limitations on boxes and lines. It's also configured to work reasonably well on both light and dark background charts:
We hope this indicator can serve as a teaching tool for ICT’s price action insights and SMC market structure concepts. For this, we've included optional labels for various order block types:
I = inside bar. The bars that follow the order block have been ignored – you will see the number of ignored bars shown after a hyphen. The idea is that inside bars fall in the shadow of a more important candle and can’t be relied on for defining a trade.
S = standard case. The order block candle takes liquidity from the previous candle and is followed immediately after by an FVG on the next candle. This differs technically from the ICT “last down-close/last up-close” order block concept. In practice, this choice has very little impact on ICT trading, because the ICT trader is entering on the FVG anyway.
T = transfer case. This is an order block that has been transferred from the candle that takes liquidity to the candle just prior to the FVG. When you back test this, you will see it is a high probability choice.
TZ = tweezer. This is an option you can turn off that fills a hole in TH teachings. It bypasses the requirement for an order block to take liquidity from the previous candle in the case of equal h/ls. The result is that you will find 2 candle order blocks with equal highs and lows (also known as tweezer tops/bottoms) show on your chart. You will note that every tweezer is a wick on a higher timeframe.
W = wick. this is a big wick candle that we call an order block without requiring an FVG. The presumption is that the displacement is contained within the wick itself on a lower timeframe.
* Asterisk denotes an extreme order block.
Finally, we trade with this indicator (using it together with our Daye Quarterly Theory ~ DQT free indicator, taking trades when price reaches an extreme FVG or order block during a Q2 manipulation).
We will continue developing it along with other indicators we have not yet published. So please boost if you like this and follow us for updates. Also please let us know what new features you would like to see.
SMC Fair Value Gap[Truth Indie]FVG (Fair Value Gap)
FVG is another component used in the SMC Concept.
This indicator will help you quickly identify FVG along with customizable market structure.
HISTORY FVG SETTING
-You can choose to show or hide the FVG (Fair Value Gap).
-You can choose to expand the History FVG to the right.
-You can change the number of History Internal FVG.
-You can change the number of History External FVG.
FVG Setting
-You can adjust the strength of the imbalance candlestick.
An example:
The imbalance candlestick in the image has a strength of 124.6 times compared to the previous candlestick.
FVG TEXT/COLOR SETUP
-You can change the name of FVG.
-Adjust the font size and color.
-Adjust the color of the FVG BOX and History BOX.
Market Structure
Comprising the process of breaking the price structure, resulting in BOS (Breakout of Structure) or CHoCH (Change of Character High), and creating new High or Low based on the price structure.
Structure Setting
1.You can choose to show or hide the swing of the structure.
2.Adjust the font size and color.
3.When the market forms a price structure with High and Low, when the price moves to disrupt the structure in either direction, it will lead to BOS or CHoCH, resulting in a new High or Low. You can adjust the method of breaking the structure using the close, high, or low.
Miner Inducement Setting
4.You can choose to show or hide the Minor Inducement.
5.You can choose to show or hide the Fibo Minor Inducement.
6.When price break the price structure, a High or Low will be formed on one side, and it will lead to an Inducement Swing. When the price moves and collides, it will create a price range of High and Low. You can adjust the method of breaking the structure using the close, high, or low.
7.There is an option for testing Fibonacci (Fibo). Its function is similar to the Inducement Swing. You can adjust the Fibonacci settings.
8.Adjust the length of the Minor Inducement swing.
- In this section, it functions similarly to Pivot Points High Low, capturing swings based on the specified length.
9.Adjust Fibo Minor Inducement.
- Fibo IDM helps filter Swing IDM.
- When the market is in an uptrend, IDM will be lower than Fibo IDM.
- When the market is in a downtrend, IDM will be higher than Fibo IDM.
-Adjust the font size.
-Adjust the color of the Fibo Minor Inducement.
-Adjust the color of the Fibo for break.
-Show or hide the Label Swing.
An example of a market in a downtrend.
1. Fibo IDM filters out Swing IDM that is above the Fibo line.
2. IDM occurs above the Fibo line in a downtrending market and below the Fibo line in an uptrending market.
3. An example of the Pivot Points High Low indicator with the length set to 3.
Premium & Discount Zone
-The Premium & Discount Zone will appear based on the current price structure. It helps you see the price zones you are interested in.
-You can adjust the %Premium & Discount as needed.
-Show or hide the premium & discount zone.
-Adjust the font size.
-Adjust the color of the premium & discount zone.
HTF Fair Value Gap [LuxAlgo]The HTF Fair Value Gap indicator aims to display the exact time/price locations of fair value gaps within a higher user-selected chart timeframe.
🔶 USAGE
The indicator can be used to detect higher time frame fair value gaps. Detected historical HTF FVG are displayed as changes in chart background colors, with a green color indicating a bullish FVG and red a bearish FVG.
The most recent HTF FVG is displayed as a candle to the right of the most recent price candle. Dashed lines indicate the exact location of the FVG upper and lower extremities.
The wicks of the FVG candle indicate the price deviation from the FVG extremities after its formation and can help determine where the FVG is located within a trend.
A "Status" dashboard is included to indicate if the FVG is mitigated or not. This is also indicated by the border of the FVG candle, with a solid border indicating an unmitigated FVG.
🔶 SETTINGS
Timeframe: Chart timeframe used to retrieve the fair value gaps
🔹 Style
Offset: Offset to the right (in bars) of the FVG candle from the most recent bar.
Width: Width (in bars) of the FVG candle.
🔹 Dashboard
Show Dashboard: Determine whether to display the dashboard or not.
Location: Location of the dashboard on the chart.
Size: Size of the dashboard on the chart.
DIY Custom Strategy Builder [ZP] - v1DISCLAIMER:
This indicator as my first ever Tradingview indicator, has been developed for my personal trading analysis, consolidating various powerful indicators that I frequently use. A number of the embedded indicators within this tool are the creations of esteemed Pine Script developers from the TradingView community. In recognition of their contributions, the names of these developers will be prominently displayed alongside the respective indicator names. My selection of these indicators is rooted in my own experience and reflects those that have proven most effective for me. Please note that the past performance of any trading system or methodology is not necessarily indicative of future results. Always conduct your own research and due diligence before using any indicator or tool.
===========================================================================
Introducing the ultimate all-in-one DIY strategy builder indicator, With over 30+ famous indicators (some with custom configuration/settings) indicators included, you now have the power to mix and match to create your own custom strategy for shorter time or longer time frames depending on your trading style. Say goodbye to cluttered charts and manual/visual confirmation of multiple indicators and hello to endless possibilities with this indicator.
What it does
==================
This indicator basically help users to do 2 things:
1) Strategy Builder
With more than 30 indicators available, you can select any combination you prefer and the indicator will generate buy and sell signals accordingly. Alternative to the time-consuming process of manually confirming signals from multiple indicators! This indicator streamlines the process by automatically printing buy and sell signals based on your chosen combination of indicators. No more staring at the screen for hours on end, simply set up alerts and let the indicator do the work for you.
Available indicators that you can choose to build your strategy, are coded to seamlessly print the BUY and SELL signal upon confirmation of all selected indicators:
EMA Filter
2 EMA Cross
3 EMA Cross
Range Filter (Guikroth)
SuperTrend
Ichimoku Cloud
SuperIchi (LuxAlgo)
B-Xtrender (QuantTherapy)
Bull Bear Power Trend (Dreadblitz)
VWAP
BB Oscillator (Veryfid)
Trend Meter (Lij_MC)
Chandelier Exit (Everget)
CCI
Awesome Oscillator
DMI ( Adx )
Parabolic SAR
Waddah Attar Explosion (Shayankm)
Volatility Oscillator (Veryfid)
Damiani Volatility ( DV ) (RichardoSantos)
Stochastic
RSI
MACD
SSL Channel (ErwinBeckers)
Schaff Trend Cycle ( STC ) (LazyBear)
Chaikin Money Flow
Volume
Wolfpack Id (Darrellfischer1)
QQE Mod (Mihkhel00)
Hull Suite (Insilico)
Vortex Indicator
2) Overlay Indicators
Access the full potential of this indicator using the SWITCH BOARD section! Here, you have the ability to turn on and plot up to 14 of the included indicators on your chart. Simply select from the following options:
EMA
Support/Resistance (HeWhoMustNotBeNamed)
Supply/ Demand Zone ( SMC ) (Pmgjiv)
Parabolic SAR
Ichimoku Cloud
Superichi (LuxAlgo)
SuperTrend
Range Filter (Guikroth)
Average True Range (ATR)
VWAP
Schaff Trend Cycle ( STC ) (LazyBear)
PVSRA (TradersReality)
Liquidity Zone/Vector Candle Zone (TradersReality)
Market Sessions (Aurocks_AIF)
How it does it
==================
To explain how this indictor generate signal or does what it does, its best to put in points.
I have coded the strategy for each of the indicator, for some of the indicator you will see the option to choose strategy variation, these variants are either famous among the traders or its the ones I found more accurate based on my usage. By coding the strategy I will have the BUY and SELL signal generated by each indicator in the backend.
Next, the indicator will identify your selected LEADING INDICATOR and the CONFIRMATION INDICATOR(s).
On each candle close, the indicator will check if the selected LEADING INDICATOR generates signal (long or short).
Once the leading indicator generates the signal, then the indicator will scan each of the selected CONFIRMATION INDICATORS on candle close to check if any of the CONFIRMATION INDICATOR generated signal (long or short).
Until this point, all the process is happening in the backend, the indicator will print LONG or SHORT signal on the chart ONLY if LEADING INDICATOR and all the selected CONFIRMATION INDICATORS generates signal on candle close. example for long signal, the LEADING INDICATOR and all selected CONFIRMATION INDICATORS must print long signal.
The dashboard table will show your selected LEADING and CONFIRMATION INDICATORS and if LEADING or the CONFIRMATION INDICATORS have generated signal. Signal generated by LEADING and CONFIRMATION indicator whether long or short, is indicated by tick icon ✔. and if any of the selected CONFIRMATION or LEADING indicator does not generate signal on candle close, it will be indicated with cross symbol ✖.
how to use this indicator
==============================
Using the indicator is pretty simple, but it depends on your goal, whether you want to use it for overlaying the available indicators or using it to build your strategy or for both.
To use for Building your strategy: Select your LEADING INDICATOR, and then select your CONFIRMATION INDICATOR(s). if on candle close all the indicators generate signal, then this indicator will print SHORT or LONG signal on the chart for your entry. There are plenty of indicators you can use to build your strategy, some indicators are best for longer time frame setups while others are responsive indicators that are best for short time frame.
To use for overlaying the indicators: Open the setting of this indicator and scroll to the SWITCHBOARD section, from there you can select which indicator you want to plot on the chart.
For each of the listed indicators, you have the flexibility to customize the settings and configurations to suit your preferences. simply open indicator setting and scroll down, you will find configuration for each of the indicators used.
I will also release the Strategy Backtester for this indicator soon.
World Class SMC [WinWorld]This indicator uses valid pullbacks in order to draw market structure with strict accordance to TradingHub strategy.
Features
Our indicator uses a number of price concepts, such as:
IDM
BoS & ChoCh ( also their sweeps )
Automatic resolving of ChoCh-IDM and IDM-BoS conflicts
Orderblocks (IDM, Extreme)
True Fair Value Gaps (FVG)
True PDH/PDL
SCOB pattern
One of the core features is the ability to choose a time point, from which the market structure will be drawn. This feature alone allows you to test your most desired hypotheses about the market movements within a few clicks, so no more guesses and "what if"s, because you get the opportunity to test everything yourself and right now.
Settings
Let's review the settings themselves:
Extended Structure: allows you to choose between drawing market structure for a whole timeline or from specific time point only;
Build OB by sweeps: allows you to only draw orderblocks from candle, which took liquidity from previous candle by sweep;
Structure colours & text: allows you to customise visuals representations of market structure elements on your chart;
Structure visuals: allows you to choose which elements of market structure you want / don't want to see on your chart;
Show trend: allows you to choose the way market structure trend will be displayed on your chart: divider or background colouring ;
Alerts for each and every event , whether it is a new BoS, ChoCh, orderblock and etc.
Usage Examples
IDM Orderblock ( OB-IDM )
Basic demonstration
When price reaches OB-IDM, you will be able to receive an alert. After that, check if the candle, that reached OB-IDM, closed inside or above ( bearish scenario )/ below ( bullish scenario ) OB-IDM's boundaries. If conditions above were met, go on LTF and look for an entry.
Extreme Orderblock ( OB-EXT )
Basic demonstration
Similar to OB-IDM situation: When price reaches OB-EXT, you will be able to receive an alert. After that, check if the candle, that reached OB-EXT, closed inside or above ( bearish scenario )/ below ( bullish scenario ) OB-EXT's boundaries. If conditions above were met, go on LTF and look for an entry.
Sweep PDH/PDL
Basic demonstration
* PDH — Previous Day High
* PDL — Previous Day Low
When you received PDH sweep alert and current trend is bearish, go on LTF to find entry point. ( bullish scenario: PDL sweep and current trend is bullish )
Sweep ChoCh
Basic demonstration
If you get alert of sweeped ChoCh, it usually means that price grabbed the liquidity from extremum points and is ready to continue going with the trend. Go on LTF to find an entry.
ICT HTF FVGs (fadi)ICT HTF FVGs displays the higher timeframe FVGs on current chart. This allows the trader to easily visualize the higher timeframe FVGs without having to mark them manually and see when price reaches point of interest for possible reversals or reaction.
This indicator attempts to provide as much flexibility possible by being able to define the following:
Higher Timeframe Settings
Timeframe to monitor
Bullish FVG color for this timeframe
Bearish FVG color for this timeframe
Maximum number of FVGs to display for this timeframe
Distance from current bar. This prevents overcrowding of FVGs
Hide Lower Timeframes from current chart. If this option is turned off, 5m timeframe FVGs will be displayed on an hourly chart as an example.
Show Border for the FVGs. Border color is derived from the FVG color
Show Mitigated FVG on the chart. The labels are removed to prevent the labels from overlapping with the candles on the chart/
Show C.E. Draws a line at the middle point of the FVG. This is usually an area of interest.
Show Label Shows the label with label color, background color, and label size.
Premium Dashboard [TFO]The purpose of this indicator is to serve as a scanner/dashboard for several symbols across multiple timeframes. At the time of release, the scanner looks for the following criteria on all selected timeframes:
- Whether price is in a Fair Value Gap (FVG)
- Whether price is in an Order Block (OB)
- Current Market Structure
- Nearest Liquidity Pivots
- Proximity to said Liquidity Pivots
For FVGs, the user selects a Displacement Strength to validate FVGs from the selected timeframes; larger values require greater displacement. The table will indicate whether price is presently trading in a valid bullish FVG, bearish FVG, or none.
With OBs, the user selects a similar Displacement Strength to validate OBs from the selected timeframes. Again, larger values require greater displacement to validate an OB. The table will indicate whether price is presently trading in a bullish OB, bearish OB, or none.
For Market Structure, the table will indicate whether the current structure is bullish or bearish on each respective timeframe. A pivot strength parameter is used to determine which swing highs and swing lows warrant valid Market Structure Shifts (reversals) or Breaks of Structure (continuations).
The Liquidity section of the dashboard displays the nearest Buyside and Sellside Liquidity (major highs and lows) from each respective timeframe. A similar pivot strength parameter is used to determine how "strong" the highs and lows must be in order to be considered valid.
The Premium / Discount section offers an alternative view of the nearest Liquidity Pivots, where it will instead display a percent value to describe how close price is to Buyside or Sellside Liquidity. Values approaching 100% imply price is trading close to the nearest Buyside Liquidity, while values approaching 0% imply price is trading close to Sellside Liquidity.
Users can also choose to show any of the above features on their current chart: FVGs, OBs, cumulative Market Structure, and Liquidity, all from the various selected timeframes.
FVG w/ Fibs [QuantVue]The "FVG w/ Fibs" indicator is a trading tool designed to identify and visualize Fair Value Gaps (FVGs) while overlaying two Fibonacci retracement levels.
• Bullish FVG: Occurs when the low of the current bar is higher than the high of two bars ago, and the previous close is higher than the high of two bars ago.
• Bearish FVG: Occurs when the high of the current bar is lower than the low of two bars ago, and the previous close is lower than the low of two bars ago.
The indicator filters these gaps based on user-defined criteria such as the minimum percentage size of the gap.
Once identified, these FVGs are highlighted on the chart using customizable boxes and the 50% and 61.8% (default settings) Fibonacci retracement levels are calculated and drawn based on the size of the identified FVG.
• Dynamically updates and extends the boxes as the price evolves.
• Alerts / visual changes for FVGs that get filled.
• User option for fills by Wicks or Close
• User-customizable settings for box colors, styles, and Fibonacci level appearances
Give this indicator a BOOST and COMMENT your thoughts!
We hope you enjoy.
Cheers!
ICT Daily BiasThis indicator is based on ICT's teaching - Daily Bias. Indicator tries to predict which direction (bias) the price will move in the near future and it can tell you in which direction should you take trades on the lower timeframe (buy or sell). It works on every timeframe but best to use on 1D timeframe. It can also show historical Daily Biases. Daily Bias can be BUY, SELL or NEUTRAL. If there is NEUTRAL Daily Bias then you should not take any trade because following price direction is not clear until the Daily Bias changes to BUY or SELL.
Current Daily Bias is shown in the right bottom corner.
Daily Bias can be calculated by 2 types: Previous H/L or Previous Swing H/L.
Previous H/L:
This calculation is based on previous H/L. If actual candle reaches previous high (red line by default) or low (green line by default) with wick then price should reverse into opposite direction. If actual candle closes with body above previous high (green line by default) or below previous low (red line by default) then price should continue in current direction. There are also colorful arrows showing the following daily bias based on previous candle.
Previous Swing H/L:
This calculation is based on previous untested swing H/L. If actual candle reaches previous untested swing high (red line by default) or low (green line by default) with wick then price should reverse into opposite direction. If actual candle closes with body above previous untested swing high (green line by default) or below previous untested swing low (red line by default) then price should continue in current direction. Lookleft and lookright period (default: 3) for swing H/L can be set in indicator settings. This period tells you how many candles left and right from the swing H/L need to be higher (swing low) or lower (swing high). Previous tested swing H/L are labeled by colorful (yellow by default) diamonds. There are also colorful arrows showing the following daily bias based on previous tested swing H/L.
All settings of this indicator should be self-explanatory and some of them have tooltips for better understanding.
MTF Fair Value Gap [BigBeluga]The MTF Fair Value Gap (FVG) indicator provides multi-timeframe options to observe lower or higher gaps in different timeframes within your current one. This can enhance the confluence in your trading decisions.
🔶 USAGE
An FVG is formed when a candle has an 'empty' body, leaving a gap. These areas are often filled before the market continues to trend in its original direction.
In practical terms, FVGs serve to highlight support areas (bullish FVGs) and resistance zones (bearish FVGs). As a gap is filled, signaling the end of the existing imbalance, it tends to foreshadow an impending price reversal.
While this approach is inherently contrarian, individuals seeking a more trend-following strategy can opt to use FVG identification as straightforward signals. This entails taking a long position upon detecting a bullish FVG and adopting a short position in the presence of a bearish FVG.
🔹 Mitigation
The mitigation point is where the user selects when the FVG is considered filled or no longer usable.
Source => Choose the candle's low/high or close as the mitigation point.
Point => Choose the FVG's mitigation point to trigger after the candle's Source has filled it. Users can choose between the middle point or the top/bottom of the FVG.
ccc
🔹 MTF
This script can display MTF FVGs from different timeframes while showing the current one. This is extremely useful as it avoids the need to switch timeframes frequently and can add significant confluence with the current FVG.
🔹 Threshold
The Threshold is an input to remove insignificant FVGs that are too small to be truly useful. Users can choose between:
Auto => Automatically remove unusable FVGs.
Manual => Set an automatic Threshold.
🔶 TIPS
Users can choose how many FVGs to display on the current chart for better visualization.
Users can choose which FVGs to display: only the current one, only MTF ones, or both.
first fvg @joshuuuThis indicator was created to display and alert the user for the first Fair Value Gap (FVG) of up to three trading sessions.
Bullish FVG occurs when the high of the first candle is lower than the low of the third candle, resulting in a price gap between them.
Conversely, a Bearish FVG takes place when the low of the first candle is higher than the high of the third candle, leading to a gap between these prices.
ICT emphasizes on three crucial timeframes: 3-4 am NY, 10-11 am NY, and 2-3 pm NY, collectively referred to as the 'silver bullet' times. The very first FVG formed during these periods can significantly impact the remainder of that trading session.
Building upon these concepts, CasperSMC developed a strategy involving buying/selling the very first FVG and placing a stop order just above/below the candle responsible for creating the FVG.
The strategy aims for a consistent 2-to-1 Reward-to-Risk ratio (2RR).
This indicator serves to support the strategy by not only displaying those fvgs but also sending alerts, reducing the need for constant screen monitoring.
Inverse FVG with Rejections [TFO]This indicator is made to look for Inverse Fair Value Gaps (IFVGs) and show rejections from relevant areas. Fair Value Gaps (FVGs) are created when there is an energetic move that leaves a gap between the preceding and following candle's wicks. When that area is violated, we may consider that area as an Inverse FVG, treating it along the lines of a "support turned resistance" type setup with proper context.
Once a Fair Value Gap (FVG) is found with sufficient user-defined displacement, it is saved until price fully closes through that area, at which point it becomes an IFVG, which is also saved until price once again closes through that area.
Users can select a specific time period from which to look for and save FVGs, such as during the New York trading session in the following example.
Lastly, users can enable rejections that look for swing lows in bullish FVGs/IFVGs and swing highs in bearish FVGs/IFVGs. The following picture shows an instance of rejections from both regular and inverse FVGs, meaning the pivots were formed in a mutually shared area between a FVG and IFVG.
MTF FVGThis script finds Imbalance (Fair Value Gap (FVG)) on multi timeframes.
If needed all TF can be used at once: 1, 3, 5, 15, 30, 45, 60, 120, 180, 240, D, W.
It finds FVG on any desired TF that is greater or equal than TF on the chart.
FVG stands for fair value gap, which is a three-candle structure that indicates an imbalance or inefficiency in the market. An imbalance means that the buying and selling is not equal, and there is a gap between the fair value and the market value of an asset. A bullish FVG shows that the market value is lower than the fair value, and a bearish FVG shows the opposite.
FVG takes place in a series of 3 candles when the middle candle gaps up or down. This signals strong buying or selling pressure in the direction of the gap. When a gap occurs the wicks of the candles do not overlap each other.
ICT Institutional Order Flow (fadi)ICT Institutional Order Flow indicator is intended to provide wholistic view to better analyze order flow and where price may go to next. The concept follows ICT principles.
ICT Market Structure
ICT breaks down Pivot points into three categories:
Short Term High/Low (STH/STL) is a 3 candle pattern with a low with higher low on each side (STL), or a high with lower high on each side (STH)
Intermediate Term High/Low (ITH/ITL) uses the calculated STH/STL and marks any STH that has lower or STH on each side, and STL that has higher STL on each side
Long Term High/Low (LTH/LTL) uses the calculated ITH/ITL and marks any ITH that has lower or ITH on each side, and ITL that has higher ITL on each side
Note: ICT also states that if a STH wicks into and closes (almost?) a FVG, he marks it as ITH even if it does not have STH on reach side. This scenario is not covered by this indicator
Liquidity
liquidity is usually present under pivot points. The more prominent the pivot point, the more likely higher values liquidity pools reside under/above it. Liquidity under ITL and LTL as an example, will have better indication of which liquidity the price may seek next.
Displacement
Displacement registers above average move in the price resulting in strong visible move. If requiring a FVG is enabled (in settings), then the displacement could possibly (but never guaranteed) be used to visually recognize a move as it develops.
Full Credit: The calculation for Displacement is derived from TFO's Visualizing Displacement
Imbalances
Imbalances can come in different forms. This indicator identifies three type of imbalances:
1. FVG
2. Volume Imbalance
3. Open Gaps
Imbalances completes the picture by help visualize strong moves, where possible pivot points may develop, and how to enter or manage a trade.
Fair Value Gap ChartThe Fair Value Gap chart is a new charting method that displays fair value gap imbalances as Japanese candlesticks, allowing traders to quickly see the evolution of historical market imbalances.
The script is additionally able to compute an exponential moving average using the imbalances as input.
🔶 USAGE
The Fair Value Gap chart allows us to quickly display historical fair value gap imbalances. This also allows for filtering out potential noisy variations, showing more compact trends.
Most like other charting methods, we can draw trendlines/patterns from the displayed results, this can be helpful to potentially predict future imbalances locations.
Users can display an exponential moving average computed from the detected fvg's imbalances. Imbalances above the ema can be indicative of an uptrend, while imbalances under the ema are indicative of a downtrend.
Note that due to pinescript limitations a maximum of 500 lines can be displayed, as such displaying the EMA prevent candle wicks from being displayed.
🔶 DETAILS
🔹 Candle Structure
The Fair Value Gap Chart is constructed by keeping a record of all detected fair value gaps on the chart. Each fvg is displayed as a candlestick, with the imbalance range representing the body of the candle, and the range of the imbalance interval being used for the wicks.
🔹 EMA Source Input
The exponential moving average uses the imbalance range to get its input source, the extremity of the range used depends on whether the fvg is bullish or bearish.
When the fvg is bullish, the maximum of the imbalance range is used as ema input, else the minimum of the fvg imbalance is used.
Liquidity Voids (FVG) [LuxAlgo]The Liquidity Voids (FVG) indicator is designed to detect liquidity voids/imbalances derived from the fair value gaps and highlight the distribution of the liquidity voids at specific price levels.
Fair value gaps and liquidity voids are both indicators of sell-side and buy-side imbalance in trading. The only difference is how they are represented in the trading chart. Liquidity voids occur when the price moves sharply in one direction forming long-range candles that have little trading activity, whilst a fair value is a gap in price.
🔶 USAGE
Liquidity can help you to determine where the price is likely to head next. In conjunction with higher timeframe market structure, and supply and demand, liquidity can give you insights into potential price movement. It's essential to practice using liquidity alongside trend analysis and supply and demand to read market conditions effectively.
The peculiar thing about liquidity voids is that they almost always fill up. And by “filling”, we mean the price returns to the origin of the gap. The reason for this is that during the gap, an imbalance is created in the asset that has to be made up for. The erasure of this gap is what we call the filling of the void. And while some voids waste no time in filling, some others take multiple periods before they get filled.
🔶 SETTINGS
The script takes into account user-defined parameters and detects the liquidity voids based on them, where detailed usage for each user-defined input parameter in indicator settings is provided with the related input's tooltip.
🔹 Liquidity Detection
Liquidity Voids Threshold: Act as a filter while detecting the Liquidity Voids. When set to 0 basically means no filtering is applied, increasing the value causes the script to check the width of the void compared to a fixed-length ATR value
Bullish: Color customization option for Bullish Liquidity Voids
Bearish: Color customization option for Bearish Liquidity Voids
Labels: Toggles the visibility of the Liquidity Void label
Filled Liquidity Voids: Toggles the visibility of the Filled Liquidity Voids
🔹 Display Options
Mode: Controls the lookback length of detection and visualization
# Bars: Lookback length customization, in case Mode is set to Present
🔶 RELATED SCRIPTS
Buyside-Sellside-Liquidity
Fair-Value-Gaps
Fair Value Gap (FVG) UnderlayBy analyzing the size and characteristics of candlestick patterns, the Fair Value Gap indicator helps traders spot potential opportunities where the price of a currency or financial asset deviates from its fair value. The FVG is represented as a percentage and displayed as columns in an underlay on the chart.
Calculation and Interpretation:
The calculation of the FVG involves evaluating the body-to-wick ratio of a candlestick. This ratio compares the size of the body (the difference between the open and close prices) to the length of the wicks (the high and low prices). A high body-to-wick ratio indicates a significant price move within the candlestick, potentially signaling a strong market sentiment. The FVG indicator compares the size of the current candlestick with the previous candlesticks over a specified lookback period, typically the last 20 to 40 candlesticks. If the current candlestick meets the criteria for a fair value gap, it is classified as either a Bearish FVG or Bullish FVG, depending on the direction of the price movement.
Interpreting the FVG is relatively straightforward. When a Bearish FVG is detected, it suggests that the price is currently lower than its fair value, indicating a potential upward price movement in the future. This could be an opportunity to consider long positions or buying opportunities. On the other hand, when a Bullish FVG is identified, it implies that the price is higher than its fair value, signaling a possible downward price correction. Traders may consider short-selling or taking profits on long positions in such scenarios.
Coloration:
The coloration of the Fair Value Gap (FVG) indicator plays a crucial role in enhancing its visual representation and aiding interpretation. When a Bearish FVG is identified, the indicator utilizes the color scheme of lime green. This color signifies the potential for an upward price movement as the current price is considered lower than its fair value. On the other hand, a Bullish FVG is represented by the vibrant color of fuchsia, indicating a potential downward price correction as the price exceeds its fair value. The coloration serves as a visual cue, making it easier for traders to quickly identify and differentiate between different types of fair value gaps on the chart. Additionally, the barcolor is aligned with the respective FVG color, providing a comprehensive view of price inefficiencies and aiding traders in their decision-making process.
Potential Applications/Strategies:
The FVG indicator can be applied in various trading strategies and situations. One possible application is in price reversion strategies. Traders can use the FVG to identify overbought or oversold conditions in the market. When a Bullish FVG occurs, it may indicate an opportunity to consider short-selling or taking profits on long positions. Similarly, a Bearish FVG can suggest a potential buying opportunity, expecting the price to revert back to its fair value.
Another application is in confirming existing trends. The FVG can act as a confirmation tool for trends identified by other indicators or analysis techniques. When a Bullish FVG aligns with an uptrend, it may strengthen the bullish bias and provide more confidence in the upward momentum. Conversely, a Bearish FVG in conjunction with a downtrend may reinforce the bearish sentiment and support the idea of further downside potential.
Parameters:
Adjusting the parameters of the FVG indicator can be beneficial based on the trader's trading style and time frame. The body-to-wick ratio threshold and lookback period can be modified to capture different types of fair value gaps and adapt to different market conditions. Shorter lookback periods may help identify more recent FVGs, which could be suitable for short-term traders, while longer periods may capture larger price inefficiencies and cater to longer-term traders.
Limitations:
However, it's important to note that the FVG indicator, like any technical analysis tool, has its limitations. It relies on historical price patterns and may not always accurately predict future price movements. The interpretation of FVGs requires careful analysis and should be used in conjunction with other indicators, technical analysis tools, and fundamental factors to make well-informed trading decisions. Traders should also exercise proper risk management and consider the overall market context when using the FVG indicator.
In conclusion, the Fair Value Gap (FVG) indicator provides traders with valuable insights into price inefficiencies and deviations from fair value. By identifying Bearish and Bullish FVGs, traders can potentially uncover trading opportunities and make more informed decisions. However, it is crucial to combine the FVG indicator with other analysis tools, conduct thorough analysis, and exercise proper risk management to achieve consistent trading success.
ICT Silver Bullet [LuxAlgo]The ICT Silver Bullet indicator is inspired from the lectures of "The Inner Circle Trader" (ICT) and highlights the Silver Bullet (SB) window which is a specific 1-hour interval where a Fair Value Gap (FVG) pattern can be formed.
When a FVG is formed during the Silver Bullet window, Support & Resistance lines will be drawn at the end of the SB session.
There are 3 different Silver Bullet windows (New York local time):
The London Open Silver Bullet (3 AM — 4 AM ~ 03:00 — 04:00)
The AM Session Silver Bullet (10 AM — 11 AM ~ 10:00 — 11:00)
The PM Session Silver Bullet (2 PM — 3 PM ~ 14:00 — 15:00)
🔶 USAGE
The ICT Silver Bullet indicator aims to provide users a comprehensive display as similar as possible to how anyone would manually draw the concept on their charts.
It's important to use anything below the 15-minute timeframe to ensure proper setups can display. In this section, we are purely using the 3-minute timeframe.
In the image below, we can see a bullish setup whereas a FVG was successfully retested during the Silver Bullet session. This was then followed by a move upwards to liquidity as our target.
Alternatively, you can also see below a bearish setup utilizing the ICT Silver Bullet indicator outlined.
At this moment, the indicator has removed all other FVGs within the Silver Bullet session & has confirmed this FVG as the retested one.
There is also a support level marked below to be used as a liquidity target as per the ICT Silver Bullet concept suggests.
In the below chart we can see 4 separate consecutive examples of bullish & bearish setups on the 3-minute chart.
🔶 CONCEPTS
This technique can visualize potential support/resistance lines, which can be used as targets.
The script contains 2 main components:
• forming of a Fair Value Gap (FVG)
• drawing support/resistance (S/R) lines
🔹 Forming of FVG
1 basic principle: when a FVG at the end of the SB session is not retraced, it will be made invisible.
Dependable on the settings, different FVG's will be shown.
• 'All FVG': all FVG's are shown, regardless the trend
• 'Only FVG's in the same direction of trend': Only FVG's are shown that are similar to the trend at that moment (trend can be visualized by enabling ' Show ' -> ' Trend ')
-> only bearish FVG when the trend is bearish vs. bullish FVG when trend is bullish
• 'strict': Besides being similar to the trend, only FVG's are shown when the closing price at the end of the SB session is:
– below the top of the FVG box (bearish FVG)
– above bottom of the FVG box (bullish FVG)
• 'super-strict': Besides being similar to the trend, only FVG's are shown when the FVG box is NOT broken
in the opposite direction AND the closing price at the end of the SB session is:
– below bottom of the FVG box (bearish FVG)
– above the top of the FVG box (bullish FVG)
' Super-Strict ' mode resembles ICT lectures the most.
🔹 Drawing support/resistance lines
When the SB session has ended, the script draws potential support/resistance lines, again, dependable on the settings.
• Previous session (any): S/R lines are fetched between current and previous session.
For example, when current session is ' AM SB Session (10 AM — 11 AM) ', then previous session is
' London Open SB (3 AM — 4 AM) ', S/R lines between these 2 sessions alone will be included.
• Previous session (similar): S/R lines are fetched between current and previous - similar - session.
For example, when current session is ' London Open SB (3 AM — 4 AM)' , only S/R lines between
current session and previous ' London Open SB (3 AM — 4 AM) ' session are included.
When a new session starts, S/R lines will be removed, except when enabling ' Keep lines (only in strict mode) '
This is not possible in ' All FVG ' or ' Only FVG's in the same direction of trend ' mode, since the chart would be cluttered.
Note that in ' All FVG ' or ' Only FVG's in the same direction of trend ' mode, both, Support/Resistance lines will be shown,
while in Strict/Super-Strict mode:
• only Support lines will be shown if a bearish FVG appears
• only Resistance lines if a bullish FVG is shown
The lines will still be drawn the the end of the SB session, when a valid FVG appears,
but the S/R lines will remain visible and keep being updated until price reaches that line.
This publication contains a "Minimum Trade Framework (mTFW)", which represents the best-case expected price delivery, this is not your actual trade entry - exit range.
• 40 ticks for index futures or indices
• 15 pips for Forex pairs.
When on ' Strict/Super-Strict ' mode, only S/R lines will be shown which are:
• higher than the lowest FVG bottom + mTFW, in a bullish scenario
• lower than the highest FVG bottom - mTFW, in a bearish scenario
When on ' All FVG/Only FVG's in the same direction of trend ' mode, or on non-Forex/Futures/Indices symbols, S/R needs to be higher/lower than SB session high/low.
🔶 SETTINGS
(Check CONCEPTS for deeper insights and explanation)
🔹 Swing settings (left): Sets the length, which will set the lookback period/sensitivity of the Zigzag patterns (which directs the trend)
🔹 Silver Bullet Session; Show SB session: show lines and labels of SB session
Labels can be disabled separately in the ' Style ' section, color is set at the ' Inputs ' section.
🔹 FVG
– Mode
• All FVG
• Only FVG's in the same direction of trend
• Strict
• Super-Strict
– Colors
– Extend: extend till last bar of SB session
🔹 Targets – support/resistance lines
– Previous session (any): S/R lines fetched between current and previous SB session
– Previous session (similar): S/R lines fetched between current and previous similar SB session
– Colors
– Keep lines (only in strict mode)
🔹 Show
– MSS ~ Session: Show Market Structure Shift , only when this happens during a SB session
– Trend: Show trend (Zigzag, colored ~ trend)
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.
Displacement (Two FVGs)A simple indicator that attempts to identify displacement in price by alerting you when two simultaneous Fair Value Gaps (FVGs) occur.
When two fair value gaps occur, the indicator will print a green bar (if bullish) or a red bar (if bearish). If you right click on the indicator you can turn on alerts that will pop up every time a dual FVG occurs.
Fair Value Gaps are most commonly used amongst price action traders and are defined as instances in which there are inefficiencies, or imbalances, in the market.
The concept for this indicator is very simple. Apply it to your chart and enable alerts on the instruments and timeframe you trade. When you get an alert, it could indicate larger players getting involved.
This is NOT a trading strategy. Its intention is to save time by alerting you to large imbalances in price on the instruments you trade.