Expected Liquidity

RickSimpson Updated   
Simple but effective script that displays Liquidity Premium/Discount areas in an adaptive way based on key Fibonacci levels.
You can increase or decrease the 'Period' value in the Settings to adjust the gap between the lines as you see fit.
By default the value is '46' which should suit most markets.

-The script contains Alerts which are triggered when a liquidity line is crossed by the price.

Good trading to all and don't forget, risk management remains the most important!
Release Notes:
-Alerts has been removed cause they are not useful for this script
Release Notes:
-Added some style options
-Logic revision
-Minor improvements
Release Notes:
-Code cleaning
Release Notes:
-Minor update
Release Notes:
-Default 'Period' option value has been set to 25 by default
Release Notes:
New Features:

Auto Period Selection: Added an option to automatically adjust the period based
on the current timeframe for optimal liquidity analysis. This feature aims to enhance user experience by reducing manual adjustments when changing timeframes or markets.

Higher Timeframe Analysis: Integrated functionality to analyze and display
liquidity levels from a higher timeframe on the current chart. This cross-timeframe analysis helps users identify broader market trends and potential liquidity zones more effectively.


Tooltip Additions: Comprehensive tooltips have been added to all input options
to provide users with clear, concise explanations, making the tool more accessible
to both novice and experienced traders.

Code Structure and Readability: The entire script has been restructured for better readability and maintainability. Spaces and grouping have been optimized to make
the code easier to navigate and understand.

Input Options Grouping: Inputs are now logically grouped into categories
like "Period Settings", "Colors Settings", and "Styles Settings", improving the user
interface and the customization process.

Technical Improvements:

Dynamic Period Calculation: The logic for auto-selecting the period has been
refined to better match the liquidity analysis with the chart's timeframe, enhancing the indicator's accuracy.

Color Transparency for Higher Timeframe Data: Lines drawn based on
higher timeframe data are now displayed with semi-transparency, distinguishing them
from the current timeframe's data for better visual differentiation.

Optimized Fibonacci Level Calculations: The calculation of Fibonacci levels
has been streamlined, and the logic for determining premium and discount liquidity levels
has been improved for greater precision.

Bug Fixes and Optimizations:

Line Extension Logic: Revised the extension logic of the liquidity level lines to ensure
they extend in the correct direction as specified by the user, eliminating previous inconsistencies.

Fractal Detection and Line Drawing: Enhanced the detection of fractals and
the conditions under which liquidity lines are drawn or updated, increasing the reliability
and performance of the indicator.


This update introduces significant enhancements to the "Expected Liquidity" indicator, focusing on user experience, analytical depth, and visual clarity. With the addition of auto period selection and higher timeframe analysis, alongside improvements in code structure
and readability, the indicator is now more versatile and user-friendly.
Tooltips and input grouping further aid in making the tool accessible to a wider range
of users, from beginners to advanced traders. These changes are designed to provide
users with a more powerful tool for identifying liquidity levels across different timeframes
and markets.
Release Notes:
-Code cleaning
Release Notes:
-Code cleaning
Release Notes:
-Minor improvement
Release Notes:
-Code cleaning
Release Notes:
-Code cleaning

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.


The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?