Market Session Bias For ThinkOrSwim

antwerks

Well-known member
VIP
VIP Enthusiast
This script is designed to model intraday market behavior through the lens of session-based liquidity, manipulation, and continuation. Instead of treating every candle or breakout equally, the indicator organizes the trading day into three major institutional sessions — Asia (Tokyo), London, and New York — and tracks how price behaves relative to each session’s highs and lows. The goal is to help identify whether the market is accumulating, manipulating liquidity, expanding directionally, or trapping traders before a larger move.

SESSION AUCTION BIAS ENGINE
London Intent → NY Confirmation Framework

This script is designed to model intraday market behavior through institutional session flow, liquidity transfer, and directional continuation. Rather than treating all breakouts, reversals, and momentum candles equally, the indicator organizes the trading day into three major market sessions — Asia (Tokyo), London, and New York — and interprets how price interacts with each session’s highs, lows, and accepted value areas.

PNsUWqm.png


The framework is built around the idea that markets move through phases of balance, manipulation, intent revelation, and continuation. Instead of functioning as a traditional signal generator, the script acts as a market context and auction classification engine designed to help traders identify when institutions are accumulating inventory, trapping liquidity, confirming directional intent, or aggressively repricing the market.

CORE SESSION STRUCTURE
The script divides the trading day into three institutional sessions using EST time:
SessionTime
Asia (Tokyo)7:00 PM – 4:00 AM EST
London3:00 AM – 12:00 PM EST
New York8:00 AM – 5:00 PM EST

Each session continuously tracks:
  • session high
  • session low
  • session midpoint
  • directional acceptance/rejection
These session levels become institutional liquidity zones. Markets frequently target prior session highs and lows because these areas contain stop orders, trapped positioning, and resting liquidity.


SESSION THEORY
The framework assumes each session plays a different role in the daily auction process.

Asia Session — Balance / Inventory Building
Asia is generally treated as a balance or inventory-building session. Price often consolidates, compresses, or rotates within a relatively narrow range. The Asia high and low become important liquidity reference points for the rest of the trading day.

The script plots the Asia range in cyan/gray tones. This range acts as the initial reference for later London manipulation and New York continuation.


London Session — Intent Revelation
London is treated as the session where directional intent begins to emerge. London frequently:
  • sweeps Asia highs/lows
  • traps early positioning
  • creates liquidity grabs
  • initiates directional expansion
The script identifies several London behaviors:
London Sweep High

London trades above the Asia high but closes back below it. This often represents a failed breakout or liquidity sweep designed to trap breakout buyers.

London Sweep Low

London trades below the Asia low but reclaims back above it. This often signals seller exhaustion or trapped shorts.

London Bull Intent

London breaks above the Asia high with:
  • expansion
  • strong volume
  • VWAP acceptance
This signals bullish institutional intent.

London Bear Intent

London breaks below the Asia low with:
  • bearish expansion
  • strong volume
  • VWAP rejection
This signals bearish institutional intent.

Once established, London intent is “locked” into the system and carried forward into the New York session.


NEW YORK SESSION — CONFIRMATION OR FAILURE

The New York session determines whether London’s directional intent was valid or whether it fails.
This is one of the most important concepts in the framework.

New York does not simply create random movement — it confirms or rejects London’s auction.


MARKET PROFILES
The system classifies the day into several major profiles.


NY CONTINUATION PROFILE
A continuation profile occurs when New York confirms London’s directional move.

Bullish Continuation
Conditions:
  • London established bullish intent
  • New York holds above London highs
  • Price remains above VWAP
  • Expansion continues
This represents institutional acceptance of higher prices and often leads to trend continuation days.


Bearish Continuation
Conditions:
  • London established bearish intent
  • New York breaks lower
  • Price remains below VWAP
  • Selling pressure continues
This represents downside acceptance and institutional continuation.


DEATH PROFILE (IMPORTANT)
The Death Profile is the centerpiece bearish continuation model of the framework.
It is NOT a reversal pattern.
The Death Profile occurs when:
  1. London establishes aggressive bearish intent
  2. Price breaks below the Asia range
  3. Selling expands with volume
  4. New York confirms and continues the downside auction
  5. VWAP remains overhead and rejected
This profile represents:
  • institutional liquidation
  • downside acceptance
  • trapped longs
  • persistent sell pressure
  • trend continuation

Visually, the script highlights Death Profiles using strong bearish markers and red continuation clouds to indicate persistent downside pressure.

These are typically the strongest bearish trend days.


POWER PROFILE
The bullish equivalent of the Death Profile is the Power Profile.
This occurs when:
  1. London establishes bullish intent
  2. Price expands above the Asia range
  3. New York confirms continuation
  4. VWAP remains supportive
  5. Buyers maintain directional control

This represents aggressive bullish repricing and institutional upside continuation.


FAILED AUCTIONS / REVERSALS
The framework also tracks failed London intent.

Examples:
  • London bearish intent fails and New York reclaims above VWAP
  • London bullish intent fails and New York collapses below VWAP

These failed continuation structures often become reversal or trap days.


VISUAL INTERPRETATION
The chart is organized into a visual hierarchy designed to simplify market interpretation.

Session Clouds
Colored clouds visually define the active session ranges:
  • Asia = gray/cyan
  • London = orange/yellow
  • New York = green/red

These clouds help identify balance, expansion, and accepted value.


Arrows
Arrows identify:
  • liquidity sweeps
  • London intent triggers
  • directional continuation
Cyan and magenta arrows represent manipulation sweeps.
Green and red arrows represent directional continuation.


Squares
Squares identify confirmed continuation profiles:
  • red squares = Death Profile
  • green squares = Power Profile
These are higher-confidence continuation conditions.


Labels
Labels summarize the active market condition:
  • SESSION NEUTRAL
  • LONDON BEAR INTENT ACTIVE
  • NY CONTINUATION BULL
  • DEATH PROFILE
  • POWER PROFILE
  • FAILED REVERSAL
The labels are intended to provide top-down context rather than precise entry signals.


VWAP INTERPRETATION
VWAP is integrated as a directional acceptance filter.

Above VWAP
  • bullish acceptance
  • buyers in control
  • upside continuation more likely
Below VWAP
  • bearish acceptance
  • sellers in control
  • downside continuation more likely
The interaction between session structure and VWAP is critical to the framework.


BEST USAGE
The script works best as a:
  • market context engine
  • auction framework
  • session continuation model
rather than as a standalone buy/sell indicator.
It is designed to answer:
  • Which side controls the auction?
  • Is London revealing true intent?
  • Is New York confirming or rejecting that intent?
  • Is the market balanced or repricing?
The framework is most effective on:
  • 5-minute
  • 10-minute
  • 15-minute
  • 30-minute charts
and performs best during active institutional trading hours.


IDEAL INTEGRATIONS
The framework becomes significantly stronger when combined with:
  • VWAP / AVWAP
  • Darvas structure
  • Fair Value Gaps (FVG)
  • Volume participation
  • Expansion/compression logic
  • Trap reclaim systems
  • EMA structure
The goal is not prediction.
The goal is identifying:
  • acceptance
  • rejection
  • continuation
  • failed auctions
  • institutional directional intent
before the majority of participants recognize the move.


Code:
#=========================================================
# SESSION AUCTION BIAS ENGINE
# Asia Range → London Intent → NY Continuation / Death Profile
# ANTWERKS FRAMEWORK
#=========================================================

declare upper;

#========================
# INPUTS
#========================
input showAsia = yes;
input showLondon = yes;
input showNY = yes;
input showClouds = yes;
input showLabels = yes;
input showSignals = yes;
input showVerticalLines = yes;

input volLength = 20;
input expansionLength = 20;
input expansionMultiplier = 1.20;

#========================
# SESSION TIMES EST
#========================
def asiaStart = 1900;
def asiaEnd   = 0400;

def londonStart = 0300;
def londonEnd   = 1200;

def nyStart = 0800;
def nyEnd   = 1700;

#========================
# SESSION DETECTION
#========================
def asiaSession =
    SecondsFromTime(asiaStart) >= 0 or
    SecondsTillTime(asiaEnd) > 0;

def londonSession =
    SecondsFromTime(londonStart) >= 0 and
    SecondsTillTime(londonEnd) > 0;

def nySession =
    SecondsFromTime(nyStart) >= 0 and
    SecondsTillTime(nyEnd) > 0;

def newAsia = asiaSession and !asiaSession[1];
def newLondon = londonSession and !londonSession[1];
def newNY = nySession and !nySession[1];

#========================
# CORE
#========================
def c = close;
def o = open;
def h = high;
def l = low;
def v = volume;

def avgVol = Average(v, volLength);
def strongVol = v > avgVol;

def barRange = h - l;
def avgRange = Average(TrueRange(h, c, l), expansionLength);

def bullExpansion =
    c > o and
    barRange > avgRange * expansionMultiplier and
    strongVol;

def bearExpansion =
    c < o and
    barRange > avgRange * expansionMultiplier and
    strongVol;

def vwapLine = VWAP();
def aboveVWAP = c > vwapLine;
def belowVWAP = c < vwapLine;

#========================
# ASIA HIGH / LOW
#========================
rec asiaHigh =
    if newAsia then h
    else if asiaSession then Max(h, asiaHigh[1])
    else asiaHigh[1];

rec asiaLow =
    if newAsia then l
    else if asiaSession then Min(l, asiaLow[1])
    else asiaLow[1];

def asiaMid = (asiaHigh + asiaLow) / 2;

#========================
# LONDON HIGH / LOW
#========================
rec londonHigh =
    if newLondon then h
    else if londonSession then Max(h, londonHigh[1])
    else londonHigh[1];

rec londonLow =
    if newLondon then l
    else if londonSession then Min(l, londonLow[1])
    else londonLow[1];

def londonMid = (londonHigh + londonLow) / 2;

#========================
# NY HIGH / LOW
#========================
rec nyHigh =
    if newNY then h
    else if nySession then Max(h, nyHigh[1])
    else nyHigh[1];

rec nyLow =
    if newNY then l
    else if nySession then Min(l, nyLow[1])
    else nyLow[1];

#========================
# LONDON INTENT
#========================

# London sweeps Asia high and rejects back below it
def londonSweepAsiaHigh =
    londonSession and
    h > asiaHigh[1] and
    c < asiaHigh[1];

# London sweeps Asia low and reclaims back above it
def londonSweepAsiaLow =
    londonSession and
    l < asiaLow[1] and
    c > asiaLow[1];

# London bearish intent = London breaks Asia low with expansion
def londonBearIntent =
    londonSession and
    c < asiaLow[1] and
    bearExpansion and
    belowVWAP;

# London bullish intent = London breaks Asia high with expansion
def londonBullIntent =
    londonSession and
    c > asiaHigh[1] and
    bullExpansion and
    aboveVWAP;

# Persist London intent into NY
rec londonBearIntentLocked =
    if newAsia then 0
    else if londonBearIntent then 1
    else londonBearIntentLocked[1];

rec londonBullIntentLocked =
    if newAsia then 0
    else if londonBullIntent then 1
    else londonBullIntentLocked[1];

#========================
# NY CONFIRMATION
#========================

def nyBearContinuation =
    nySession and
    londonBearIntentLocked and
    c < londonLow[1] and
    c < asiaLow[1] and
    belowVWAP;

def nyBullContinuation =
    nySession and
    londonBullIntentLocked and
    c > londonHigh[1] and
    c > asiaHigh[1] and
    aboveVWAP;

# Your clarified definition:
# Death Profile = London bearish + NY bearish continuation
def deathProfileBear =
    londonBearIntentLocked and
    nyBearContinuation;

# Bull version optional: London bullish + NY bullish continuation
def powerProfileBull =
    londonBullIntentLocked and
    nyBullContinuation;

# Reversal / trap profiles
def londonBearFailedNYReversal =
    nySession and
    londonBearIntentLocked and
    c > londonMid and
    aboveVWAP;

def londonBullFailedNYReversal =
    nySession and
    londonBullIntentLocked and
    c < londonMid and
    belowVWAP;

#========================
# CLOUD REFERENCES
#========================
def asiaHighCloud =
    if showClouds and asiaSession then asiaHigh else Double.NaN;

def asiaLowCloud =
    if showClouds and asiaSession then asiaLow else Double.NaN;

def londonHighCloud =
    if showClouds and londonSession then londonHigh else Double.NaN;

def londonLowCloud =
    if showClouds and londonSession then londonLow else Double.NaN;

def nyHighCloud =
    if showClouds and nySession then nyHigh else Double.NaN;

def nyLowCloud =
    if showClouds and nySession then nyLow else Double.NaN;

#========================
# SESSION CLOUDS
#========================
AddCloud(asiaHighCloud, asiaLowCloud, Color.DARK_GRAY, Color.DARK_GRAY);
AddCloud(londonHighCloud, londonLowCloud, Color.DARK_ORANGE, Color.DARK_ORANGE);
AddCloud(nyHighCloud, nyLowCloud, Color.DARK_GREEN, Color.DARK_GREEN);

# Death profile cloud
AddCloud(
    if deathProfileBear then h else Double.NaN,
    if deathProfileBear then l else Double.NaN,
    Color.RED,
    Color.RED
);

# Bull continuation cloud
AddCloud(
    if powerProfileBull then h else Double.NaN,
    if powerProfileBull then l else Double.NaN,
    Color.GREEN,
    Color.GREEN
);

#========================
# SESSION LEVEL PLOTS
#========================
plot AsiaHighPlot =
    if showAsia then asiaHigh else Double.NaN;
AsiaHighPlot.SetDefaultColor(Color.CYAN);
AsiaHighPlot.SetStyle(Curve.SHORT_DASH);

plot AsiaLowPlot =
    if showAsia then asiaLow else Double.NaN;
AsiaLowPlot.SetDefaultColor(Color.CYAN);
AsiaLowPlot.SetStyle(Curve.SHORT_DASH);

plot LondonHighPlot =
    if showLondon then londonHigh else Double.NaN;
LondonHighPlot.SetDefaultColor(Color.YELLOW);
LondonHighPlot.SetLineWeight(2);

plot LondonLowPlot =
    if showLondon then londonLow else Double.NaN;
LondonLowPlot.SetDefaultColor(Color.YELLOW);
LondonLowPlot.SetLineWeight(2);

plot NYHighPlot =
    if showNY then nyHigh else Double.NaN;
NYHighPlot.SetDefaultColor(Color.GREEN);
NYHighPlot.SetLineWeight(2);

plot NYLowPlot =
    if showNY then nyLow else Double.NaN;
NYLowPlot.SetDefaultColor(Color.RED);
NYLowPlot.SetLineWeight(2);

plot VWAPPlot = vwapLine;
VWAPPlot.SetDefaultColor(Color.MAGENTA);
VWAPPlot.SetLineWeight(2);

#========================
# SIGNAL MARKERS
#========================
plot LondonSweepLow =
    if showSignals and londonSweepAsiaLow then l else Double.NaN;
LondonSweepLow.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
LondonSweepLow.SetDefaultColor(Color.CYAN);
LondonSweepLow.SetLineWeight(3);

plot LondonSweepHigh =
    if showSignals and londonSweepAsiaHigh then h else Double.NaN;
LondonSweepHigh.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
LondonSweepHigh.SetDefaultColor(Color.MAGENTA);
LondonSweepHigh.SetLineWeight(3);

plot LondonBearIntentSignal =
    if showSignals and londonBearIntent then h else Double.NaN;
LondonBearIntentSignal.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
LondonBearIntentSignal.SetDefaultColor(Color.RED);
LondonBearIntentSignal.SetLineWeight(4);

plot LondonBullIntentSignal =
    if showSignals and londonBullIntent then l else Double.NaN;
LondonBullIntentSignal.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
LondonBullIntentSignal.SetDefaultColor(Color.GREEN);
LondonBullIntentSignal.SetLineWeight(4);

plot DeathProfileSignal =
    if showSignals and deathProfileBear then h else Double.NaN;
DeathProfileSignal.SetPaintingStrategy(PaintingStrategy.SQUARES);
DeathProfileSignal.SetDefaultColor(Color.RED);
DeathProfileSignal.SetLineWeight(5);

plot PowerBullSignal =
    if showSignals and powerProfileBull then l else Double.NaN;
PowerBullSignal.SetPaintingStrategy(PaintingStrategy.SQUARES);
PowerBullSignal.SetDefaultColor(Color.GREEN);
PowerBullSignal.SetLineWeight(5);

#========================
# LABELS
#========================
AddLabel(showLabels,
    if deathProfileBear then "DEATH PROFILE: LONDON BEAR + NY BEAR CONTINUATION"
    else if powerProfileBull then "POWER PROFILE: LONDON BULL + NY BULL CONTINUATION"
    else if londonBearFailedNYReversal then "NY REVERSAL: LONDON BEAR FAILED"
    else if londonBullFailedNYReversal then "NY REVERSAL: LONDON BULL FAILED"
    else if londonBearIntentLocked then "LONDON BEAR INTENT ACTIVE"
    else if londonBullIntentLocked then "LONDON BULL INTENT ACTIVE"
    else if londonSweepAsiaLow then "LONDON SWEEP ASIA LOW"
    else if londonSweepAsiaHigh then "LONDON SWEEP ASIA HIGH"
    else "SESSION NEUTRAL",
    if deathProfileBear then Color.RED
    else if powerProfileBull then Color.GREEN
    else if londonBearFailedNYReversal then Color.CYAN
    else if londonBullFailedNYReversal then Color.MAGENTA
    else if londonBearIntentLocked then Color.RED
    else if londonBullIntentLocked then Color.GREEN
    else if londonSweepAsiaLow then Color.CYAN
    else if londonSweepAsiaHigh then Color.MAGENTA
    else Color.GRAY
);

AddLabel(showLabels,
    "ASIA H/L: " + Round(asiaHigh, 2) + " / " + Round(asiaLow, 2) +
    " | LONDON H/L: " + Round(londonHigh, 2) + " / " + Round(londonLow, 2),
    Color.LIGHT_GRAY
);

#========================
# VERTICAL LINES
#========================
AddVerticalLine(showVerticalLines and SecondsFromTime(asiaStart) == 0, "ASIA", Color.CYAN);
AddVerticalLine(showVerticalLines and SecondsFromTime(londonStart) == 0, "LONDON", Color.YELLOW);
AddVerticalLine(showVerticalLines and SecondsFromTime(nyStart) == 0, "NY", Color.GREEN);

 
Last edited by a moderator:
Huge thanks to @antwerks
This study is prophetic and perfectly timed: London has become a leading indicator again because global market behavior has synchronized in a way that has not been seen in decades.

The same macro forces: rate paths, inflation regimes, energy flows, geopolitical risk, and cross‑asset hedging, currently drive every region in near‑lockstep.

Asia defines the box, London declares intent, and NY either confirms or collapses it.

For more of @antwerks work:
https://usethinkscript.com/search/2515048/?t=post&c[title_only]=1&c[users]=antwerks&o=date&g=1
 
Last edited:
Ant, This really puts the 24 hour trading day into context. I have explored /ES 15 min., and also 4500T. I lose the "market open" vertical lines, but gain a more "volume-centric" view. I guess working late at night has it's advantages! Thanks again.
 
Ant, This really puts the 24 hour trading day into context. I have explored /ES 15 min., and also 4500T. I lose the "market open" vertical lines, but gain a more "volume-centric" view. I guess working late at night has it's advantages! Thanks again.
Yes- there are many strategies in using overnight and market sessions data - here is a cool one that utilizes the Asian 2nd hour price spread.

This indicator concept is designed to visually display higher timeframe candle behavior directly on a lower timeframe chart so traders can better understand market structure and intraday bias in real time. The idea is that the user can choose any higher timeframe candle, such as the 1-hour candle, and have that candle projected onto the lower timeframe chart. For example, if viewing a 1-minute chart, the indicator would display the currently forming 1-hour candle live as price develops. The projected candle should show its open, high, low, and current body position while updating continuously throughout the hour. In the center of the candle, a countdown timer should display how much time remains before the higher timeframe candle closes.

The indicator should also provide session-based market structure logic centered around the Asian session. At 8:00 PM EST, which marks the beginning of the second hour of the Asian trading session, the script should generate a visual signal on the chart to indicate that this phase has started. The first hour of the Asian session, beginning at 7:00 PM EST, should have its high and low automatically marked and extended across the chart. These levels become important reference points because the second hour often breaks either the first hour’s high or low, creating directional bias and liquidity movement.

In addition, during the second hour of the Asian session, the script should identify the final 30 minutes of that hour and create a live box or zone around price action. For example, on a 1-minute chart, once time reaches approximately 8:30 PM EST, a box should begin forming dynamically and continue expanding with price until the second hour closes at 9:00 PM EST. This creates a visual framework for identifying compression, manipulation, or expansion during a critical intraday timing window.

Finally, the indicator should include market structure functionality similar to LuxAlgo Smart Money Concepts tools. This means the script should identify and display internal market structure shifts such as Break of Structure (BOS) and Change of Character (CHOCH). These structural signals should help traders visually understand when market direction is continuing, reversing, or transitioning between accumulation, expansion, and distribution phases.

NOTE** I may have changed some colors and or hidden some lines.
https://tos.mx/!jCq5swx9
 
I added some current session vwaps just for giggles
Code:
#=========================================================
# SESSION BIAS ENGINE v6
# Session Auction + Prior Session End Anchored VWAPs
# ANTWERKS
#=========================================================

declare upper;

#========================
# INPUTS
#========================
input showAsia = yes;
input showLondon = yes;
input showNY = yes;

input showSessionLevels = yes;
input showSessionLabels = yes;
input showVerticalLines = yes;

input showSessionAVWAPs = yes;
input limitAVWAPsToActiveWindows = yes;
input showVWAP = yes;

input showSignals = yes;
input showLocalStructureBoxes = yes;

input localBoxLookback = 20;
input minBarsInBox = 5;
input breakoutBuffer = 0.001;

input emaFastLength = 8;
input emaSlowLength = 20;

input volLength = 20;
input expansionLength = 20;
input expansionMultiplier = 1.20;

#========================
# SESSION TIMES EST
#========================
def asiaStart = 1900;
def asiaEnd   = 0400;

def londonStart = 0300;
def londonEnd   = 1200;

def nyStart = 0800;
def nyEnd   = 1700;

#========================
# AVWAP ANCHOR HANDOFF TIMES
#========================
def asiaAVWAPAnchorTime = 1700;   # starts after NY close
def londonAVWAPAnchorTime = 0400; # starts after Asia close
def nyAVWAPAnchorTime = 0800;     # starts at NY handoff/open

#========================
# SESSION DETECTION
#========================
def asiaSession =
    SecondsFromTime(asiaStart) >= 0 or
    SecondsTillTime(asiaEnd) > 0;

def londonSession =
    SecondsFromTime(londonStart) >= 0 and
    SecondsTillTime(londonEnd) > 0;

def nySession =
    SecondsFromTime(nyStart) >= 0 and
    SecondsTillTime(nyEnd) > 0;

def newAsia =
    asiaSession and !asiaSession[1];

def newLondon =
    londonSession and !londonSession[1];

def newNY =
    nySession and !nySession[1];

#========================
# CORE PRICE
#========================
def c = close;
def o = open;
def h = high;
def l = low;
def v = volume;

def atr = ATR(14);

def avgRange =
    Average(TrueRange(h, c, l), expansionLength);

def candleRange =
    h - l;

def avgVol =
    Average(v, volLength);

def strongVol =
    v > avgVol;

def vwapLine = VWAP();

def aboveVWAP =
    c > vwapLine;

def belowVWAP =
    c < vwapLine;

def emaFast =
    ExpAverage(c, emaFastLength);

def emaSlow =
    ExpAverage(c, emaSlowLength);

def bullEMA =
    emaFast > emaSlow and c > emaFast;

def bearEMA =
    emaFast < emaSlow and c < emaFast;

def bullExpansion =
    c > o and
    candleRange > avgRange * expansionMultiplier and
    strongVol;

def bearExpansion =
    c < o and
    candleRange > avgRange * expansionMultiplier and
    strongVol;

#========================
# SESSION HIGHS / LOWS
#========================
rec asiaHigh =
    if newAsia then h
    else if asiaSession then Max(h, asiaHigh[1])
    else asiaHigh[1];

rec asiaLow =
    if newAsia then l
    else if asiaSession then Min(l, asiaLow[1])
    else asiaLow[1];

rec londonHigh =
    if newLondon then h
    else if londonSession then Max(h, londonHigh[1])
    else londonHigh[1];

rec londonLow =
    if newLondon then l
    else if londonSession then Min(l, londonLow[1])
    else londonLow[1];

rec nyHigh =
    if newNY then h
    else if nySession then Max(h, nyHigh[1])
    else nyHigh[1];

rec nyLow =
    if newNY then l
    else if nySession then Min(l, nyLow[1])
    else nyLow[1];

#=========================================================
# PRIOR SESSION END ANCHORED VWAPS
#=========================================================

# Anchor triggers
def asiaAVWAPTrigger =
    SecondsFromTime(asiaAVWAPAnchorTime) >= 0 and
    SecondsFromTime(asiaAVWAPAnchorTime)[1] < 0;

def londonAVWAPTrigger =
    SecondsFromTime(londonAVWAPAnchorTime) >= 0 and
    SecondsFromTime(londonAVWAPAnchorTime)[1] < 0;

def nyAVWAPTrigger =
    SecondsFromTime(nyAVWAPAnchorTime) >= 0 and
    SecondsFromTime(nyAVWAPAnchorTime)[1] < 0;

# Active display windows
def asiaAVWAPWindow =
    SecondsFromTime(asiaAVWAPAnchorTime) >= 0 or
    SecondsTillTime(asiaEnd) > 0;

def londonAVWAPWindow =
    SecondsFromTime(londonAVWAPAnchorTime) >= 0 and
    SecondsTillTime(nyStart) > 0;

def nyAVWAPWindow =
    SecondsFromTime(nyAVWAPAnchorTime) >= 0 and
    SecondsTillTime(nyEnd) > 0;

#------------------------
# ASIA AVWAP
# starts after NY close
#------------------------
rec asiaStarted =
    if BarNumber() == 1 then 0
    else if asiaAVWAPTrigger then 1
    else asiaStarted[1];

rec asiaPV =
    if asiaAVWAPTrigger then v * c
    else if asiaStarted[1] == 1 then asiaPV[1] + v * c
    else Double.NaN;

rec asiaVol =
    if asiaAVWAPTrigger then v
    else if asiaStarted[1] == 1 then asiaVol[1] + v
    else Double.NaN;

def asiaAVWAPRaw =
    if asiaVol != 0 then asiaPV / asiaVol
    else Double.NaN;

#------------------------
# LONDON AVWAP
# starts after Asia close
#------------------------
rec londonStarted =
    if BarNumber() == 1 then 0
    else if londonAVWAPTrigger then 1
    else londonStarted[1];

rec londonPV =
    if londonAVWAPTrigger then v * c
    else if londonStarted[1] == 1 then londonPV[1] + v * c
    else Double.NaN;

rec londonVol =
    if londonAVWAPTrigger then v
    else if londonStarted[1] == 1 then londonVol[1] + v
    else Double.NaN;

def londonAVWAPRaw =
    if londonVol != 0 then londonPV / londonVol
    else Double.NaN;

#------------------------
# NY AVWAP
# starts at NY handoff/open
#------------------------
rec nyStarted =
    if BarNumber() == 1 then 0
    else if nyAVWAPTrigger then 1
    else nyStarted[1];

rec nyPV =
    if nyAVWAPTrigger then v * c
    else if nyStarted[1] == 1 then nyPV[1] + v * c
    else Double.NaN;

rec nyVol =
    if nyAVWAPTrigger then v
    else if nyStarted[1] == 1 then nyVol[1] + v
    else Double.NaN;

def nyAVWAPRaw =
    if nyVol != 0 then nyPV / nyVol
    else Double.NaN;

# Display filtered AVWAPs
def asiaAVWAP =
    if limitAVWAPsToActiveWindows and !asiaAVWAPWindow then Double.NaN
    else asiaAVWAPRaw;

def londonAVWAP =
    if limitAVWAPsToActiveWindows and !londonAVWAPWindow then Double.NaN
    else londonAVWAPRaw;

def nyAVWAP =
    if limitAVWAPsToActiveWindows and !nyAVWAPWindow then Double.NaN
    else nyAVWAPRaw;

#========================
# AVWAP STACKING
#========================
def avwapReady =
    !IsNaN(asiaAVWAPRaw) and
    !IsNaN(londonAVWAPRaw) and
    !IsNaN(nyAVWAPRaw);

def bullAVWAPStack =
    avwapReady and
    nyAVWAPRaw > londonAVWAPRaw and
    londonAVWAPRaw > asiaAVWAPRaw and
    c > nyAVWAPRaw;

def bearAVWAPStack =
    avwapReady and
    nyAVWAPRaw < londonAVWAPRaw and
    londonAVWAPRaw < asiaAVWAPRaw and
    c < nyAVWAPRaw;

def avwapCompression =
    avwapReady and
    AbsValue(nyAVWAPRaw - londonAVWAPRaw) < atr * 0.25 and
    AbsValue(londonAVWAPRaw - asiaAVWAPRaw) < atr * 0.25;

#========================
# LOCAL STRUCTURE BOXES
#========================
def localHigh =
    Highest(h, localBoxLookback);

def localLow =
    Lowest(l, localBoxLookback);

def stableHigh =
    AbsValue(localHigh - localHigh[1]) <= TickSize();

def stableLow =
    AbsValue(localLow - localLow[1]) <= TickSize();

def formingBox =
    stableHigh and stableLow;

rec boxBars =
    if formingBox then boxBars[1] + 1
    else 0;

def newBox =
    boxBars == minBarsInBox;

rec structureHigh =
    if newBox then localHigh
    else structureHigh[1];

rec structureLow =
    if newBox then localLow
    else structureLow[1];

rec structureActive =
    if BarNumber() == 1 then 0
    else if newBox then 1
    else if structureActive[1] and
        (
            c > structureHigh[1] * (1 + breakoutBuffer) or
            c < structureLow[1] * (1 - breakoutBuffer)
        )
    then 0
    else structureActive[1];

def activeStructure =
    structureActive == 1;

def structureMid =
    (structureHigh + structureLow) / 2;

def localBreakout =
    activeStructure[1] and
    c > structureHigh[1] * (1 + breakoutBuffer);

def localBreakdown =
    activeStructure[1] and
    c < structureLow[1] * (1 - breakoutBuffer);

def compressionAuction =
    activeStructure and avwapCompression;

def bullishAuction =
    bullEMA and
    bullAVWAPStack and
    (localBreakout or c > structureMid);

def bearishAuction =
    bearEMA and
    bearAVWAPStack and
    (localBreakdown or c < structureMid);

#========================
# LONDON INTENT
#========================
def londonBullIntent =
    londonSession and
    c > asiaHigh[1] and
    aboveVWAP and
    bullExpansion;

def londonBearIntent =
    londonSession and
    c < asiaLow[1] and
    belowVWAP and
    bearExpansion;

rec londonBullBias =
    if newAsia then 0
    else if londonBullIntent then 1
    else londonBullBias[1];

rec londonBearBias =
    if newAsia then 0
    else if londonBearIntent then 1
    else londonBearBias[1];

#========================
# NY CONTINUATION
#========================
def nyBullContinuation =
    nySession and
    londonBullBias == 1 and
    bullAVWAPStack and
    aboveVWAP;

def nyBearContinuation =
    nySession and
    londonBearBias == 1 and
    bearAVWAPStack and
    belowVWAP;

def powerProfile =
    nyBullContinuation and bullishAuction;

def deathProfile =
    nyBearContinuation and bearishAuction;

#========================
# PLOTS: SESSION LEVELS
#========================
plot AsiaHighPlot =
    if showSessionLevels and showAsia then asiaHigh else Double.NaN;
AsiaHighPlot.SetDefaultColor(Color.CYAN);
AsiaHighPlot.SetStyle(Curve.SHORT_DASH);

plot AsiaLowPlot =
    if showSessionLevels and showAsia then asiaLow else Double.NaN;
AsiaLowPlot.SetDefaultColor(Color.CYAN);
AsiaLowPlot.SetStyle(Curve.SHORT_DASH);

plot LondonHighPlot =
    if showSessionLevels and showLondon then londonHigh else Double.NaN;
LondonHighPlot.SetDefaultColor(Color.YELLOW);
LondonHighPlot.SetLineWeight(2);

plot LondonLowPlot =
    if showSessionLevels and showLondon then londonLow else Double.NaN;
LondonLowPlot.SetDefaultColor(Color.YELLOW);
LondonLowPlot.SetLineWeight(2);

plot NYHighPlot =
    if showSessionLevels and showNY then nyHigh else Double.NaN;
NYHighPlot.SetDefaultColor(Color.GREEN);
NYHighPlot.SetLineWeight(2);

plot NYLowPlot =
    if showSessionLevels and showNY then nyLow else Double.NaN;
NYLowPlot.SetDefaultColor(Color.RED);
NYLowPlot.SetLineWeight(2);

#========================
# PLOTS: VWAP / AVWAP
#========================
plot VWAPPlot =
    if showVWAP then vwapLine else Double.NaN;
VWAPPlot.SetDefaultColor(Color.MAGENTA);
VWAPPlot.SetLineWeight(2);

plot AsiaAVWAPPlot =
    if showSessionAVWAPs then asiaAVWAP else Double.NaN;
AsiaAVWAPPlot.SetDefaultColor(Color.CYAN);
AsiaAVWAPPlot.SetLineWeight(2);

plot LondonAVWAPPlot =
    if showSessionAVWAPs then londonAVWAP else Double.NaN;
LondonAVWAPPlot.SetDefaultColor(Color.YELLOW);
LondonAVWAPPlot.SetLineWeight(2);

plot NYAVWAPPlot =
    if showSessionAVWAPs then nyAVWAP else Double.NaN;
NYAVWAPPlot.SetDefaultColor(Color.GREEN);
NYAVWAPPlot.SetLineWeight(2);

#========================
# LOCAL STRUCTURE BOX
#========================
plot StructureHighPlot =
    if showLocalStructureBoxes and activeStructure then structureHigh else Double.NaN;
StructureHighPlot.SetDefaultColor(Color.YELLOW);
StructureHighPlot.SetLineWeight(2);

plot StructureLowPlot =
    if showLocalStructureBoxes and activeStructure then structureLow else Double.NaN;
StructureLowPlot.SetDefaultColor(Color.YELLOW);
StructureLowPlot.SetLineWeight(2);

AddCloud(
    StructureHighPlot,
    StructureLowPlot,
    Color.DARK_GRAY,
    Color.DARK_GRAY
);

AddCloud(
    if bullishAuction then StructureHighPlot else Double.NaN,
    if bullishAuction then StructureLowPlot else Double.NaN,
    Color.DARK_GREEN,
    Color.DARK_GREEN
);

AddCloud(
    if bearishAuction then StructureHighPlot else Double.NaN,
    if bearishAuction then StructureLowPlot else Double.NaN,
    Color.DARK_RED,
    Color.DARK_RED
);

AddCloud(
    if compressionAuction then StructureHighPlot else Double.NaN,
    if compressionAuction then StructureLowPlot else Double.NaN,
    Color.GRAY,
    Color.GRAY
);

#========================
# SIGNALS
#========================
def newBullAuction =
    bullishAuction and !bullishAuction[1];

def newBearAuction =
    bearishAuction and !bearishAuction[1];

plot BullAuctionSignal =
    if showSignals and newBullAuction then l else Double.NaN;
BullAuctionSignal.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
BullAuctionSignal.SetDefaultColor(Color.GREEN);
BullAuctionSignal.SetLineWeight(3);

plot BearAuctionSignal =
    if showSignals and newBearAuction then h else Double.NaN;
BearAuctionSignal.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
BearAuctionSignal.SetDefaultColor(Color.RED);
BearAuctionSignal.SetLineWeight(3);

#========================
# LABELS
#========================
AddLabel(
    showSessionLabels,
    if bullAVWAPStack then "SESSION AVWAP STACK: BULL"
    else if bearAVWAPStack then "SESSION AVWAP STACK: BEAR"
    else if avwapCompression then "SESSION AVWAP STACK: COMPRESSION"
    else "SESSION AVWAP STACK: MIXED",
    if bullAVWAPStack then Color.GREEN
    else if bearAVWAPStack then Color.RED
    else if avwapCompression then Color.YELLOW
    else Color.GRAY
);

AddLabel(
    showSessionLabels,
    if powerProfile then "POWER PROFILE"
    else if deathProfile then "DEATH PROFILE"
    else if bullishAuction then "BULLISH AUCTION"
    else if bearishAuction then "BEARISH AUCTION"
    else if compressionAuction then "COMPRESSION"
    else "SESSION NEUTRAL",
    if powerProfile then Color.GREEN
    else if deathProfile then Color.RED
    else if bullishAuction then Color.GREEN
    else if bearishAuction then Color.RED
    else if compressionAuction then Color.YELLOW
    else Color.GRAY
);

AddLabel(
    showSessionLabels,
    "ASIA H/L: " + Round(asiaHigh, 2) + " / " + Round(asiaLow, 2),
    Color.CYAN
);

AddLabel(
    showSessionLabels,
    "LONDON H/L: " + Round(londonHigh, 2) + " / " + Round(londonLow, 2),
    Color.YELLOW
);

AddLabel(
    showSessionLabels,
    "NY H/L: " + Round(nyHigh, 2) + " / " + Round(nyLow, 2),
    Color.GREEN
);

#========================
# VERTICAL LINES
#========================
AddVerticalLine(
    showVerticalLines and SecondsFromTime(asiaStart) == 0,
    "ASIA",
    Color.CYAN
);

AddVerticalLine(
    showVerticalLines and SecondsFromTime(londonStart) == 0,
    "LONDON",
    Color.YELLOW
);

AddVerticalLine(
    showVerticalLines and SecondsFromTime(nyStart) == 0,
    "NY",
    Color.GREEN
);
 
and looking back I found another that marks the sessions by @SleepyZ
Code:
#session_labels_hilo

#https://usethinkscript.com/threads/chatgpt-bard-other-ai-scripts-which-cant-be-used-in-thinkorswim.13822/page-20#post-152307
#serendipity2020
#383

#https://usethinkscript.com/threads/ny-london-asian-markets-ict-time-labels-for-thinkorswim.15632/page-2#post-142808
#post21
#SleepyZ
#Jun 13, 2024
#21


declare hide_on_daily;

input display_last_zone = yes;
input display_count     = 2;
input Show_Cloud = no;
input Show_Cloud2 = no;
input Show_Vertical_Line = yes;

def Asian_DrawLine =
#GetLastDay() and
(
!SecondsFromTime(1800) [1]
);
#AddVerticalLine (DrawLine, "", Color.Dark_black,Curve.Long_DASH);



#input ShowTodayOnly = yes;
#def Today = if GetDay() == GetLastDay() then 0 else 1;
#def Today = if GetDay() == GetLastDay() then 1 else 0;
#def Show_last = if GetDay() >= GetLastDay() then 1 else 0;

###############################################
def midn = 0000;
def midnite = if (SecondsFromTime(midn) == 0) then 1 else 0;
###############################################


#############################################################################################################
#############################################################################################################

#Q1
def Asian_Q1_afterbegin = 1800;
#def Asian_Q1_afterend = 2359;
def Asian_Q1_aftermarket = SecondsFromTime(Asian_Q1_afterbegin[1]) >= 0 and (SecondsFromTime(midn) == 0) >= 0;
def Asian_Q1_bars = 2000;

#input Asian_Q1_pricePerRowHeightMode = { AUTOMATIC, default TICKSIZE, CUSTOM};
input Asian_Q1_pricePerRowHeightMode = { TICKSIZE, default AUTOMATIC, CUSTOM};

def Asian_Q1_customRowHeight = 1.0;
input Asian_Q1_timePerProfile = {default BAR};
def Asian_Q1_onExpansion = no;
def Asian_Q1_profiles = 1000;

def Asian_Q1_period;

switch (Asian_Q1_timePerProfile) {
case BAR:
    Asian_Q1_period = BarNumber() - 1;
}


def Asian_Q1_count = CompoundValue(1, if Asian_Q1_aftermarket and Asian_Q1_period != Asian_Q1_period[1] then (Asian_Q1_count[1] + Asian_Q1_period - Asian_Q1_period[1]) % Asian_Q1_bars else Asian_Q1_count[1], 0);
def Asian_Q1_cond = Asian_Q1_count < Asian_Q1_count[1] + Asian_Q1_period - Asian_Q1_period[1];
def Asian_Q1_height;
switch (Asian_Q1_pricePerRowHeightMode) {
case AUTOMATIC:
    Asian_Q1_height = PricePerRow.AUTOMATIC;
case TICKSIZE:
    Asian_Q1_height = PricePerRow.TICKSIZE;
case CUSTOM:
    Asian_Q1_height = Asian_Q1_customRowHeight;
}

profile Asian_Q1_vol = VolumeProfile("startNewProfile" = Asian_Q1_cond, "onExpansion" = no, "numberOfProfiles" = 1000, "pricePerRow" = Asian_Q1_height, "value area percent" = 0);

def Asian_Q1_con = CompoundValue(1, Asian_Q1_onExpansion, no);

def Asian_Q1_hProfile = if Asian_Q1_aftermarket and IsNaN(Asian_Q1_vol.GetHighest()) and Asian_Q1_con then Asian_Q1_hProfile[1] else Asian_Q1_vol.GetHighest();
def Asian_Q1_lProfile = if Asian_Q1_aftermarket and IsNaN(Asian_Q1_vol.GetLowest()) and Asian_Q1_con then Asian_Q1_lProfile[1] else Asian_Q1_vol.GetLowest();
def Asian_Q1_plotsDomain = IsNaN(close) == Asian_Q1_onExpansion;
def Asian_Q1_ProfileHigh = if Asian_Q1_aftermarket and Asian_Q1_plotsDomain then Asian_Q1_hProfile else Double.NaN;
def Asian_Q1_ProfileLow = if Asian_Q1_aftermarket and Asian_Q1_plotsDomain then Asian_Q1_lProfile else Double.NaN;

def basis      = if TickSize() > .01 then GetYYYYMMDD() else GetDay();
def asiancount = if basis != basis[1] then  asiancount[1] + 1 else asiancount[1];
def asiancond  = HighestAll(asiancount) - asiancount + 1;
AddVerticalLine (if Show_Vertical_Line  and asiancond <= display_count then Asian_DrawLine else Double.NaN, "Asian", CreateColor(204, 255, 204), Curve.FIRM);

plot Asian_Q1_hrange = if display_last_zone and asiancond > display_count then Double.NaN else Asian_Q1_ProfileHigh;
plot Asian_Q1_lrange = if display_last_zone and asiancond > display_count  then Double.NaN else Asian_Q1_ProfileLow;
Asian_Q1_hrange.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Asian_Q1_lrange.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Asian_Q1_hrange.SetDefaultColor(CreateColor(204, 255, 204));
Asian_Q1_lrange.SetDefaultColor(CreateColor(204, 255, 204));
Asian_Q1_hrange.SetLineWeight(1);
Asian_Q1_lrange.SetLineWeight(1);
#Asian_Q1_hrange.Hide();
#Asian_Q1_lrange.Hide();

def Asian_Q1_bubblemover = 0;
def Asian_Q1_b = Asian_Q1_bubblemover;
def Asian_Q1_b1 = Asian_Q1_b + 1;


input Asian_Q1_showbubbles = no;
AddChartBubble(Asian_Q1_showbubbles and (IsNaN(Asian_Q1_hrange[Asian_Q1_b1]) and Asian_Q1_hrange[Asian_Q1_b]) , Asian_Q1_hrange, AsText(Asian_Q1_hrange), Color.LIGHT_RED);

AddChartBubble(Asian_Q1_showbubbles and (IsNaN(Asian_Q1_hrange[Asian_Q1_b1]) and Asian_Q1_hrange[Asian_Q1_b]) , Asian_Q1_lrange, AsText(Asian_Q1_lrange), Color.LIGHT_GREEN, up = no);

input Asian_Q1_showverticalline = no;
AddVerticalLine(Asian_Q1_showverticalline and Asian_Q1_hrange != Asian_Q1_hrange[1], "", Color.BLUE, stroke = Curve.FIRM);


#Addcloud(hrange, lrange, createcolor(0, 51, 51), createcolor(0, 51, 51));
AddCloud(if Show_Cloud then Asian_Q1_hrange else Double.NaN, Asian_Q1_lrange, CreateColor(204, 255, 204), CreateColor(204, 255, 204));

AddCloud(if Show_Cloud2 then Asian_Q1_hrange else Double.NaN, Asian_Q1_lrange, Color.BLACK, Color.BLACK);

#Addcloud(Asian_Q1_hrange, Asian_Q1_lrange, color.black, color.black);


###############################################################
###############################################################
###############################################################
#LONDON



def London_Q2_afterbegin = midn;
def London_Q2_afterend = 0600;
def London_Q2_aftermarket = SecondsFromTime(London_Q2_afterbegin) >= 0 and SecondsTillTime(London_Q2_afterend) >= 0;
def London_Q2_bars = 2000;

def London_DrawLine =
!SecondsFromTime(0000)[1];


#input London_Q2_pricePerRowHeightMode = { AUTOMATIC, default TICKSIZE, CUSTOM};
input London_Q2_pricePerRowHeightMode = { TICKSIZE, default AUTOMATIC, CUSTOM};

def London_Q2_customRowHeight = 1.0;
input London_Q2_timePerProfile = {default BAR};
def London_Q2_onExpansion = no;
def London_Q2_profiles = 1000;

def London_Q2_period;

switch (London_Q2_timePerProfile) {
case BAR:
    London_Q2_period = BarNumber() - 1;
}


def London_Q2_count = CompoundValue(1, if London_Q2_aftermarket and London_Q2_period != London_Q2_period[1] then (London_Q2_count[1] + London_Q2_period - London_Q2_period[1]) % London_Q2_bars else London_Q2_count[1], 0);
def London_Q2_cond = London_Q2_count < London_Q2_count[1] + London_Q2_period - London_Q2_period[1];
def London_Q2_height;
switch (London_Q2_pricePerRowHeightMode) {
case AUTOMATIC:
    London_Q2_height = PricePerRow.AUTOMATIC;
case TICKSIZE:
    London_Q2_height = PricePerRow.TICKSIZE;
case CUSTOM:
    London_Q2_height = London_Q2_customRowHeight;
}

profile London_Q2_vol = VolumeProfile("startNewProfile" = London_Q2_cond, "onExpansion" = no, "numberOfProfiles" = 1000, "pricePerRow" = London_Q2_height, "value area percent" = 0);

def London_Q2_con = CompoundValue(1, London_Q2_onExpansion, no);

def London_Q2_hProfile = if London_Q2_aftermarket and IsNaN(London_Q2_vol.GetHighest()) and London_Q2_con then London_Q2_hProfile[1] else London_Q2_vol.GetHighest();
def London_Q2_lProfile = if London_Q2_aftermarket and IsNaN(London_Q2_vol.GetLowest()) and London_Q2_con then London_Q2_lProfile[1] else London_Q2_vol.GetLowest();
def London_Q2_plotsDomain = IsNaN(close) == London_Q2_onExpansion;
def London_Q2_ProfileHigh = if London_Q2_aftermarket and London_Q2_plotsDomain then London_Q2_hProfile else Double.NaN;
def London_Q2_ProfileLow = if London_Q2_aftermarket and London_Q2_plotsDomain then London_Q2_lProfile else Double.NaN;

def londoncount = if basis != basis[1] then  londoncount[1] + 1 else londoncount[1];
def londoncond  = HighestAll(londoncount) - londoncount + 1;
AddVerticalLine (if Show_Vertical_Line  and londoncond <= display_count then London_DrawLine else Double.NaN, "London", CreateColor(153, 153 , 255), Curve.FIRM);

plot London_Q2_hrange = if display_last_zone and londoncond > display_count then Double.NaN else London_Q2_ProfileHigh;
plot London_Q2_lrange = if display_last_zone and londoncond > display_count then Double.NaN else London_Q2_ProfileLow;
London_Q2_hrange.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
London_Q2_lrange.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
London_Q2_hrange.SetDefaultColor(CreateColor(153, 153 , 255));
London_Q2_lrange.SetDefaultColor(CreateColor(153, 153 , 255));
London_Q2_hrange.SetLineWeight(1);
London_Q2_lrange.SetLineWeight(1);
#London_Q2_hrange.Hide();
#London_Q2_lrange.Hide();

def London_Q2_bubblemover = 0;
def London_Q2_b = London_Q2_bubblemover;
def London_Q2_b1 = London_Q2_b + 1;


input London_Q2_showbubbles = no;
AddChartBubble(London_Q2_showbubbles and (IsNaN(London_Q2_hrange[London_Q2_b1]) and London_Q2_hrange[London_Q2_b]) , London_Q2_hrange, AsText(London_Q2_hrange), Color.LIGHT_RED);

AddChartBubble(London_Q2_showbubbles and (IsNaN(London_Q2_hrange[London_Q2_b1]) and London_Q2_hrange[London_Q2_b]) , London_Q2_lrange, AsText(London_Q2_lrange), Color.LIGHT_GREEN, up = no);

input London_Q2_showverticalline = yes;
AddVerticalLine(London_Q2_showverticalline and London_Q2_hrange != London_Q2_hrange[1], "London ", Color.BLUE, stroke = Curve.FIRM);

#Addcloud(hrange, lrange, createcolor(0, 51, 51), createcolor(0, 51, 51));
AddCloud(if Show_Cloud then London_Q2_hrange else Double.NaN, London_Q2_lrange, CreateColor(153, 153 , 255), CreateColor(153, 153 , 255));

AddCloud(if Show_Cloud2 then London_Q2_hrange else Double.NaN, London_Q2_lrange, Color.BLACK, Color.BLACK);


#Addcloud(London_Q2_hrange, London_Q2_lrange, color.black, color.black);

#############################################################################################################
#############################################################################################################

#############################################################################################################
#############################################################################################################
def NY_DrawLine =
#GetDay() == GetLastDay() and
(
!SecondsFromTime(0600)
);

#AddVerticalLine (DrawLine, "", Color.Dark_black,Curve.Long_DASH);


def Show_last = if GetDay() == GetLastDay() then 1 else 0;

#############################################################################################################
#############################################################################################################

#Q3
def NY_Q3_afterbegin = 0600;
def NY_Q3_afterend = 1200;
def NY_Q3_aftermarket = SecondsFromTime(NY_Q3_afterbegin) >= 0 and SecondsTillTime(NY_Q3_afterend) >= 0;
def NY_Q3_bars = 2000;

#input NY_Q3_pricePerRowHeightMode = { AUTOMATIC, default TICKSIZE, CUSTOM};
input NY_Q3_pricePerRowHeightMode = { TICKSIZE, default AUTOMATIC, CUSTOM};

def NY_Q3_customRowHeight = 1.0;
input NY_Q3_timePerProfile = {default BAR};
def NY_Q3_onExpansion = no;
def NY_Q3_profiles = 1000;

def NY_Q3_period;

switch (NY_Q3_timePerProfile) {
case BAR:
    NY_Q3_period = BarNumber() - 1;
}


def NY_Q3_count = CompoundValue(1, if NY_Q3_aftermarket and NY_Q3_period != NY_Q3_period[1] then (NY_Q3_count[1] + NY_Q3_period - NY_Q3_period[1]) % NY_Q3_bars else NY_Q3_count[1], 0);
def NY_Q3_cond = NY_Q3_count < NY_Q3_count[1] + NY_Q3_period - NY_Q3_period[1];
def NY_Q3_height;
switch (NY_Q3_pricePerRowHeightMode) {
case AUTOMATIC:
    NY_Q3_height = PricePerRow.AUTOMATIC;
case TICKSIZE:
    NY_Q3_height = PricePerRow.TICKSIZE;
case CUSTOM:
    NY_Q3_height = NY_Q3_customRowHeight;
}

profile NY_Q3_vol = VolumeProfile("startNewProfile" = NY_Q3_cond, "onExpansion" = no, "numberOfProfiles" = 1000, "pricePerRow" = NY_Q3_height, "value area percent" = 0);

def NY_Q3_con = CompoundValue(1, NY_Q3_onExpansion, no);

def NY_Q3_hProfile = if NY_Q3_aftermarket and IsNaN(NY_Q3_vol.GetHighest()) and NY_Q3_con then NY_Q3_hProfile[1] else NY_Q3_vol.GetHighest();
def NY_Q3_lProfile = if NY_Q3_aftermarket and IsNaN(NY_Q3_vol.GetLowest()) and NY_Q3_con then NY_Q3_lProfile[1] else NY_Q3_vol.GetLowest();
def NY_Q3_plotsDomain = IsNaN(close) == NY_Q3_onExpansion;
def NY_Q3_ProfileHigh = if NY_Q3_aftermarket and NY_Q3_plotsDomain then NY_Q3_hProfile else Double.NaN;
def NY_Q3_ProfileLow = if NY_Q3_aftermarket and NY_Q3_plotsDomain then NY_Q3_lProfile else Double.NaN;

def nyq3count = if basis != basis[1] then  nyq3count[1] + 1 else nyq3count[1];
def nyq3cond  = HighestAll(nyq3count) - nyq3count + 1;
AddVerticalLine (if Show_Vertical_Line and nyq3cond <= display_count then NY_DrawLine else Double.NaN, "NY AM", CreateColor(0, 153, 255), Curve.FIRM);

plot NY_Q3_hrange = if display_last_zone and nyq3cond > display_count then Double.NaN else NY_Q3_ProfileHigh;
plot NY_Q3_lrange = if display_last_zone and nyq3cond > display_count then Double.NaN else NY_Q3_ProfileLow;
NY_Q3_hrange.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
NY_Q3_lrange.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
NY_Q3_hrange.SetDefaultColor(CreateColor(0, 153, 255));
NY_Q3_lrange.SetDefaultColor(CreateColor(0, 153, 255));
NY_Q3_hrange.SetLineWeight(1);
NY_Q3_lrange.SetLineWeight(1);
#NY_Q3_hrange.Hide();
#NY_Q3_lrange.Hide();

def NY_Q3_bubblemover = 0;
def NY_Q3_b = NY_Q3_bubblemover;
def NY_Q3_b1 = NY_Q3_b + 1;


input NY_Q3_showbubbles = no;
AddChartBubble(NY_Q3_showbubbles and (IsNaN(NY_Q3_hrange[NY_Q3_b1]) and NY_Q3_hrange[NY_Q3_b]) , NY_Q3_hrange, AsText(NY_Q3_hrange), Color.LIGHT_RED);

AddChartBubble(NY_Q3_showbubbles and (IsNaN(NY_Q3_hrange[NY_Q3_b1]) and NY_Q3_hrange[NY_Q3_b]) , NY_Q3_lrange, AsText(NY_Q3_lrange), Color.LIGHT_GREEN, up = no);

input NY_Q3_showverticalline = no;
AddVerticalLine(NY_Q3_showverticalline and NY_Q3_hrange != NY_Q3_hrange[1], "", Color.BLUE, stroke = Curve.FIRM);

#Addcloud(hrange, lrange, createcolor(0, 51, 51), createcolor(0, 51, 51));
AddCloud(if Show_Cloud then NY_Q3_hrange else Double.NaN, NY_Q3_lrange, CreateColor(0, 153, 255), CreateColor(0, 153, 255));

AddCloud(if Show_Cloud2 then NY_Q3_hrange else Double.NaN, NY_Q3_lrange, Color.BLACK, Color.BLACK);

#Addcloud(NY_Q3_hrange, NY_Q3_lrange, color.black, color.black);

#############################################################################################################
#############################################################################################################

def NY_PM_DrawLine =
#GetDay() == GetLastDay() and
(
!SecondsFromTime(1200)
);

#AddVerticalLine (DrawLine, "", Color.Dark_black,Curve.Long_DASH);



#############################################################################################################
#############################################################################################################

#Q4
def NY_PM_Q4_afterbegin = 1200;
def NY_PM_Q4_afterend = 1800;
def NY_PM_Q4_aftermarket = SecondsFromTime(NY_PM_Q4_afterbegin) >= 0 and SecondsTillTime(NY_PM_Q4_afterend) >= 0;
def NY_PM_Q4_bars = 2000;

#input NY_PM_Q4_pricePerRowHeightMode = { AUTOMATIC, default TICKSIZE, CUSTOM};
input NY_PM_Q4_pricePerRowHeightMode = { TICKSIZE, default AUTOMATIC, CUSTOM};

def NY_PM_Q4_customRowHeight = 1.0;
input NY_PM_Q4_timePerProfile = {default BAR};
def NY_PM_Q4_onExpansion = no;
def NY_PM_Q4_profiles = 1000;

def NY_PM_Q4_period;

switch (NY_PM_Q4_timePerProfile) {
case BAR:
    NY_PM_Q4_period = BarNumber() - 1;
}


def NY_PM_Q4_count = CompoundValue(1, if NY_PM_Q4_aftermarket and NY_PM_Q4_period != NY_PM_Q4_period[1] then (NY_PM_Q4_count[1] + NY_PM_Q4_period - NY_PM_Q4_period[1]) % NY_PM_Q4_bars else NY_PM_Q4_count[1], 0);
def NY_PM_Q4_cond = NY_PM_Q4_count < NY_PM_Q4_count[1] + NY_PM_Q4_period - NY_PM_Q4_period[1];
def NY_PM_Q4_height;
switch (NY_PM_Q4_pricePerRowHeightMode) {
case AUTOMATIC:
    NY_PM_Q4_height = PricePerRow.AUTOMATIC;
case TICKSIZE:
    NY_PM_Q4_height = PricePerRow.TICKSIZE;
case CUSTOM:
    NY_PM_Q4_height = NY_PM_Q4_customRowHeight;
}

profile NY_PM_Q4_vol = VolumeProfile("startNewProfile" = NY_PM_Q4_cond, "onExpansion" = no, "numberOfProfiles" = 1000, "pricePerRow" = NY_PM_Q4_height, "value area percent" = 0);

def NY_PM_Q4_con = CompoundValue(1, NY_PM_Q4_onExpansion, no);

def NY_PM_Q4_hProfile = if NY_PM_Q4_aftermarket and IsNaN(NY_PM_Q4_vol.GetHighest()) and NY_PM_Q4_con then NY_PM_Q4_hProfile[1] else NY_PM_Q4_vol.GetHighest();
def NY_PM_Q4_lProfile = if NY_PM_Q4_aftermarket and IsNaN(NY_PM_Q4_vol.GetLowest()) and NY_PM_Q4_con then NY_PM_Q4_lProfile[1] else NY_PM_Q4_vol.GetLowest();
def NY_PM_Q4_plotsDomain = IsNaN(close) == NY_PM_Q4_onExpansion;
def NY_PM_Q4_ProfileHigh = if NY_PM_Q4_aftermarket and NY_PM_Q4_plotsDomain then NY_PM_Q4_hProfile else Double.NaN;
def NY_PM_Q4_ProfileLow = if NY_PM_Q4_aftermarket and NY_PM_Q4_plotsDomain then NY_PM_Q4_lProfile else Double.NaN;

def nyq4count = if basis != basis[1] then  nyq4count[1] + 1 else nyq4count[1];
def nyq4cond  = HighestAll(nyq4count) - nyq4count + 1;
AddVerticalLine (if Show_Vertical_Line and nyq4cond <= display_count then NY_PM_DrawLine else Double.NaN, "NY PM", CreateColor(255, 153, 102), Curve.FIRM);


plot NY_PM_Q4_hrange = if display_last_zone and nyq4cond > display_count then Double.NaN else NY_PM_Q4_ProfileHigh;
plot NY_PM_Q4_lrange = if display_last_zone and nyq4cond > display_count then Double.NaN else NY_PM_Q4_ProfileLow;
NY_PM_Q4_hrange.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
NY_PM_Q4_lrange.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
NY_PM_Q4_hrange.SetDefaultColor(CreateColor(255, 153, 102));
NY_PM_Q4_lrange.SetDefaultColor(CreateColor(255, 153, 102));
NY_PM_Q4_hrange.SetLineWeight(1);
NY_PM_Q4_lrange.SetLineWeight(1);
#NY_PM_Q4_hrange.Hide();
#NY_PM_Q4_lrange.Hide();

def NY_PM_Q4_bubblemover = 0;
def NY_PM_Q4_b = NY_PM_Q4_bubblemover;
def NY_PM_Q4_b1 = NY_PM_Q4_b + 1;


input NY_PM_Q4_showbubbles = no;
AddChartBubble(NY_PM_Q4_showbubbles and (IsNaN(NY_PM_Q4_hrange[NY_PM_Q4_b1]) and NY_PM_Q4_hrange[NY_PM_Q4_b]) , NY_PM_Q4_hrange, AsText(NY_PM_Q4_hrange), Color.LIGHT_RED);

AddChartBubble(NY_PM_Q4_showbubbles and (IsNaN(NY_PM_Q4_hrange[NY_PM_Q4_b1]) and NY_PM_Q4_hrange[NY_PM_Q4_b]) , NY_PM_Q4_lrange, AsText(NY_PM_Q4_lrange), Color.LIGHT_GREEN, up = no);

input NY_PM_Q4_showverticalline = no;
AddVerticalLine(NY_PM_Q4_showverticalline and NY_PM_Q4_hrange != NY_PM_Q4_hrange[1], "", Color.BLUE, stroke = Curve.FIRM);

#Addcloud(hrange, lrange, createcolor(0, 51, 51), createcolor(0, 51, 51));
AddCloud(if Show_Cloud then NY_PM_Q4_hrange else Double.NaN, NY_PM_Q4_lrange, CreateColor(255, 153, 102), CreateColor(255, 153, 102));

AddCloud(if Show_Cloud2 then NY_PM_Q4_hrange else Double.NaN, NY_PM_Q4_lrange, Color.BLACK, Color.BLACK);

#Addcloud(NY_PM_Q4_hrange, NY_PM_Q4_lrange, color.black, color.black);

#############################################################################################################
#############################################################################################################

#-----------------


addlabel(1, "  ", color.black);
# Asian_Q1_ProfileHigh
# Asian_Q1_Profilelow
def asiahi = if isnan(Asian_Q1_ProfileHigh) then asiahi[1] else Asian_Q1_ProfileHigh;
def asialo = if isnan(Asian_Q1_Profilelow) then asialo[1] else Asian_Q1_Profilelow;
addlabel(1, "asia hi " + asiahi, (if isnan(Asian_Q1_ProfileHigh) then color.gray else color.yellow));
addlabel(1, "asia lo " + asialo, (if isnan(Asian_Q1_Profilelow) then color.gray else color.yellow));

addlabel(1, "  ", color.black);
#London_Q2_ProfileHigh
#London_Q2_Profilelow
def lonhi = if isnan(London_Q2_ProfileHigh) then lonhi[1] else London_Q2_ProfileHigh;
def lonlo = if isnan(London_Q2_Profilelow) then lonlo[1] else London_Q2_Profilelow;
addlabel(1, "london hi " + lonhi, (if isnan(London_Q2_ProfileHigh) then color.gray else color.yellow));
addlabel(1, "london lo " + lonlo, (if isnan(London_Q2_Profilelow) then color.gray else color.yellow));

addlabel(1, "  ", color.black);
#NY_Q3_ProfileHigh
#NY_Q3_Profilelow
def nyamhi = if isnan(NY_Q3_ProfileHigh) then nyamhi[1] else NY_Q3_ProfileHigh;
def nyamlo = if isnan(NY_Q3_Profilelow) then nyamlo[1] else NY_Q3_Profilelow;
addlabel(1, "NY am hi " + nyamhi, (if isnan(NY_Q3_ProfileHigh) then color.gray else color.yellow));
addlabel(1, "NY am lo " + nyamlo, (if isnan(NY_Q3_Profilelow) then color.gray else color.yellow));

addlabel(1, "  ", color.black);
#NY_PM_Q4_ProfileHigh
#NY_PM_Q4_Profilelow
def nypmhi = if isnan(NY_PM_Q4_ProfileHigh) then nypmhi[1] else NY_PM_Q4_ProfileHigh;
def nypmlo = if isnan(NY_PM_Q4_Profilelow) then nypmlo[1] else NY_PM_Q4_Profilelow;
addlabel(1, "NY pm hi " + nypmhi, (if isnan(NY_PM_Q4_ProfileHigh) then color.gray else color.yellow));
addlabel(1, "NY pm lo " + nypmlo, (if isnan(NY_PM_Q4_Profilelow) then color.gray else color.yellow));
addlabel(1, "  ", color.black);
#
 
Why Understanding Market Relationships Matter

Asia = setup
London = validation or fade
New York = institutional confirmation/reset

Best practical rules to be aware of:
Aligned Asia + London: higher odds of NY continuation/trend day.
Asia strong, London sells it: caution; risk of NY fade/chop.
Asia Neutral, London directional: higher odds of NY PM correction.
Asia weak, London stabilizes/reclaims: watch for NY squeeze/reversal.
Mixed Asia/London: expect rotation, failed breakouts, and level-to-level trading.
For your dashboard, the clean label could be:

GLOBAL HANDOFF:
ASIA: BULL / BEAR / MIXED
LONDON: CONFIRMS / FADES / REVERSES
NY SETUP: CONTINUATION / SQUEEZE / CHOP / RESET

One-line version: Asia sets the overnight thesis, London stress-tests it, and New York decides whether real institutional money confirms or resets the move.

 
Last edited by a moderator:
This script is designed to model intraday market behavior through the lens of session-based liquidity, manipulation, and continuation. Instead of treating every candle or breakout equally, the indicator organizes the trading day into three major institutional sessions — Asia (Tokyo), London, and New York — and tracks how price behaves relative to each session’s highs and lows. The goal is to help identify whether the market is accumulating, manipulating liquidity, expanding directionally, or trapping traders before a larger move.

SESSION AUCTION BIAS ENGINE
London Intent → NY Confirmation Framework

This script is designed to model intraday market behavior through institutional session flow, liquidity transfer, and directional continuation. Rather than treating all breakouts, reversals, and momentum candles equally, the indicator organizes the trading day into three major market sessions — Asia (Tokyo), London, and New York — and interprets how price interacts with each session’s highs, lows, and accepted value areas.

PNsUWqm.png


The framework is built around the idea that markets move through phases of balance, manipulation, intent revelation, and continuation. Instead of functioning as a traditional signal generator, the script acts as a market context and auction classification engine designed to help traders identify when institutions are accumulating inventory, trapping liquidity, confirming directional intent, or aggressively repricing the market.

CORE SESSION STRUCTURE
The script divides the trading day into three institutional sessions using EST time:
SessionTime
Asia (Tokyo)7:00 PM – 4:00 AM EST
London3:00 AM – 12:00 PM EST
New York8:00 AM – 5:00 PM EST

Each session continuously tracks:
  • session high
  • session low
  • session midpoint
  • directional acceptance/rejection
These session levels become institutional liquidity zones. Markets frequently target prior session highs and lows because these areas contain stop orders, trapped positioning, and resting liquidity.


SESSION THEORY
The framework assumes each session plays a different role in the daily auction process.

Asia Session — Balance / Inventory Building
Asia is generally treated as a balance or inventory-building session. Price often consolidates, compresses, or rotates within a relatively narrow range. The Asia high and low become important liquidity reference points for the rest of the trading day.

The script plots the Asia range in cyan/gray tones. This range acts as the initial reference for later London manipulation and New York continuation.


London Session — Intent Revelation
London is treated as the session where directional intent begins to emerge. London frequently:
  • sweeps Asia highs/lows
  • traps early positioning
  • creates liquidity grabs
  • initiates directional expansion
The script identifies several London behaviors:
London Sweep High

London trades above the Asia high but closes back below it. This often represents a failed breakout or liquidity sweep designed to trap breakout buyers.

London Sweep Low

London trades below the Asia low but reclaims back above it. This often signals seller exhaustion or trapped shorts.

London Bull Intent

London breaks above the Asia high with:
  • expansion
  • strong volume
  • VWAP acceptance
This signals bullish institutional intent.

London Bear Intent

London breaks below the Asia low with:
  • bearish expansion
  • strong volume
  • VWAP rejection
This signals bearish institutional intent.

Once established, London intent is “locked” into the system and carried forward into the New York session.


NEW YORK SESSION — CONFIRMATION OR FAILURE

The New York session determines whether London’s directional intent was valid or whether it fails.
This is one of the most important concepts in the framework.

New York does not simply create random movement — it confirms or rejects London’s auction.


MARKET PROFILES
The system classifies the day into several major profiles.


NY CONTINUATION PROFILE
A continuation profile occurs when New York confirms London’s directional move.

Bullish Continuation
Conditions:
  • London established bullish intent
  • New York holds above London highs
  • Price remains above VWAP
  • Expansion continues
This represents institutional acceptance of higher prices and often leads to trend continuation days.


Bearish Continuation
Conditions:
  • London established bearish intent
  • New York breaks lower
  • Price remains below VWAP
  • Selling pressure continues
This represents downside acceptance and institutional continuation.


DEATH PROFILE (IMPORTANT)
The Death Profile is the centerpiece bearish continuation model of the framework.
It is NOT a reversal pattern.
The Death Profile occurs when:
  1. London establishes aggressive bearish intent
  2. Price breaks below the Asia range
  3. Selling expands with volume
  4. New York confirms and continues the downside auction
  5. VWAP remains overhead and rejected
This profile represents:
  • institutional liquidation
  • downside acceptance
  • trapped longs
  • persistent sell pressure
  • trend continuation

Visually, the script highlights Death Profiles using strong bearish markers and red continuation clouds to indicate persistent downside pressure.

These are typically the strongest bearish trend days.


POWER PROFILE
The bullish equivalent of the Death Profile is the Power Profile.
This occurs when:
  1. London establishes bullish intent
  2. Price expands above the Asia range
  3. New York confirms continuation
  4. VWAP remains supportive
  5. Buyers maintain directional control

This represents aggressive bullish repricing and institutional upside continuation.


FAILED AUCTIONS / REVERSALS
The framework also tracks failed London intent.

Examples:
  • London bearish intent fails and New York reclaims above VWAP
  • London bullish intent fails and New York collapses below VWAP

These failed continuation structures often become reversal or trap days.


VISUAL INTERPRETATION
The chart is organized into a visual hierarchy designed to simplify market interpretation.

Session Clouds
Colored clouds visually define the active session ranges:
  • Asia = gray/cyan
  • London = orange/yellow
  • New York = green/red

These clouds help identify balance, expansion, and accepted value.


Arrows
Arrows identify:
  • liquidity sweeps
  • London intent triggers
  • directional continuation
Cyan and magenta arrows represent manipulation sweeps.
Green and red arrows represent directional continuation.


Squares
Squares identify confirmed continuation profiles:
  • red squares = Death Profile
  • green squares = Power Profile
These are higher-confidence continuation conditions.


Labels
Labels summarize the active market condition:
  • SESSION NEUTRAL
  • LONDON BEAR INTENT ACTIVE
  • NY CONTINUATION BULL
  • DEATH PROFILE
  • POWER PROFILE
  • FAILED REVERSAL
The labels are intended to provide top-down context rather than precise entry signals.


VWAP INTERPRETATION
VWAP is integrated as a directional acceptance filter.

Above VWAP
  • bullish acceptance
  • buyers in control
  • upside continuation more likely
Below VWAP
  • bearish acceptance
  • sellers in control
  • downside continuation more likely
The interaction between session structure and VWAP is critical to the framework.


BEST USAGE
The script works best as a:
  • market context engine
  • auction framework
  • session continuation model
rather than as a standalone buy/sell indicator.
It is designed to answer:
  • Which side controls the auction?
  • Is London revealing true intent?
  • Is New York confirming or rejecting that intent?
  • Is the market balanced or repricing?
The framework is most effective on:
  • 5-minute
  • 10-minute
  • 15-minute
  • 30-minute charts
and performs best during active institutional trading hours.


IDEAL INTEGRATIONS
The framework becomes significantly stronger when combined with:
  • VWAP / AVWAP
  • Darvas structure
  • Fair Value Gaps (FVG)
  • Volume participation
  • Expansion/compression logic
  • Trap reclaim systems
  • EMA structure
The goal is not prediction.
The goal is identifying:
  • acceptance
  • rejection
  • continuation
  • failed auctions
  • institutional directional intent
before the majority of participants recognize the move.


Code:
#=========================================================
# SESSION AUCTION BIAS ENGINE
# Asia Range → London Intent → NY Continuation / Death Profile
# ANTWERKS FRAMEWORK
#=========================================================

declare upper;

#========================
# INPUTS
#========================
input showAsia = yes;
input showLondon = yes;
input showNY = yes;
input showClouds = yes;
input showLabels = yes;
input showSignals = yes;
input showVerticalLines = yes;

input volLength = 20;
input expansionLength = 20;
input expansionMultiplier = 1.20;

#========================
# SESSION TIMES EST
#========================
def asiaStart = 1900;
def asiaEnd   = 0400;

def londonStart = 0300;
def londonEnd   = 1200;

def nyStart = 0800;
def nyEnd   = 1700;

#========================
# SESSION DETECTION
#========================
def asiaSession =
    SecondsFromTime(asiaStart) >= 0 or
    SecondsTillTime(asiaEnd) > 0;

def londonSession =
    SecondsFromTime(londonStart) >= 0 and
    SecondsTillTime(londonEnd) > 0;

def nySession =
    SecondsFromTime(nyStart) >= 0 and
    SecondsTillTime(nyEnd) > 0;

def newAsia = asiaSession and !asiaSession[1];
def newLondon = londonSession and !londonSession[1];
def newNY = nySession and !nySession[1];

#========================
# CORE
#========================
def c = close;
def o = open;
def h = high;
def l = low;
def v = volume;

def avgVol = Average(v, volLength);
def strongVol = v > avgVol;

def barRange = h - l;
def avgRange = Average(TrueRange(h, c, l), expansionLength);

def bullExpansion =
    c > o and
    barRange > avgRange * expansionMultiplier and
    strongVol;

def bearExpansion =
    c < o and
    barRange > avgRange * expansionMultiplier and
    strongVol;

def vwapLine = VWAP();
def aboveVWAP = c > vwapLine;
def belowVWAP = c < vwapLine;

#========================
# ASIA HIGH / LOW
#========================
rec asiaHigh =
    if newAsia then h
    else if asiaSession then Max(h, asiaHigh[1])
    else asiaHigh[1];

rec asiaLow =
    if newAsia then l
    else if asiaSession then Min(l, asiaLow[1])
    else asiaLow[1];

def asiaMid = (asiaHigh + asiaLow) / 2;

#========================
# LONDON HIGH / LOW
#========================
rec londonHigh =
    if newLondon then h
    else if londonSession then Max(h, londonHigh[1])
    else londonHigh[1];

rec londonLow =
    if newLondon then l
    else if londonSession then Min(l, londonLow[1])
    else londonLow[1];

def londonMid = (londonHigh + londonLow) / 2;

#========================
# NY HIGH / LOW
#========================
rec nyHigh =
    if newNY then h
    else if nySession then Max(h, nyHigh[1])
    else nyHigh[1];

rec nyLow =
    if newNY then l
    else if nySession then Min(l, nyLow[1])
    else nyLow[1];

#========================
# LONDON INTENT
#========================

# London sweeps Asia high and rejects back below it
def londonSweepAsiaHigh =
    londonSession and
    h > asiaHigh[1] and
    c < asiaHigh[1];

# London sweeps Asia low and reclaims back above it
def londonSweepAsiaLow =
    londonSession and
    l < asiaLow[1] and
    c > asiaLow[1];

# London bearish intent = London breaks Asia low with expansion
def londonBearIntent =
    londonSession and
    c < asiaLow[1] and
    bearExpansion and
    belowVWAP;

# London bullish intent = London breaks Asia high with expansion
def londonBullIntent =
    londonSession and
    c > asiaHigh[1] and
    bullExpansion and
    aboveVWAP;

# Persist London intent into NY
rec londonBearIntentLocked =
    if newAsia then 0
    else if londonBearIntent then 1
    else londonBearIntentLocked[1];

rec londonBullIntentLocked =
    if newAsia then 0
    else if londonBullIntent then 1
    else londonBullIntentLocked[1];

#========================
# NY CONFIRMATION
#========================

def nyBearContinuation =
    nySession and
    londonBearIntentLocked and
    c < londonLow[1] and
    c < asiaLow[1] and
    belowVWAP;

def nyBullContinuation =
    nySession and
    londonBullIntentLocked and
    c > londonHigh[1] and
    c > asiaHigh[1] and
    aboveVWAP;

# Your clarified definition:
# Death Profile = London bearish + NY bearish continuation
def deathProfileBear =
    londonBearIntentLocked and
    nyBearContinuation;

# Bull version optional: London bullish + NY bullish continuation
def powerProfileBull =
    londonBullIntentLocked and
    nyBullContinuation;

# Reversal / trap profiles
def londonBearFailedNYReversal =
    nySession and
    londonBearIntentLocked and
    c > londonMid and
    aboveVWAP;

def londonBullFailedNYReversal =
    nySession and
    londonBullIntentLocked and
    c < londonMid and
    belowVWAP;

#========================
# CLOUD REFERENCES
#========================
def asiaHighCloud =
    if showClouds and asiaSession then asiaHigh else Double.NaN;

def asiaLowCloud =
    if showClouds and asiaSession then asiaLow else Double.NaN;

def londonHighCloud =
    if showClouds and londonSession then londonHigh else Double.NaN;

def londonLowCloud =
    if showClouds and londonSession then londonLow else Double.NaN;

def nyHighCloud =
    if showClouds and nySession then nyHigh else Double.NaN;

def nyLowCloud =
    if showClouds and nySession then nyLow else Double.NaN;

#========================
# SESSION CLOUDS
#========================
AddCloud(asiaHighCloud, asiaLowCloud, Color.DARK_GRAY, Color.DARK_GRAY);
AddCloud(londonHighCloud, londonLowCloud, Color.DARK_ORANGE, Color.DARK_ORANGE);
AddCloud(nyHighCloud, nyLowCloud, Color.DARK_GREEN, Color.DARK_GREEN);

# Death profile cloud
AddCloud(
    if deathProfileBear then h else Double.NaN,
    if deathProfileBear then l else Double.NaN,
    Color.RED,
    Color.RED
);

# Bull continuation cloud
AddCloud(
    if powerProfileBull then h else Double.NaN,
    if powerProfileBull then l else Double.NaN,
    Color.GREEN,
    Color.GREEN
);

#========================
# SESSION LEVEL PLOTS
#========================
plot AsiaHighPlot =
    if showAsia then asiaHigh else Double.NaN;
AsiaHighPlot.SetDefaultColor(Color.CYAN);
AsiaHighPlot.SetStyle(Curve.SHORT_DASH);

plot AsiaLowPlot =
    if showAsia then asiaLow else Double.NaN;
AsiaLowPlot.SetDefaultColor(Color.CYAN);
AsiaLowPlot.SetStyle(Curve.SHORT_DASH);

plot LondonHighPlot =
    if showLondon then londonHigh else Double.NaN;
LondonHighPlot.SetDefaultColor(Color.YELLOW);
LondonHighPlot.SetLineWeight(2);

plot LondonLowPlot =
    if showLondon then londonLow else Double.NaN;
LondonLowPlot.SetDefaultColor(Color.YELLOW);
LondonLowPlot.SetLineWeight(2);

plot NYHighPlot =
    if showNY then nyHigh else Double.NaN;
NYHighPlot.SetDefaultColor(Color.GREEN);
NYHighPlot.SetLineWeight(2);

plot NYLowPlot =
    if showNY then nyLow else Double.NaN;
NYLowPlot.SetDefaultColor(Color.RED);
NYLowPlot.SetLineWeight(2);

plot VWAPPlot = vwapLine;
VWAPPlot.SetDefaultColor(Color.MAGENTA);
VWAPPlot.SetLineWeight(2);

#========================
# SIGNAL MARKERS
#========================
plot LondonSweepLow =
    if showSignals and londonSweepAsiaLow then l else Double.NaN;
LondonSweepLow.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
LondonSweepLow.SetDefaultColor(Color.CYAN);
LondonSweepLow.SetLineWeight(3);

plot LondonSweepHigh =
    if showSignals and londonSweepAsiaHigh then h else Double.NaN;
LondonSweepHigh.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
LondonSweepHigh.SetDefaultColor(Color.MAGENTA);
LondonSweepHigh.SetLineWeight(3);

plot LondonBearIntentSignal =
    if showSignals and londonBearIntent then h else Double.NaN;
LondonBearIntentSignal.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
LondonBearIntentSignal.SetDefaultColor(Color.RED);
LondonBearIntentSignal.SetLineWeight(4);

plot LondonBullIntentSignal =
    if showSignals and londonBullIntent then l else Double.NaN;
LondonBullIntentSignal.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
LondonBullIntentSignal.SetDefaultColor(Color.GREEN);
LondonBullIntentSignal.SetLineWeight(4);

plot DeathProfileSignal =
    if showSignals and deathProfileBear then h else Double.NaN;
DeathProfileSignal.SetPaintingStrategy(PaintingStrategy.SQUARES);
DeathProfileSignal.SetDefaultColor(Color.RED);
DeathProfileSignal.SetLineWeight(5);

plot PowerBullSignal =
    if showSignals and powerProfileBull then l else Double.NaN;
PowerBullSignal.SetPaintingStrategy(PaintingStrategy.SQUARES);
PowerBullSignal.SetDefaultColor(Color.GREEN);
PowerBullSignal.SetLineWeight(5);

#========================
# LABELS
#========================
AddLabel(showLabels,
    if deathProfileBear then "DEATH PROFILE: LONDON BEAR + NY BEAR CONTINUATION"
    else if powerProfileBull then "POWER PROFILE: LONDON BULL + NY BULL CONTINUATION"
    else if londonBearFailedNYReversal then "NY REVERSAL: LONDON BEAR FAILED"
    else if londonBullFailedNYReversal then "NY REVERSAL: LONDON BULL FAILED"
    else if londonBearIntentLocked then "LONDON BEAR INTENT ACTIVE"
    else if londonBullIntentLocked then "LONDON BULL INTENT ACTIVE"
    else if londonSweepAsiaLow then "LONDON SWEEP ASIA LOW"
    else if londonSweepAsiaHigh then "LONDON SWEEP ASIA HIGH"
    else "SESSION NEUTRAL",
    if deathProfileBear then Color.RED
    else if powerProfileBull then Color.GREEN
    else if londonBearFailedNYReversal then Color.CYAN
    else if londonBullFailedNYReversal then Color.MAGENTA
    else if londonBearIntentLocked then Color.RED
    else if londonBullIntentLocked then Color.GREEN
    else if londonSweepAsiaLow then Color.CYAN
    else if londonSweepAsiaHigh then Color.MAGENTA
    else Color.GRAY
);

AddLabel(showLabels,
    "ASIA H/L: " + Round(asiaHigh, 2) + " / " + Round(asiaLow, 2) +
    " | LONDON H/L: " + Round(londonHigh, 2) + " / " + Round(londonLow, 2),
    Color.LIGHT_GRAY
);

#========================
# VERTICAL LINES
#========================
AddVerticalLine(showVerticalLines and SecondsFromTime(asiaStart) == 0, "ASIA", Color.CYAN);
AddVerticalLine(showVerticalLines and SecondsFromTime(londonStart) == 0, "LONDON", Color.YELLOW);
AddVerticalLine(showVerticalLines and SecondsFromTime(nyStart) == 0, "NY", Color.GREEN);

Thank you, Thank you, Thank you! I started following this concept some time ago, but got lazy, manually making the annotations every morning, which started crowding other indicators on my chart. Thanks to your work, I now have a stand-alone chart I can look at first thing in the morning, saving time so I can focus on using my own supportive analysis to plan the trading day.
 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
2055 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top