Pre-trade checks in code: the cheap filters that save the most money
Good scalping systems spend as much effort on not trading as on trading. A set of pre-trade checks can block entries when conditions are poor, and each check is easy to implement.
Typical checks include maximum spread, minimum tick rate, maximum time since last tick, minimum distance from the previous stop level, margin availability, and maximum slippage tolerance. Time-based filters for rollover and news windows add further protection.
Each rule addresses a known failure mode. A spread cap avoids paying through the nose. A tick rate check avoids stale feeds. A margin check prevents rejected orders and partial states.
The rules should be logged. When a trade is skipped, record the reason. Over time, the log shows which filters are firing and how often, and whether they are too strict or too lax.
A system with robust pre-trade checks often outperforms a more clever one without them, simply because it avoids the worst fills.
Which pre-trade filter has saved the most money in your experience?
Pre-trade checks in code: the cheap filters that save the most money
-
Amanhasnoname
- Posts: 2060
- Joined: Fri Oct 30, 2026 9:45 am
Re: Pre-trade checks in code: the cheap filters that save the most money
The filter that paid for itself was a hard spread cap, not anything clever about the setup. The code skips a new EURUSD entry if the spread is above nine tenths of a pip, or GBPUSD above one point four. In a recent month that rule blocked twenty-three would-be trades, and seventeen of those prints were already one and a half pips or more against me from the wide quote alone. I would have been starting in a hole before the setup had a chance.
A close second is refusing an entry when the last tick is older than two and a half seconds. That one fired nine times in the same month and caught a stale feed during a small outage I would otherwise have traded through.
Every skip is written to a log with the reason. The spread cap fired sixty-one times across a longer stretch, the news window fourteen times, and the stale-tick check nine. Seeing the counts stopped me from loosening the spread rule on days when I felt I was missing trades.
A close second is refusing an entry when the last tick is older than two and a half seconds. That one fired nine times in the same month and caught a stale feed during a small outage I would otherwise have traded through.
Every skip is written to a log with the reason. The spread cap fired sixty-one times across a longer stretch, the news window fourteen times, and the stale-tick check nine. Seeing the counts stopped me from loosening the spread rule on days when I felt I was missing trades.
-
FXS London Scalper
- Posts: 976
- Joined: Sun Oct 18, 2026 12:25 pm
Re: Pre-trade checks in code: the cheap filters that save the most money
A spread check before every entry is the cheapest filter and probably the most valuable. Adding a time filter for rollover and a check that no high-impact release is within the next few minutes covers most of the rest.
FXS Official Team | London Session Desk
Re: Pre-trade checks in code: the cheap filters that save the most money
FXS London Scalper wrote: Thu Nov 12, 2026 1:15 pmA spread check before every entry is the cheapest filter and probably the most valuable. Adding a time filter for rollover and a check that no high-impact release is within the next few minutes covers most of the rest.
The spread cap is a strong first gate, but I would make it pair- and session-specific and keep the threshold separate from the setup logic. A 0.9-pip maximum on EURUSD may be reasonable for one account during London, yet the same absolute limit can reject every valid setup on a wider cross or accept a poor quote after rollover. For a 5-pip target, a 1.0-pip spread consumes 20% of the gross target before commission or slippage, so recording expected all-in cost as a fraction of the target is useful. I also like logging skipped signals, but I would compare them with fills using the same entry rules; otherwise loosening the cap later can look good simply because it adds trades. One extra check worth adding is the maximum allowed distance between signal and actual fill. If a stop order slips 1.5 pips beyond a 6-pip stop, either cut size to keep dollar risk fixed or reject the order rather than silently expanding risk.
It’s Fairman 