Most order flow blocks in this library compare buy volume against sell volume. That counts shares.
This strategy counts dollars instead, and separates the large prints from the rest, which is a
different question and a harder one to fake.
1. The rule
# BUY
if SumFlowBuyAmt(60) > SumFlowSellAmt(60) * 2 and BigFlowRatio(60) > 0.1:
if DayAmount > 5000000 and (Ask1 - Bid1) / Price < 0.002:
Buy()# SELL
if ProfitPct >= 1.5 or ProfitPct <= -0.7 or HoldTime >= 600:
Sell()
2. What these factors count that the usual ones do not
Factor
What it adds up
SumFlowBuyAmt(60)
dollars of buyer-initiated trades in the last 60 seconds
SumBigBuyAmt(60)
the same, but only prints of $10,000 or more
BigFlowRatio(60)
(large buys − large sells) divided by all turnover in the window
BuyFlowRatio(60)
(buy flow − sell flow) over their sum, so it sits between −1 and +1
Two separate ideas live in that table. The first is direction: who crossed the spread. The second is
size: whether the crossing was done by somebody moving real money or by a thousand small tickets.
BigFlowRatio puts them together in one number. Above zero means large prints were net buying, and
the denominator is total turnover, so the reading is "how much of today's flow was large and
one-sided" rather than a raw dollar figure that means nothing without context.
3. The part that quietly breaks this: stale quotes
Classifying a trade as buyer or seller initiated means comparing its price against the quote at that
instant. If the quote you compare against is old, a rising stock classifies as buying no matter what
is happening, because every print sits above a bid that has not moved yet.
That is not hypothetical. Measured against a reference classification on the same tape, using stale
quotes put the buy share at 0.762 where the correct answer was 0.000. The factor would have
been reading the trend back to you and calling it order flow.
The engine refuses to classify when the quote is older than 500 milliseconds, which is why these
factors sometimes return nothing on a thin name. That is the guard working. A block like this is only
as good as the freshness of the book behind it, which is also why it belongs on names that quote
continuously rather than on anything illiquid.
4. What the round trip asks of it
Order flow entry: the exit block drawn to scale, and the break-even win rate before and after measured trading costs
A 1.5% target against a 0.7% stop needs 32% on paper and 66% once the measured median round trip
is in. That is the honest bar for this block, and it is the number to argue with rather than the
entry logic.
The spread guard at < 0.002 is doing more work than it looks. It is not there to be strict, it is
there to keep you off the names where the round trip is nothing like the median
(what day trading a US stock really costs).
5. What to change first
Loosen BigFlowRatio(60) > 0.1 before you touch anything else. It is the condition that fires least
often, so it is where you will find out whether the large-print filter is adding anything or just
cutting your sample.
Then decide whether you want the ratio or the raw sums. BuyFlowRatio(60) > 0.3 says the same thing
as the first line of the entry in a form that does not change meaning when turnover changes, which
usually makes it easier to carry across symbols.
And check your fills before you believe any of it, because a block this fast is decided by them —
see the last price is not a price you can trade at.
Educational template for research and backtesting. Not investment advice and not a signal service.
Originally published by TraderWe on October 4, 2026. You may quote and link to this page. Republishing the full text without a link back to the original is not permitted.