From v2.1 to v2.2
Types 8 and 9 stay. The missing piece is a run of diagonal imbalances, still pointed at one side.
For education only. Not financial advice. Past patterns do not guarantee future results. Protect capital first.
From the CVD proxy to native footprint order flow. Version 2.2 reads real bid and ask rows, then stacks the diagonal imbalances into lattice type 10.
This course follows the Pine v6 script titled Meridian Engine v2.2 OFI. Course one is Meridian Engine v2 Mastery. Course two is Meridian OFI Engine Mastery, where cumulative volume delta, absorption, and imbalance are taught in full. This page recaps types 8 and 9 in a few lines, then stays on the stack.
Types 8 and 9 stay. The missing piece is a run of diagonal imbalances, still pointed at one side.
Price rows, bid volume, ask volume, ticks per row, and why the comparison steps down or up one row.
Walk the rows. Keep the longest same-side run. Default length is 3. A tie keeps the buy stack.
Prefer native footprint is on by default. If the footprint is missing, consecutive strong delta bars stand in.
The bitmask now holds types 1 through 10. A stack can add one grade step. The zone can become a magnet.
Green and red squares, one zone box, the OFI dashboard cell, and the six new inputs.
Continuation at a zone, a later magnet retest, and a stack beside absorption. Every rule is in the script.
Stacked imbalance sits on the order-flow layer you already have. It does not replace it.
Order flow means who is pushing, read from volume. In v2.1 that read is a proxy called cumulative volume delta (CVD). Each bar splits its volume by the close versus the prior close. Up volume minus down volume is the bar delta. CVD is the running sum. The full reset modes, the 3-bar slope, and the level tests live in Meridian OFI Engine Mastery.
Two event types from that course still run in v2.2, on every bar, underneath the stack.
Absorption. Strong delta fights the candle, and the candle wins, at a zone, a VWAP band, or the top magnet. A tiny circle marks it. Bullish absorption is a green circle under the bar.
Imbalance. Strong delta agrees with the CVD slope, and with a break of structure, a VWAP reclaim, a zone, or a change of character. A tiny diamond marks it.
Stacked imbalance. New in v2.2. Several neighboring price rows each show a one-sided diagonal imbalance. A tiny square marks it. That is the rest of this course.
The engine under both layers is unchanged. The lattice, the magnets, the regime, the three gates, and the path are taught in Meridian Engine v2 Mastery. A lattice is a short memory of event types near price. Each type counts once. The count becomes a grade.
A single diagonal imbalance is one loud price row.
A stack is several of those rows in a row, all on the same side.
That run is the high-value piece v2.1 could not see, because v2.1 never read a footprint.
v2.2 asks TradingView for one, with request.footprint.
The design stays direction-aware. A buy stack pushes lattice direction 1. A sell stack pushes direction −1. Only one side is kept on a bar. The long grade and the short grade are still scored apart.
Types 8 and 9 still fire only at a level the engine already tracks: a fair value gap or order block, a VWAP sigma band, or the strongest magnet, inside OFI level proximity (×ATR) (default 0.4). Type 10 is different. The script pushes it whenever the run is long enough. It does not run that level test first.
The stack still has to sit near price to affect the grade. Density keeps an event only when its price is inside Lattice price proximity (×ATR) (default 1.5) of the close, and the event is inside the lattice lookback. The stored price of a stack is the midpoint of its zone. On the bar it prints, that midpoint is inside the bar, so the stack usually counts immediately. On later bars it counts only while price is still near that midpoint.
A footprint is the inside of one bar, split into price rows, with buy volume and sell volume on each row.
A normal candle hides the volume inside the high and the low. A footprint opens that range into rows. Each row is a thin slice of price.
Thinner rows mean more rows inside one bar. Thicker rows mean fewer rows, and a stack is harder to build. The script’s own note says to aim for about 15 to 40 rows on a typical bar. Module 6 shows how to tune that.
The call is always request.footprint(fpTicks, 70, fpImbPct).
Pine needs that request on every bar, so the script calls it even when you turn native footprints off.
The middle number, 70, is fixed.
It is the value-area percent TradingView uses inside the footprint object.
You do not have an input for it.
You tune the ticks and the imbalance percent.
The best bid and the best ask sit one tick apart. A market buy lifts the ask. A market sell hits the bid. Comparing buy and sell on the same row mixes both sides of that spread. The useful comparison steps to the neighbor.
TradingView’s rule, which this script uses through the footprint flags, is written in the header comment:
The input is Imbalance threshold %. Default is 300. Minimum is 100. The step is 50. 300% means 3 times. Buy 90 against sell 20 on the row below is a buy imbalance, because 90 is at least 3 × 20. Buy 40 against sell 100 on the row below is quiet, because 40 is far under 300.
The script does not do that multiply itself.
It reads has_buy_imbalance and has_sell_imbalance on each volume_row.
The percent you set is passed into request.footprint, and TradingView sets the flags.
The script walks every row, keeps consecutive one-sided flags, and remembers the longest run on each side.
When Prefer native footprint (Premium+) is on, and the footprint is not empty, the script sets a flag that this bar used real footprint data.
It then walks rows() from the first row to the last.
Each row is one of three things:
A row that is both sides is a break. It does not count for either run. The script keeps the longest buy run and the longest sell run it saw on that walk. If two buy runs have the same length, the first one is kept, because the script replaces a best run only when the new run is strictly longer.
The price span of a run is the lowest down_price and the highest up_price of the rows inside it.
A direct flip from buy rows to sell rows, with no quiet row between them, starts a new count.
The span is not cleared on that flip, so the new side’s box can still include the earlier rows until a quiet row or a both-sides row wipes it.
Min stacked imbalance rows defaults to 3. The smallest allowed value is 2. The largest is 12. A run shorter than that minimum is ignored.
After the walk, the script picks one stack for the bar. The test is in this order:
A tie goes to the buy side.
The comparison is bestBuyRun >= bestSellRun.
Buy length 3 and sell length 3, with a minimum of 3, prints the buy stack.
Sell length 4 and buy length 3 prints the sell stack, because the buy run is no longer at least as long.
Buy length 2 and sell length 3, with a minimum of 3, prints the sell stack, because the buy run never cleared the minimum.
Best buy 3, best sell 3, minimum 3. Direction is +1. Count is 3. The zone uses the buy run’s top and bottom.
Best buy 3, best sell 4, minimum 3. Direction is −1. Count is 4. The shorter buy run is dropped for this bar.
The feature still runs when the footprint is empty, or when you turn native data off. The stand-in is coarser.
useTrueFP is the input Prefer native footprint (Premium+).
Default is on.
na means “no value.”
If TradingView cannot build a footprint, request.footprint returns na.
The script treats the bar as native only when both of these are true:
That bar is then marked fpNative.
The dashboard will end the OFI text with ·FP.
FP means footprint.
If the toggle is off, the footprint is still requested, and then ignored.
fpNative stays false.
The proxy runs.
The dashboard ends with ·px.
px means the price-bar proxy.
The proxy does not look inside the bar. It looks backward across bars. It starts at the current bar. A strong up delta adds one to the buy count and clears the sell count. A strong down delta does the opposite. The first bar that is neither strong up nor strong down stops the walk.
The current bar has to be part of the run. Three strong bars in the past, with a quiet bar now, do not print a stack. The loop breaks on bar zero.
The window is short.
The loop runs from 0 through min(min stacked rows + 2, 8).
That is at most nine bars, indexes 0 through 8.
If you set Min stacked imbalance rows to 10, 11, or 12, the proxy can never qualify.
A native footprint still can, up to the input maximum of 12.
When the proxy qualifies, the zone is not a set of footprint rows. The top is the highest high of those bars. The bottom is the lowest low. The count is the number of strong bars. There is no diagonal test. The same strong-delta multiple used by absorption, default 1.5, is the test.
Neighboring price rows. Diagonal 3:1 flags. Zone is the row prices of the winning run. Dashboard tag ·FP.
Neighboring bars with strong same-side delta. Zone is the high-low of that streak. Dashboard tag ·px. Coarser on purpose.
Type 10 joins the bitmask. A small grade nudge can follow. The zone can be stored as a liquidity pool.
Event codes in this script are fixed. 1 sweep, 2 CHoCH, 3 BOS, 4 VWAP reclaim, 5 band touch, 6 session tag, 7 fair value gap, 8 absorption, 9 imbalance, 10 stacked imbalance. A stack pushes type 10 at the midpoint of its zone, direction +1 or −1.
Density uses a bitmask. A bitmask is a row of on/off switches, one per event type. The loop checks bits 0 through 9, which are types 1 through 10. Repeating the same type does not raise the count. Two stacks in the lookback still count as one type 10.
The grade is built in this order. Learn the order. The nudge is last.
Grade 2. A stack nudge can lift this to PRIME.
Default minimum to enter. Stacked alerts use this line.
Grade 4. Imbalance alerts start here. A nudge can reach SINGULAR.
The cap. Extra types and extra nudges stop here.
A stack by itself is one type. Rounded grade 1 is shown as a dash, and 1 is below 2, so the nudge does not fire. The stack needs company already inside the window before the +1 is allowed. Two types make WATCH. The nudge then makes PRIME.
Gate 3 reads the grade after the nudge.
Min lattice grade to enter defaults to PRIME, which is rank 3.
Gate 2 does not read the stack.
A buy arm is still a sweep of the lows, a bullish VWAP reclaim, or a bullish CHoCH.
The arm expires after a preset number of bars.
The entry label still requires barstate.isconfirmed, so the bar has closed.
Register stack as liquidity magnet defaults to on. A magnet is a stored liquidity pool. It has a price, a direction, an intensity, and a strength that decays.
A stack of 3 on a bar with twice the average volume starts at intensity 3 × 1.5 × 2 = 9. That is a strong start next to many sweep pools. The blueprint’s phrase “length times volume ratio” leaves out the 1.5. The script multiplies by 1.5.
Every cap the map already enforces still applies to these pools:
The visuals stay small. The row tells you the side, the length, and whether the bar used a footprint.
Buy squares print under the bar. Sell squares print above the bar. Both are tiny. Both use the input Show OFI absorption marks (default on). Turning that input off hides the circles, the diamonds, and the squares together. There is no separate switch for the squares.
Show stacked imbalance zones defaults to on. A qualifying stack draws one box from the zone top to the zone bottom, starting at this bar and ending 12 bars later. Buy boxes use green #22C55E. Sell boxes use red #EF4444. The fill is very transparent. The border is slightly stronger. The next stack deletes the previous box. You will not see a trail of old boxes.
The dashboard is the table at the top right, when Show dashboard is on. The last row is labeled OFI. If this bar has a stack, the cell leads with the stack. A buy stack of 3 on native data reads Stk↑3·FP, then a space, then the CVD number in volume format. A sell stack of 4 on the proxy reads Stk↓4·px, then the CVD number. The examples in the blueprint match that pattern.
When there is no stack, the same cell falls through: absorption, then imbalance, then the CVD slope (CVD↑, CVD↓, or a dash). The source tag is still attached. A quiet bar with a live footprint can read CVD↑·FP. The tag describes the data source of the bar, and the stack text describes the event.
Stacked alerts are alertcondition entries. You create them in TradingView’s alert dialog. The names and messages are:
| Alert name | When it can fire | Message |
|---|---|---|
| OFI Stacked Imbalance Long | Buy stack, and the long grade is at least 3 (PRIME). The nudge counts. | Meridian OFI: stacked buy imbalance |
| OFI Stacked Imbalance Short | Sell stack, and the short grade is at least 3. | Meridian OFI: stacked sell imbalance |
| OFI Absorption Long / Short | Absorption, and that side’s grade is at least 3. | Meridian OFI: bullish / bearish absorption at level |
| OFI Imbalance Long / Short | Imbalance, and that side’s grade is at least 4 (ELITE). | Meridian OFI: strong bullish / bearish imbalance |
alert() lines, such as the entry text and the path text. The stacked alerts are alert conditions. That toggle does not turn them on or off.
These six inputs sit in the Event Lattice group. Labels and defaults are the script’s.
| Input | Default | What it does |
|---|---|---|
| Prefer native footprint (Premium+) | true | Use the footprint when the object is not empty. Off forces the proxy and the ·px tag. |
| Footprint ticks/row | 100 | How many minimum price steps sit in one row. Minimum 1. Tune per symbol. |
| Imbalance threshold % | 300 | The diagonal ratio. 300 means 3 to 1. Minimum 100. Step 50. |
| Min stacked imbalance rows | 3 | How long a run must be. Minimum 2. Maximum 12. The proxy cannot reach 10, 11, or 12. |
| Show stacked imbalance zones | true | Draw the zone box. Only the latest box is kept. |
| Register stack as liquidity magnet | true | Push the buy bottom or the sell top into the Liquidity Memory Map. |
A few older inputs change the stack even though they are not new. Show OFI absorption marks shows or hides the squares. OFI strong-delta × avg (default 1.5) is the proxy’s strength test. Lattice lookback bars and Lattice price proximity (×ATR) decide how long type 10 stays in the grade. Max liquidity pools and Magnet decay / bar bound the magnet.
The script’s closing note says footprint calls are limited to one per script, and ticks per row should be tuned so a bar holds about 15 to 40 rows. It gives ES as about 4 to 20 ticks per row, and says crypto should be larger. The owner’s tuning note, which is guidance and not a second coded limit, is tighter: try 4 to 20 on ES or NQ, and 50 to 200 on crypto or on large-range bars. If stacks print too often, raise Imbalance threshold % to 400 or 500. The input will accept those values. The step is 50.
Three readings. Each one uses a rule the script already enforces. None of them is a win rate.
Initiative here means aggressive one-sided trade, which is what a stack measures. The script calls the nudge a high-conviction add when the stack lines up with the grade you already have.
A long continuation, read off the script, needs all of this on a closed bar:
The box fades from the chart when the next stack replaces it. The pool can remain. With Register stack as liquidity magnet on, a buy stack leaves a long-side pool at the bottom of the zone. A later bar can use that pool in three ways the script already has.
The pool only gets stronger on a revisit when volume expands and the candle closes in the pool’s direction. A tag with no volume, or a close the wrong way, does not add strength. Decay still runs, at 0.92 per bar by default, until the pool falls under 0.15.
Types 8, 9, and 10 can all be true on the same bar. They are separate pushes. The bitmask will count each type once inside the lookback. A circle plus a square is two types, not two copies of one type.
Opposing strong delta, a rejection candle, and a level. It is a defense. It still needs the level test that type 10 skips.
Same-side strong delta, a CVD slope that agrees, and structure or a zone. It is one bar of push, not a stack of rows.
A run of diagonal rows, or a run of strong bars in the proxy. It can add the extra grade step. The dashboard prefers its text.
If a buy stack and bullish absorption both print, the OFI cell shows the stack, not Abs↑. Look at the chart for the circle. The grade still received both types, if both prices sit inside the lattice window.
A useful pairing is a stack in the direction of the trade, and absorption at the level you are leaning on. The script allows that pairing. It does not score it as a special setup. You still need the arm, the zone, and the minimum grade. There is no win rate in this script for “stack plus absorption.” The known limits at the bottom of the file say to use a companion backtest if you want those numbers, and that no walk-forward test is built in here.
The owner’s blueprint lists these as unfinished. They are not in Meridian Engine v2.2 OFI. Do not look for them on the chart.
The idea is to mark an extreme row that still has volume on both sides, and to project that price until it is filled. The v2.2 script has no unfinished-auction test and does not push that kind of pool.
The idea is a z-score of delta against the price result, to filter weak absorption, on both true delta and the CVD proxy. The script’s absorption test is still the strong-delta multiple, the candle, and the level. There is no z-score.
The idea is a new price extreme with opposing bar delta or CVD, used as an early path break or a grade penalty. The script does not compare price extremes to delta. Path break is still a close through the stop.
The blueprint describes separate rows for FP Stack, unfinished auctions, delta effort, and a Native / Proxy label. v2.2 keeps one OFI row. The stack and the ·FP or ·px tag live inside that cell, next to the CVD number.
Replay one closed bar. Name the data source, the winning side, the run length, and whether the grade was allowed to take the nudge. If you cannot, leave the square on the chart.
Stacked imbalance page → OFI Mastery course → v2 Mastery course →FOR EDUCATION ONLY · NOT FINANCIAL ADVICE · MANAGE RISK ON EVERY TRADE