OPEN-SOURCE SCRIPT

3 day look back

54
This script is designed to help traders visually compare daily liquidity behavior between two correlated assets — for example, the Nasdaq (NQ) and the S&P500 (ES).

It plots each day’s High and Low, aligned from Midnight to Midnight, with a clean session structure. This makes it easier to identify:
SMT (Smart Money Technique) divergences
liquidity grabs
daily highs/lows sweeps
relative strength/weakness between assets
intraday bias shifts based on daily structure

What the script does
Reconstructs each trading day from 00:00 to 00:00, regardless of session irregularities.
Plots the High and Low of every completed day.
Allows users to display as many past days as they want (custom “look-back” parameter).
Automatically merges the weekend with Friday for assets where Saturday/Sunday sessions are fragmented.
Includes a manual midnight offset (–12h to +12h) to fix timezone inconsistencies on TradingView charts (common on futures).
Optional real-time lines for the current day.
No excessive right-side extensions for clean intraday reading.
Why this is useful
When comparing paired assets (e.g., NQ vs ES), liquidity behavior is often different.

This script makes it easy to spot:
when one asset makes a new daily high while the other doesn’t
asymmetrical liquidity sweeps
SMT-based divergence setups
liquidity grabs at daily levels
intraday directional bias shifts

About the other indicators shown on the chart
In the example chart, two additional indicators are used only for clarity and structure:
Day of the Week — displays the weekday on each session for easier orientation.
Vertical Line Timeline — draws a clean separator line between days.
These indicators are not required for this High/Low script to work.
They simply help visually organize sessions and make daily structure easier to read when comparing two assets side by side.

How to use
Open two assets (e.g., NQ1! and ES1!) side by side.
Apply this script on both charts.
Set the same timeframe.
Choose how many days back you want to visualize (look-back parameter).
Observe how each asset interacts with its daily High/Low.
Look for SMT divergences and liquidity-based setups.

Main features
Midnight-to-Midnight alignment
Weekend fusion
Manual offset for perfect timing
Adjustable daily look-back
Clean daily liquidity
Optional dynamic daily levels
Ideal for SMT/liquidity-based intraday trading

免責聲明

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.