Order Book Ultimate# order book ultimate — synthetic depth, flow pressure and wall map
order book ultimate is a synthetic order book and market pressure tool for traders who want a visual way to study possible bid walls, ask walls, liquidity pressure, absorption, sweeps, imbalance and short-term directional bias.
this script does not read real exchange level 2 data, broker depth of market, or live limit order book data. it builds a synthetic depth model from chart price action, volume, volatility, round-number behavior, intrabar flow when available, and recent reactions around price levels. the goal is to help traders visualize where pressure may be building, where price may react, and when a setup has enough agreement between multiple conditions to deserve attention.
the script is designed as a decision-support tool, not as an automatic trading system. it should be used with market structure, risk management, and personal validation.
---
## what this script does
order book ultimate combines several components into one workflow:
* synthetic bid and ask depth levels around current price
* estimated bid/ask pressure using volume and candle position
* optional lower-timeframe intrabar flow analysis
* wall detection and wall stability tracking
* historical liquidity memory zones
* absorption detection near bid or ask walls
* bullish and bearish sweep detection
* pro score and confidence score
* market regime filter
* visual long and short setup markers
* visual stats for signal follow-up
* compact, full and debug dashboard modes
* alerts for stable walls, imbalance, setups, absorption, sweeps and invalidation
the main idea is to avoid reading one signal alone. the script looks for agreement between pressure, depth imbalance, wall strength, trend, obv flow, absorption, sweeps and market regime.
---
## important note about the order book model
this is a synthetic order book model.
it does not show the real resting orders from an exchange. instead, it estimates possible liquidity concentration by using:
* atr-based spacing
* recent volume
* candle rejection behavior
* round-number magnetism
* intrabar buy/sell pressure when available
* historical reactions around price
* volatility and market regime adjustments
because of this, the script should be treated as a market pressure map, not as real dom or level 2 data.
---
# engine modes
## engine mode
this setting controls how the script measures market pressure.
### classic synthetic
uses the current chart candles only. it estimates buy and sell pressure from candle position, volume, delta approximation and recent flow.
best for:
* higher timeframes
* symbols where lower-timeframe data is not needed
* cleaner and lighter calculations
### intrabar flow
uses lower-timeframe candles inside the current candle to estimate pressure more closely.
best for:
* scalping
* intraday trading
* checking whether the current candle has strong internal buying or selling pressure
### hybrid pro
combines classic synthetic pressure with lower-timeframe intrabar flow. this is the default balanced mode.
best for:
* most traders
* 5m, 15m, 30m and 1h charts
* users who want both stable context and intrabar sensitivity
---
## lower timeframe
this is the lower timeframe used by the intrabar flow engine.
example:
* if your chart is 15m and lower timeframe is 1m, the script studies the 1m candles inside each 15m candle.
* if your chart is 5m and lower timeframe is 1m, it studies the 1m movement inside each 5m candle.
beginner tip:
use 1m for scalping and 3m or 5m for smoother intraday reading.
---
## intrabar weight in hybrid
this controls how much the hybrid engine trusts lower-timeframe flow.
* 0.00 means almost no intrabar influence.
* 0.55 gives a balanced mix.
* 1.00 gives maximum intrabar influence.
beginner tip:
keep it near 0.50 to 0.60 for a balanced setup. raise it only if you want more reactive signals.
---
## use confirmed bars for signals
when enabled, signals only confirm after the candle closes.
this helps reduce noisy live-bar signals. when disabled, signals can appear during the current candle, but they may change before the candle closes.
beginner tip:
keep this enabled if you want cleaner signals.
---
# synthetic depth engine
## levels per side
this controls how many synthetic bid levels and ask levels are calculated around price.
* lower values make the display simpler.
* higher values create a wider synthetic depth map.
beginner tip:
15 is a good balanced setting.
---
## level spacing x atr
this controls the spacing between synthetic levels using atr.
* lower values place levels closer to current price.
* higher values spread them farther away.
beginner tip:
use lower values for scalping and higher values for swing trading.
---
## volume lookback
this sets how many candles are used to build the average volume baseline.
* shorter lookback reacts faster.
* longer lookback is smoother.
beginner tip:
100 is a balanced value for most intraday charts.
---
## refresh rate
this controls how often the synthetic depth levels refresh.
* 1 refreshes every bar.
* higher values refresh less often.
beginner tip:
keep it at 1 for active trading.
---
## depth multiplier
this increases or decreases the strength of the synthetic depth zones.
* higher values create stronger wall readings.
* lower values make the script more conservative.
beginner tip:
2.0 is a balanced default.
---
## depth decay sigma
this controls how quickly synthetic liquidity fades as price levels move farther from current price.
* lower values focus more on nearby levels.
* higher values include farther levels.
beginner tip:
use lower values for scalping and higher values for wider market context.
---
## liquidity memory bars
this tells the script how far back it should remember recent reactions around price levels.
* lower values focus on recent reactions.
* higher values keep more market memory.
beginner tip:
40 is a good starting point.
---
# round number engine
## round number magnetism
this increases the importance of round prices.
markets often react near round numbers because many traders place orders around them. this setting makes the synthetic depth engine give more weight to those areas.
beginner tip:
use higher values on indices and crypto, and lower values on forex if the levels feel too wide.
---
## auto round step
when enabled, the script automatically chooses a round-number step based on the symbol price.
beginner tip:
keep this enabled unless you know exactly which round levels you want to use.
---
## manual round step
this is used only when auto round step is disabled.
example:
* 100 for major crypto round zones
* 10 for some indices
* 1 or 0.5 for stocks depending on price
beginner tip:
leave it at 0.0 when auto round step is enabled.
---
## round zone width %
this controls how close price must be to a round level before the round-number magnet effect becomes important.
* lower values are stricter.
* higher values allow wider round-number zones.
beginner tip:
1.5 is a balanced default.
---
# flow / pressure engine
## delta length
this controls how many candles are used to estimate delta pressure.
* shorter length reacts faster.
* longer length is smoother.
beginner tip:
20 works well for general intraday use.
---
## obv ma length
this is the moving average length used for obv flow.
if obv is above its moving average, the script reads flow as more bullish. if it is below, flow is more bearish.
beginner tip:
20 is a good default.
---
## pressure smoothing
this smooths the pressure reading.
* low values react faster.
* high values reduce noise.
beginner tip:
5 is a balanced value.
---
# wall stability / memory
## wall stable bars
this controls how many bars a wall must remain active before it is considered stable.
* lower values confirm faster.
* higher values require more persistence.
beginner tip:
3 is a good starting point.
---
## same wall zone x tick
this controls how close a new wall must be to the previous wall to be treated as the same wall.
* lower values separate walls more strictly.
* higher values merge nearby walls more easily.
beginner tip:
3.0 is balanced.
---
## max historical zones
this controls how many historical wall zones are kept in memory.
beginner tip:
12 keeps the chart useful without too much clutter.
---
## historical merge x tick
this controls how close historical zones must be to merge together.
* lower values create more separate zones.
* higher values combine nearby levels.
beginner tip:
6.0 is a balanced default.
---
## historical strength decay
this controls how slowly old historical zones lose strength.
* 1.0 means they do not decay.
* lower values make old zones fade faster.
beginner tip:
0.985 keeps useful memory while still allowing old zones to fade.
---
# absorption / sweep / filters
## anti-noise confirmation
when enabled, the script requires extra filters before confirming long or short setups.
it checks for enough volume, pressure agreement, stable walls, absorption or sweep context, and avoids low-liquidity conditions.
beginner tip:
keep this enabled for cleaner signals.
---
## min volume x avg
this is the minimum volume required compared to average volume.
example:
0.90 means current volume should be at least 90% of average volume.
beginner tip:
raise it if you want fewer but stronger signals.
---
## absorption volume x avg
this controls how much volume is required to detect absorption.
absorption means price touches or pushes into a wall area, but the candle shows rejection instead of clean continuation.
beginner tip:
1.20 is balanced. raise it for stricter absorption signals.
---
## absorption zone x atr
this controls how close price must be to a wall for absorption detection.
* lower values require price to be very close to the wall.
* higher values allow a wider absorption area.
beginner tip:
0.18 works well for many intraday charts.
---
## sweep zone x atr
this controls how far price must move beyond a wall before a sweep can be detected.
a bullish sweep happens when price moves below a bid wall or historical bid zone and then closes back above it.
a bearish sweep happens when price moves above an ask wall or historical ask zone and then closes back below it.
beginner tip:
0.10 is a good starting value.
---
## exhaustion rsi high
this level is used to warn when a long setup may be overextended.
if a long setup appears while rsi is very high and the candle shows rejection, the setup can be marked as exhausted.
beginner tip:
72 is a balanced default.
---
## exhaustion rsi low
this level is used to warn when a short setup may be overextended.
if a short setup appears while rsi is very low and the candle shows rejection, the setup can be marked as exhausted.
beginner tip:
28 is a balanced default.
---
# regime / asset calibration
## asset profile
this adjusts the behavior of the script for different markets.
available profiles:
* auto
* crypto
* forex
* index
* stock
* futures
* generic
auto reads the symbol type and applies a matching profile.
beginner tip:
use auto first. switch manually only if the script feels too sensitive or too slow on your market.
---
## auto-calibrate thresholds
when enabled, the script adjusts wall strength, round-number behavior and memory based on the selected asset profile.
beginner tip:
keep this enabled.
---
## adx length
this controls the adx calculation used to identify trending or ranging conditions.
beginner tip:
14 is a standard value.
---
## volatility baseline
this controls the baseline used to compare current volatility with normal volatility.
* lower values react faster.
* higher values are smoother.
beginner tip:
100 is a balanced setting.
---
# spread / range proxy
## spread display
this chooses how the script estimates spread or micro-range conditions.
### adaptive proxy
uses an adaptive estimate based on recent range.
### bar range
uses the full current candle range.
### atr micro
uses a small atr-based estimate.
beginner tip:
use adaptive proxy for most markets.
---
## adaptive spread factor
this controls the size of the adaptive spread proxy.
beginner tip:
0.05 is a balanced default. raise it if the spread reading looks too small.
---
# visual / panel
## show panel
shows or hides the dashboard.
the panel displays score, confidence, regime, bid/ask depth, pressure, wall state, absorption, sweeps, visual stats and more depending on the selected panel mode.
---
## panel mode
### compact
shows only the most important information.
best for:
* small screens
* clean charting
* quick decision making
### full
shows the complete dashboard.
best for:
* normal trading use
* studying pressure, walls, volume and flow
### debug
shows additional internal values.
best for:
* testing settings
* understanding how the engine is reacting
* advanced users
---
## panel position
chooses where the dashboard appears on the chart.
options:
* top right
* top left
* bottom right
* bottom left
---
## show best wall zones
when enabled, the script draws the strongest stable bid and ask wall zones on the chart.
bid wall zones appear below price and can act as possible support areas.
ask wall zones appear above price and can act as possible resistance areas.
---
## show signal markers
when enabled, the script plots markers for:
* long setup
* short setup
* bid absorption
* ask absorption
* bullish sweep
* bearish sweep
* invalidation
---
## wall zone forward bars
this controls how far the wall zone boxes extend into the future.
beginner tip:
30 is a good value for intraday charts.
---
## panel bg
sets the dashboard background color.
---
## bid color
sets the color used for bullish or bid-side elements.
---
## ask color
sets the color used for bearish or ask-side elements.
---
## neutral color
sets the color used for neutral readings.
---
## accent color
sets the color used for highlights and active dashboard elements.
---
## warning color
sets the color used for warnings, exhaustion and invalidation.
---
# alerts / scoring
## wall threshold x avg
this controls how strong a wall must be compared to the average depth before it is considered important.
* lower values create more wall signals.
* higher values require stronger walls.
beginner tip:
2.0 is a balanced default.
---
## imbalance threshold
this controls how strong the bid/ask imbalance must be before the script labels the market as bid heavy or ask heavy.
beginner tip:
1.6 is a good starting point.
---
## long bias score
this is the score level required for a long bias.
example:
70 means the pro score must reach 70 or higher before a long setup can be confirmed.
---
## short bias score
this is the score level required for a short bias.
example:
30 means the pro score must fall to 30 or lower before a short setup can be confirmed.
---
## min confidence
this is the minimum agreement score needed before the script confirms a setup.
confidence is based on agreement between pressure, imbalance, wall direction, trend, obv, intrabar quality, absorption, sweeps and regime.
beginner tip:
55 is a balanced default. raise it for stricter signals.
---
# visual backtest stats
## enable visual stats
when enabled, the script tracks basic visual follow-up stats after confirmed signals.
this is not a full strategy backtest. it is a visual stats module that checks whether a signal reaches an atr-based target or invalidation level within a chosen number of bars.
---
## target x atr
this controls the target distance used by visual stats.
example:
0.75 means the target is 0.75 atr from the signal price.
---
## invalidation x atr
this controls the invalidation distance used by visual stats.
example:
0.55 means the invalidation level is 0.55 atr from the signal price.
---
## max bars in signal
this controls how long the visual stats module gives a signal to reach target or invalidation.
if neither target nor invalidation is reached before this number of bars, the signal is closed by time.
---
# dashboard guide
## score
the score ranges from 0 to 100.
* above the long bias score: long bias
* below the short bias score: short bias
* between both levels: neutral
the score is built from pressure, imbalance, wall strength, trend, obv, rsi, absorption, sweep and regime.
---
## confidence
confidence measures how much agreement exists between the engine components.
a high score with low confidence should be treated carefully. a high score with strong confidence is cleaner.
---
## regime
the regime label describes the current market environment.
possible states include:
* high vol
* low liq
* breakout
* trending
* ranging
* balanced
beginner tip:
avoid forcing trades in low-liquidity conditions.
---
## bid / ask
this shows the estimated synthetic bid depth and ask depth.
if bid depth is much stronger than ask depth, the market may be bid heavy.
if ask depth is much stronger than bid depth, the market may be ask heavy.
---
## pressure
this shows whether buying or selling pressure is dominant.
pressure is not a signal by itself. it should agree with walls, imbalance and confidence.
---
## walls
this shows whether bid and ask walls are:
* none
* weak
* building
* holding
a holding wall is more important than a fresh or weak wall.
---
## abs / sweep
this shows whether absorption or a sweep is currently detected.
absorption can show rejection at a wall.
a sweep can show liquidity being taken before price returns.
---
## bt stats
this shows the visual stats result of recent confirmed signals.
it should be used for observation, not as proof of future performance.
---
# chart markers
## l marker
a long setup marker appears when the script confirms long bias conditions, confidence is high enough, and the noise filter allows the signal.
---
## s marker
a short setup marker appears when the script confirms short bias conditions, confidence is high enough, and the noise filter allows the signal.
---
## abs marker
an absorption marker appears when price interacts with a wall area with strong volume and rejection.
bid absorption appears below price.
ask absorption appears above price.
---
## sw marker
a sweep marker appears when price raids a wall or historical liquidity zone and then closes back through it.
bullish sweep appears below price.
bearish sweep appears above price.
---
## x marker
an invalidation marker appears when a setup is invalidated by price moving beyond the relevant wall area.
---
# available alerts
the script includes alerts for:
* stable synthetic bid wall
* stable synthetic ask wall
* bid heavy imbalance
* ask heavy imbalance
* long setup confirmed
* short setup confirmed
* bid absorption
* ask absorption
* bullish sweep
* bearish sweep
* setup invalidated
beginner tip:
start with only a few alerts. for example:
* stable bid wall
* stable ask wall
* long setup confirmed
* short setup confirmed
* bullish sweep
* bearish sweep
too many alerts can make the workflow noisy.
---
# beginner tutorial
## step 1 — choose the correct engine mode
start with hybrid pro.
hybrid pro is the most balanced mode because it combines classic chart pressure with lower-timeframe flow.
use classic synthetic if you want a smoother reading.
use intrabar flow if you want maximum short-term sensitivity.
---
## step 2 — choose the lower timeframe
for a 15m chart, start with 1m or 3m.
for a 5m chart, start with 1m.
for a 1h chart, try 5m or 15m.
if the script feels too reactive, use a higher lower-timeframe setting or lower the intrabar weight.
---
## step 3 — read the panel first
before looking at markers, read the panel:
1. check the market regime.
2. check the score.
3. check confidence.
4. check bid/ask imbalance.
5. check pressure.
6. check wall state.
7. check absorption or sweep.
do not take a marker if the panel does not make sense.
---
## step 4 — use walls as zones, not exact entries
a stable bid wall can act as a possible support area.
a stable ask wall can act as a possible resistance area.
price may react around the zone, not exactly at one tick.
---
## step 5 — wait for context
a better long idea usually has:
* stable bid wall
* bid-heavy or improving depth
* positive pressure
* bullish sweep or bid absorption
* score above the long bias level
* confidence above the minimum
a better short idea usually has:
* stable ask wall
* ask-heavy or weakening bid depth
* negative pressure
* bearish sweep or ask absorption
* score below the short bias level
* confidence above the minimum
---
# example use cases
## example 1 — bullish wall reaction
price moves down into a stable bid wall.
the panel shows:
* bid wall holding
* bid/ask ratio improving
* pressure turning positive
* confidence rising
* bid absorption appears
a trader may wait for price to hold above the wall and then look for a long setup marker.
possible invalidation:
price closes below the bid wall area and an invalidation marker appears.
---
## example 2 — bearish wall rejection
price moves up into a stable ask wall.
the panel shows:
* ask wall holding
* ask-heavy imbalance
* pressure turning negative
* ask absorption appears
* confidence is above the minimum
a trader may wait for rejection from the ask wall and a short setup marker.
possible invalidation:
price closes above the ask wall area.
---
## example 3 — bullish sweep
price moves below a bid wall or historical bid zone and then closes back above it.
the script marks a bullish sweep.
this can mean sellers pushed price below liquidity, but buyers absorbed the move and price returned above the zone.
a trader may then check:
* is pressure improving?
* is confidence strong enough?
* is the score moving toward long bias?
* is the market not in low-liquidity mode?
---
## example 4 — bearish sweep
price moves above an ask wall or historical ask zone and then closes back below it.
the script marks a bearish sweep.
this can mean buyers pushed price above liquidity, but sellers absorbed the move and price returned below the zone.
a trader may then check:
* is pressure weakening?
* is ask absorption present?
* is confidence strong enough?
* is the score moving toward short bias?
---
## example 5 — avoiding a weak signal
a long marker appears, but the panel shows:
* low liquidity regime
* weak confidence
* no stable bid wall
* no absorption
* no sweep
this is a low-quality context.
the better choice is to wait for stronger agreement.
---
## example 6 — using visual stats
enable visual stats and keep default atr target and invalidation settings.
after each confirmed setup, the panel tracks whether price reached the target, invalidation or timed out.
this is useful for studying the behavior of the signals on your market, but it is not a complete strategy backtest.
---
# suggested starting settings
## scalping
chart:
1m to 5m
settings:
* engine mode: hybrid pro
* lower timeframe: 1m
* intrabar weight: 0.55 to 0.70
* use confirmed bars: enabled
* wall threshold: 2.0 to 2.5
* min confidence: 60 to 70
* panel mode: compact or full
best use:
watch for stable walls, sweeps and absorption during active sessions.
---
## intraday
chart:
5m to 30m
settings:
* engine mode: hybrid pro
* lower timeframe: 1m to 5m
* intrabar weight: 0.45 to 0.60
* use confirmed bars: enabled
* wall stable bars: 3 to 5
* min confidence: 55 to 65
* panel mode: full
best use:
use stable walls as reaction zones and wait for score plus confidence agreement.
---
## swing or higher timeframe
chart:
1h to 4h
settings:
* engine mode: classic synthetic or hybrid pro
* lower timeframe: 5m to 15m
* intrabar weight: 0.25 to 0.45
* volume lookback: 100 to 200
* liquidity memory bars: 60 to 120
* panel mode: full
best use:
focus on larger wall zones, market regime and historical liquidity memory.
---
# practical workflow
1. open the chart and choose the market.
2. set engine mode to hybrid pro.
3. choose a lower timeframe smaller than the chart timeframe.
4. keep confirmed bars enabled.
5. check the panel regime.
6. wait for a stable wall.
7. watch bid/ask imbalance and pressure.
8. wait for absorption, sweep or a confirmed setup marker.
9. define invalidation around the wall zone.
10. use visual stats to observe signal behavior over time.
---
# limitations
this script uses synthetic calculations. it does not access real order book liquidity, real level 2 data, broker depth, or exchange resting orders.
signals may perform differently depending on symbol, timeframe, session, liquidity and volatility.
visual stats are only a simple chart-based follow-up tool. they are not a full trading strategy backtest.
the script should be combined with risk management, market structure, session context and personal testing.
---
# risk notice
this indicator is for technical analysis and education. it does not provide financial advice and does not guarantee future results. every trader is responsible for their own decisions, risk management and testing.
Pine Script® indicator






















