STRATEGY LIBRARY

Volume surge entry with a spread guard (US stocks)

Contents
Volume confirmation is the most common filter in this library and the easiest to write badly. The point is the comparison against that symbol's own recent average, not an absolute number.

1. The rule

# BUY if TradeAmount > AvgTradeAmount(300) * 3 and Strength > AvgStrength(300) * 1.2: if (Ask1 - Bid1) / Price < 0.002 and DayAmount > 5000000: Buy()# SELL if ProfitPct >= 1.0 or ProfitPct <= -0.5 or HoldTime >= 600: Sell()

2. Why every threshold is relative

ConditionCompared againstNot against
TradeAmount > AvgTradeAmount(300) * 3this symbol's own last five minutesa fixed dollar figure
Strength > AvgStrength(300) * 1.2this symbol's own recent buying pressurea fixed number like 120
An absolute threshold passes constantly on a heavily traded name and never on a thin one, which is the opposite of what a surge filter is for. A surge is a change from that symbol's normal, and "normal" is different for every symbol and every hour of the day.

3. The spread guard is not optional at this speed

The target here is 1.0%. At a 0.2% spread the round trip has already taken a fifth of it before the trade does anything, which is why (Ask1 - Bid1) / Price < 0.002 sits in the entry rather than in a comment. Worth knowing what you are guarding against: a third of all quotes in this population are already one cent wide, and on a low-priced name that single cent can be most of your target (what day trading a US stock really costs).

4. What the round trip asks of it

Volume surge entry: the exit block drawn to scale, and the break-even win rate before and after measured trading costs
Volume surge entry: the exit block drawn to scale, and the break-even win rate before and after measured trading costs
This is the number that should change how you use this block. A 1.0% target against a 0.5% stop needs 33% on paper and 83% against the measured median round trip. Read that as a statement about the target, not about the entry. A one percent target on the median-cost name does not work, no matter how good the surge filter is. Either the spread guard has to put you well below the median — which is its job, and is testable — or the target has to be larger.

5. What to change first

Tighten the spread guard and widen the target together. Going to < 0.001 and a 2.0% target moves the break-even from 83% to around 50%, and costs you trades rather than edge. Then verify your fills rather than assuming them. A backtest that fills at the last trade price is not measuring this at all — see the last price is not a price you can trade at and one tick of slippage erased 44% of the backtest edge.

Educational template for research and backtesting. Not investment advice and not a signal service.

Related reading

← All strategy library

Originally published by TraderWe on August 13, 2026. You may quote and link to this page. Republishing the full text without a link back to the original is not permitted.

2 replies

R
RiskFirstRita· Aug 2026 ago
The spread guard being inside the entry condition rather than a comment is the part I'd underline twice - a filter you have to remember to apply manually isn't a filter. What I'd want spelled out is the exit side: the stop is tighter than the target, so my checklist question is how often the hold-time exit fires versus the two price exits, because if most trades die on the clock the whole thing lives or dies on that timer, not on the surge rule. Also worth asking what happens if the spread blows out after you're already in - entry is guarded, the way out isn't.
F
FiveMinFiona· Aug 2026 ago
The spread guard at entry is good but I'd check it again on the exit side too — the spread that was fine when you bought is usually widest exactly when your -0.5% stop trips. Also what does AvgTradeAmount(300) mean on a 1s timeframe, 300 bars or 300 seconds? Worth spelling out because that's five minutes vs something much longer depending on the answer, and the whole filter hangs on it.
Sign in to reply →