---
title: "Order Flow Imbalance: Formula, Meaning"
description: "Order flow imbalance (Cont, Kukanov and Stoikov) sums the net change in best-bid and best-ask sizes caused by order additions, cancellations and trades. It..."
canonical: https://www.getswoopr.com/indicators/market-microstructure/order-flow-imbalance/
source: "Swoopr Investment: https://www.getswoopr.com"
---

## Direct Answer



> Order Flow Imbalance is a market microstructure measure used to measure liquidity, order flow, execution quality, or price impact at the trading-mechanism level. The production page must define the exact calculation convention before interpreting higher or lower readings, because platform and provider implementations can differ.





      


# Order Flow Imbalance: Formula, Meaning, Signals, Examples and How to Use It



## How Is Order Flow Imbalance Calculated?

Order flow imbalance (Cont, Kukanov and Stoikov) sums the net change in best-bid and best-ask sizes caused by order additions, cancellations and trades. It is built from best-quote updates and has been found to relate closely to short-term mid-price changes.

**Formula:** `e_n = 1[Pb_n >= Pb_n-1] x qb_n - 1[Pb_n <= Pb_n-1] x qb_n-1 - 1[Pa_n <= Pa_n-1] x qa_n + 1[Pa_n >= Pa_n-1] x qa_n-1; OFI = sum of e_n over the interval`

**Inputs:**

- Best bid price and size before and after each update
- Best ask price and size before and after each update
- Interval over which updates are summed

**Worked example.** With an unchanged bid at 20.00 growing from 400 to 500 shares and an unchanged ask at 20.02 shrinking from 350 to 300 shares, one update contributes 150 to OFI. The inputs are illustrative numbers, not market data.

**Reading it.** Positive OFI means net buying pressure in the best quotes (bid size added, ask size removed); negative means net selling pressure. Over short intervals it explains a large share of mid-price changes in the original study.

**Limits.** Needs full level-1 quote updates in sequence, so it cannot be computed from trades alone. It reflects quote activity that can be cancelled rather than executed trades, and its relation to price is strongest over short horizons and varies with depth.


      

## Indicator overview





| Attribute | Value |
| --- | --- |
| Category | Market Microstructure |
| Asset classes | Stocks, ETFs, Futures, Options, Crypto where order-book data exists |
| Output type | Line/scalar |
| Parameters | Varies by implementation; document exact settings on use |






## What is Order Flow Imbalance?



Order Flow Imbalance is a market microstructure measure used to measure liquidity, order flow, execution quality, or price impact at the trading-mechanism level. The production page must define the exact calculation convention before interpreting higher or lower readings, because platform and provider implementations can differ.



For Swoopr, the canonical profile separates definition, calculation, interpretation and decision use. That keeps readers from collapsing a descriptive metric into a trading strategy. An indicator can describe trend, momentum, volatility, participation, positioning or risk without providing a complete entry, exit, sizing or portfolio decision.




## What does it measure?



Order Flow Imbalance measures specific market properties in the Market Microstructure domain. The practical value is repeatability: the same inputs and formula can be applied across a defined dataset, allowing users to compare readings through time or across instruments when the calculation convention is held constant.




## How to read Order Flow Imbalance



Interpretation depends on the market property being measured. A descriptive reading is not automatically predictive. The same numerical state can lead to different outcomes in a strong trend, quiet range, event-driven gap or illiquid market. Always combine with context from price structure, volume, and broader market regime before drawing conclusions.




## Strengths



- It is built from changes in best quotes and sizes, so it captures the net effect of adds, cancels and trades on queue lengths in one sum.
- The measure is additive over time, so intervals can be aggregated by simple summation without re-estimating anything.
- Reproducible when the formula and data convention are fixed.




## Weaknesses and limitations



- The indicator functions depend on tick-level ordering, so out-of-order or batched quote updates in a feed can change the computed series.
- Values are in shares, so the sum depends on the stock's typical quote size and needs scaling before comparing across names.
- Correlated indicators can create false confidence by repeating the same underlying information.




## Editorial and risk note



This page is educational content, not individualized investment advice. It should not imply guaranteed prediction, accuracy or outperformance. Where multiple valid definitions exist, Swoopr states the alternatives and the reason for selecting its primary convention.







## Frequently Asked Questions


        



Is Order Flow Imbalance a buy or sell signal?




No. Positive OFI means net buying pressure in the best quotes (bid size added, ask size removed); negative means net selling pressure. Needs full level-1 quote updates in sequence, so it cannot be computed from trades alone. A trade built on it still needs a trigger, an invalidation rule, a position size and realistic execution assumptions.










What is the best setting for Order Flow Imbalance?




Order Flow Imbalance is computed from best bid price and size before and after each update; best ask price and size before and after each update; interval over which updates are summed, so the choices that matter are the data convention and the window it is read over. Test those across instruments, regimes and out-of-sample periods instead of fitting one historical winner.










Can Order Flow Imbalance be used by itself?




Needs full level-1 quote updates in sequence, so it cannot be computed from trades alone. It reflects quote activity that can be cancelled rather than executed trades, and its relation to price is strongest over short horizons and varies with depth. For that reason it is read next to measures of direction, participation, valuation, liquidity and risk, not alone.










Does Order Flow Imbalance work on every timeframe?




The calculation can be run on any bar size, but behavior is not portable: a reading on a five-minute chart describes a very different market window from the same reading on a daily chart. Validate the exact timeframe before relying on it.










Why does Order Flow Imbalance give false signals?




The indicator functions depend on tick-level ordering, so out-of-order or batched quote updates in a feed can change the computed series. Values are in shares, so the sum depends on the stock's typical quote size and needs scaling before comparing across names. Lag, noise and regime changes add to this, because market participants react to new information after the reading is calculated.










How should Order Flow Imbalance be backtested?




Rebuild Order Flow Imbalance from best bid price and size before and after each update using point-in-time data, write the rules before testing, include delisted securities where relevant, model realistic fills and costs, reserve a validation sample and compare with a simpler baseline.










## References

- [Journal of Financial Econometrics: The Price Impact of Order Book Events (2013)](https://doi.org/10.1093/jjfinec/nbt003)



S




Swoopr Editorial Team



The Swoopr Editorial Team produces independent investment education, research, and tools for understanding markets, evaluating opportunities, and managing risk. All content is educational only and does not constitute personalized investment advice.



See our [editorial policy](https://www.getswoopr.com/legal/editorial-policy/) and [corrections policy](https://www.getswoopr.com/legal/corrections-policy/).
