NursoftAI
schoolLearning Center
Sign InStart Trading Free

Learn

rocket_launchGetting StartedschoolTrading BasicspsychologyStrategieshistoryBacktestingsmart_toyPaper TradingshieldRisk Managementmenu_bookGlossary
Ready to Trade?

Put your knowledge into practice with $100K virtual capital.

Create Free Account
Learnchevron_rightAdvanced Slippage Modeling
speed

Advanced Slippage Modeling

PRO

Model real-world execution costs for accurate backtests

schedule8 min readAdvanced
priority_high

Why This Matters: Basic backtests assume fixed slippage (e.g., 0.1% per trade). But real slippage varies based on order size, time of day, and market volatility. Professional quant firms use dynamic slippage models - now you can too.

What is Slippage?

Slippage is the difference between the price you expect to get and the price you actually get when executing a trade. It's one of the biggest "hidden costs" that can erode your trading profits.

lightbulb

Real World Example

You see Apple trading at $150.00 and place a buy order. But by the time your order reaches the market and gets filled, you pay $150.15. That 15 cents per share is slippage - it adds up fast when you're trading frequently.

Why Fixed Slippage is Misleading

Most backtesting tools use a fixed slippage percentage (like 0.1%). But slippage isn't constant - it changes dramatically based on market conditions:

High Slippage Conditions

  • • Market open (9:30-10:00 AM)
  • • Market close (3:30-4:00 PM)
  • • Large orders relative to volume
  • • High volatility periods
  • • Low liquidity stocks

Low Slippage Conditions

  • • Midday trading (10:30 AM-3:00 PM)
  • • Small orders in liquid stocks
  • • Low volatility periods
  • • High-volume stocks
  • • Limit orders vs market orders

Our Dynamic Slippage Model

Our system uses a multi-factor slippage model that accounts for real market dynamics. This gives you more realistic backtest results.

bar_chart

Volume Impact

Order size relative to market volume

Large orders move the market. If you're buying 10,000 shares and the average minute volume is only 5,000, you'll push the price up as you buy. Our model scales slippage based on your order size versus typical trading volume.

Volume Impact = (Order Size / Avg Volume) × 0.5
schedule

Time of Day

Market open/close have wider spreads

Markets are most volatile at open and close. Bid-ask spreads widen, and prices jump around more. Our model applies time-based multipliers to reflect these conditions.

Open
2.0x
9:30-10:00
Midday
1.0x
10:30-3:00
Close
1.5x
3:30-4:00
trending_up

Volatility Impact

Recent price swings affect execution

When prices are swinging wildly, market makers widen spreads to protect themselves. Our model tracks recent volatility and increases slippage during turbulent periods.

Volatility Impact = StdDev(Returns) × 10 × 0.3
calculate

Combined Formula

Total Slippage = Base Slippage × (1 + Volume + Time + Volatility)
With a cap of 3% to prevent unrealistic estimates in extreme conditions.

Impact on Your Backtests

Using dynamic slippage can significantly change your backtest results, especially for strategies that trade frequently or during volatile periods.

ScenarioFixed (0.1%)DynamicDifference
Small orders, midday0.10%0.08%-20%
Large orders, market open0.10%0.35%+250%
High volatility period0.10%0.22%+120%
Average across all trades0.10%0.15%+50%
warning

More Realistic = Lower Returns

Dynamic slippage often results in lower backtest returns than fixed slippage. This isn't a bug - it's more accurate! Better to discover this in backtesting than in live trading.

How to Use in Your Backtests

When running a backtest, you can choose between slippage models:

Fixed

Simple constant percentage

Basic

Realistic

Volume + Time + Volatility (recommended)

Recommended

Volume Only

Order size impact only

Moderate

bookmarkKey Takeaways

  • check_circleSlippage varies based on order size, time of day, and volatility
  • check_circleFixed slippage can significantly overestimate strategy performance
  • check_circleUse the "Realistic" model for production-ready strategies
  • check_circleLarge orders at market open/close have the highest slippage
arrow_backBacktesting GuideNext: Divergence Trackingarrow_forward

Ready to Apply What You've Learned?

Start paper trading with real market data and test your strategies risk-free.

Get Started FreeExplore Strategies