Order flow on Meridian
The lattice, the magnets, the regime, and the path are already here. OFI adds evidence. It does not add a gate.
For education only. Not financial advice. Past patterns do not guarantee future results. Protect capital first.
Order Flow Intelligence, layered on Meridian Engine v2. Cumulative volume delta, absorption, and imbalance join the lattice you already trade.
This course follows the Pine v6 script titled Meridian Engine v2.1 — OFI. If the lattice, the three gates, and the path are new, start with Meridian Engine v2 Mastery.
The lattice, the magnets, the regime, and the path are already here. OFI adds evidence. It does not add a gate.
A close-versus-prior-close volume split. Three reset modes. A 3-bar slope. Session high and low.
Type 8 is a rejection at a level. Type 9 is directional delta that agrees with the CVD slope and with structure.
Each type counts once. Density runs after the same-bar events. OFI alone cannot print SINGULAR.
Tiny circles and diamonds. One dashboard row. Four alerts, and only when the grade is already high.
RANGE can fade absorption. TREND can continue on imbalance. The path still confirms at TP1 and breaks on a stop close.
Order Flow Intelligence (OFI) is a volume read added on top of Meridian Engine v2. It sits on levels the engine already tracks.
Order flow means who is pushing, measured with volume. A footprint chart shows bid and ask at each price. This script does not have that feed. It uses a proxy, then drops the result onto the Meridian map you already know.
Five pieces of v2 make that possible. Each one already exists. OFI borrows them.
barstate.isconfirmed. The bar has closed. Mid-bar flicker cannot print the entry.ATR is the average true range. It is a typical bar size. Several inputs are written as a multiple of ATR, so the same setting scales from a quiet chart to a wild one.
OFI needs a place to land. The place is a list of event types, a price memory, and a grade that already decides entries. Two earlier engines were considered. They do not give OFI that place.
A simple 3-gate model, one FVG or order block, and a basic dashboard. There is no graded lattice to extend, and no magnet map to hang a level test on.
Smart Money Score, SOTD tiers, and a multi-anchor VWAP. The score is flatter. Liquidity is simpler: cooldown-filtered PDH, PDL, and swing raids.
Direction-matched magnets, a type-by-type lattice, regime gates, confirmed-bar entries, and mutual exclusion. New event types can join without a new signal path.
Gate 2 is the arm. The engine is armed only by a liquidity sweep, a VWAP reclaim, or a CHoCH. A long arm is a sweep of the lows, a bullish VWAP reclaim, or a bullish CHoCH. A short arm is a sweep of the highs, a bearish VWAP reclaim, or a bearish CHoCH.
CHoCH means change of character. In this script it is a break of structure that flips the structure trend. BOS means break of structure: a close through the last swing pivot. A CHoCH is a BOS. A BOS is not always a CHoCH.
There is also no separate “OFI Ready” badge in the script. The shipped stand-in is the alert thresholds in Module 05: absorption only when the grade is already PRIME or higher, imbalance only when the grade is already ELITE or higher.
CVD is a running total of bar delta. Bar delta is a proxy. It is built from the close, because many feeds have no bid and ask.
Bar delta is up volume minus down volume on one bar. The split looks at this close against the prior close.
CVD (cumulative volume delta) adds each bar delta onto a running total. Session CVD high and session CVD low are the highest and lowest values of that total since the last reset. They are tracked in the script. They are not a separate dashboard row.
The 3-bar slope is CVD now minus CVD three bars ago. Slope above zero means CVD rising. Slope below zero means CVD falling. Until three bars of history exist, both flags stay off.
Open the indicator settings. Find the group Event Lattice. The input is labeled CVD Reset. The default is Session. The choices are None, Session, and Daily.
CVD does not reset after the first bar. The total keeps running. Use this only when you want one long cumulative line.
CVD resets when VWAP resets. It follows the preset’s VWAP anchor on purpose. Change the preset, and this reset follows.
CVD resets on each new New York day. It ignores the VWAP anchor. A weekly VWAP can sit under a daily CVD.
On a reset bar, CVD, the session high, and the session low are all set to that bar’s delta. They do not start at zero and then add. The first bar of the new run is the delta.
Session mode follows the preset anchor. Auto picks the preset from the chart timeframe.
| Preset | Auto when | VWAP anchor | What Session reset uses |
|---|---|---|---|
| Scalp | 3 minutes or faster | Session | The VWAP session window |
| Intraday | Above 3 min, up to 15 min | Session | The same session window |
| Swing | Above 15 min, up to 4 hours | Daily | The new New York day |
| Position | Slower than 4 hours | Weekly | The new New York week |
The session window itself depends on the symbol. Non-crypto uses 09:30–16:00 New York. Crypto uses a full 00:00–24:00 day, so the window never “opens” mid-week and the New York weekday change is what resets it. On Scalp or Intraday, a Session reset fires when that window opens, or when the New York weekday changes.
Type 8 and type 9 are direction-aware. A bullish event joins the long lattice only. A bearish event joins the short lattice only.
Absorption means heavy volume in one direction that fails to continue. Sellers hit, and the candle still closes up. Or buyers hit, and the candle still closes down. The script stores both directions as type 8. The direction is a separate flag.
Strong delta uses the input OFI strong-delta × avg. Default 1.5. The script takes the 20-bar average of the absolute bar delta. Call that the average size. Strong up delta means this bar’s delta is greater than 1.5 times that average. Strong down delta means it is more negative than −1.5 times that average.
The level test is an OR. One true test is enough. Absorption does not also require the CVD slope. That requirement belongs to imbalance.
Imbalance here means aggressive continuation. Strong delta in the trade’s direction, a CVD slope that agrees, and a structure or location event on the same bar. Both directions are type 9.
A bullish CHoCH counts, because a CHoCH is a bullish BOS that flips the trend. A plain continuation BOS counts for the imbalance test too. A plain BOS does not arm Gate 2. Only the CHoCH form of that break arms.
A VWAP reclaim is a close back through VWAP, with volume above 1.2 times the 20-bar average volume. Bullish: this close is above VWAP and the prior close was at or below it. Bearish is the mirror.
The zone door for imbalance is the tap itself. Price is in the zone. That is wider than absorption’s edge test. Imbalance does not use OFI level proximity (×ATR). That input is the magnet distance on the absorption test. A magnet alone, with no BOS, no reclaim, and no zone tap, does not print type 9.
Types 1 through 9 share one density function. The grade still enters through Gate 3. There is no fourth gate.
The lattice keeps up to 30 recent events. Each event has a bar, a price, a direction, and a type code. Density asks a simple question: how many different types, on this side, are still in range?
| Code | Event | When it is pushed |
|---|---|---|
| 1 | Sweep | Sell-side sweep is long. Buy-side sweep is short. |
| 2 | CHoCH | A BOS that flips the structure trend. |
| 3 | BOS | A BOS that does not flip the trend. A CHoCH is not also stored as type 3. |
| 4 | VWAP reclaim | Close back through VWAP with expanded volume. |
| 5 | Band touch | A σ-band touch while price is in discount (long) or premium (short). |
| 6 | Session tag | Silver Bullet, NY defense, or Asia tag on that side. |
| 7 | FVG | A bullish or bearish fair value gap on this bar. |
| 8 | Absorption | The type 8 test in Module 03. Direction follows the rejection. |
| 9 | Imbalance | The type 9 test in Module 03. Direction follows the delta. |
An event counts only when three things are true. The direction matches the side you are scoring. The event is no older than the lattice window. The event price is within Lattice price proximity (×ATR) of the current close. Default 1.5.
The window input is Lattice lookback bars. Default 12. Minimum 3. Presets resize it. With the input left at 12, Scalp uses 8 bars, Intraday and Swing use 12, and Position uses 18. That is the time box for OFI events. There is no second OFI lookback input. A repeated absorption inside the window does not add a second point. Type 8 is already seen.
v2 counted each type once, in the spirit of a bitmask: one slot per type. Pine has no bitwise operators, so v2.1 stores nine true/false flags. The count is the same. Slots 8 and 9 are the new ones.
The number you see is the grade, not a raw tally that skipped the adjustments.
The dashboard prints the name and that number together, like L ELITE(4).
Below the default entry filter.
Default minimum. Min lattice grade to enter is PRIME.
Highest grade two OFI types can reach.
Needs a wider lattice than types 8 and 9.
Do the OFI-only math once. Two types, and a session boost: 2 × 1.25 = 2.5, which rounds to 3 (PRIME). The magnet bump can then add 1, because the grade is already at least 3. That is 4, ELITE. SINGULAR is 5. Types 8 and 9 cannot get there by themselves, even with the session boost and the magnet bump. Without the session boost, two types round to 2 (WATCH), and the magnet bump does not apply, because the grade is under 3.
Gate 3 compares that grade with your minimum. The long passes when the long grade is at least the rank of Min lattice grade to enter. PRIME is rank 3. ELITE is 4. SINGULAR is 5. WATCH is 2. The same test runs on the short side.
Mutual exclusion runs after both raw signals exist. If both long and short qualify and the grades are equal, neither prints. If the grades differ, the higher grade prints. The winner still has to be a confirmed bar.
The chart stays quiet. Two shapes, one dashboard row, four alerts. No footprint and no volume profile.
Show OFI marks defaults to on. Turn it off and both shapes disappear. The shapes are tiny. They are cues, not a second panel.
display.none. It does not take over the price scale. Read the number on the dashboard.barstate.isconfirmed. Delta uses the live close, so a mark can appear and vanish before the bar finishes. Treat it as final on the close.The dashboard is a 13-row table. Rows are numbered from 0. Row 12 is the last row. Its label is OFI. The cell shows one state word, then the live CVD value in volume format.
The word is chosen in this order. The first match wins.
A bullish or bearish absorption is true on this bar. Absorption beats everything else in the cell.
No absorption, and an imbalance is true. Imbalance beats the slope.
No absorption and no imbalance. The 3-bar slope decides. If the slope is flat, the word is an em dash.
Four alertcondition names were added. They are separate from Enable alert() calls.
That switch gates the other messages (entries, sweeps, regime, bias, path). It does not turn these four on or off.
When you create the alert, choose once per bar close.
| Alert name | Fires when | Message |
|---|---|---|
| OFI Absorption Long | Bullish absorption and the long grade is at least 3 (PRIME) | Meridian OFI: Bullish absorption at level |
| OFI Absorption Short | Bearish absorption and the short grade is at least 3 (PRIME) | Meridian OFI: Bearish absorption at level |
| OFI Imbalance Long | Bullish imbalance and the long grade is at least 4 (ELITE) | Meridian OFI: Strong bullish imbalance |
| OFI Imbalance Short | Bearish imbalance and the short grade is at least 4 (ELITE) | Meridian OFI: Strong bearish imbalance |
A lone absorption on a weak lattice still draws the circle. It does not alert. The grade in the test already includes this bar’s event, because density runs after the push.
Two ways to use the marks. Then the same path rules as v2, read with absorption in view.
These are reading rules. They use gates the script already has. A mark is not an entry. The entry still needs Gate 1, an arm, a zone, the filters, the grade, and a confirmed bar.
Whichever play you use, the grade still has to clear the minimum. Default is PRIME. If the other side’s grade is higher, mutual exclusion keeps this side quiet. If the grades tie, both stay quiet.
OFI changes whether a path is created, because the grade includes types 8 and 9. Once the path exists, the tracker does not grow a new rule. The long path confirms when the high touches TP1. The long path breaks when a bar closes under the stop. The short path confirms when the low touches TP1, and breaks when a bar closes above the stop.
A long is open. A bullish absorption prints, and the close stays above the stop. Sellers tried to push through the stop and failed. The dashboard path cell stays L:OPEN. That is the confidence the blueprint describes. PATH CONFIRM still waits for TP1. The circle does not move the stop and does not confirm the trade.
The same defense appeared, and a later bar closes through the stop. The script prints PATH BREAK, clears that path, and can alert if Enable alert() calls is on. There is no second “failed absorption” alert. The break is the warning. The idea is over.
Replay the closed bar. Name the type, the direction, and the gate it is allowed to touch. If you cannot, leave the mark on the chart and keep your hands off the order.
OFI product page → v2 Mastery course →FOR EDUCATION ONLY · NOT FINANCIAL ADVICE · MANAGE RISK ON EVERY TRADE