每笔吃单成交相对最优报价付出的成本。按中间价成交的回测会遗漏这部分成本。
衡量每笔成交相对于当时报价的偏离:买入时高于最优卖价所多付的部分,或卖出时低于最优买价所少收的部分,按区间汇总。
2025年5月14日14:00至14:05 UTC的5分钟K线,Binance BTC-USDT永续合约,数据来自免费预览。
步骤 1
每笔成交均与其时间戳当时或之前最新的最优买价和卖价进行匹配。
正值表示成交价差于该报价,原因是成交吃穿了订单簿多档,或报价已经变动;负值表示成交价落在报价之内。
步骤 2
中位数为零表示至少一半的成交以报价或更优价格成交。在第95百分位,按此卖价买入的成交价约比报价高出 $8.40 /BTC。
步骤 3
在这根K线中,卖方支付的价格略高于买方。
步骤 4
Binance BTC-USDT永续合约,5分钟K线,2025年5月1日至31日,取自免费预览。
按成交量排序的K线,从最清淡的10%到最活跃的10%. 个基点。
按成交量排序,5月最清淡的10% K线p95滑点中位数为0.43 bps,最活跃的10%为1.84 bps。K线均值的中位数为0.14 bps,可见大部分成本集中在尾部。
在下跌超过20 bps的322根K线上,卖出滑点为0.38 bps,买入为0.17 bps。顺势交易的成本最高。
延迟15分钟至11:50 UTC每5分钟自动更新
每笔成交的滑点,是其成交价相对于成交时或之前最新最优报价的偏离:买入为成交价减卖价,卖出为买价减成交价,以该报价的基点表示。正值表示成交价穿过了最优报价,负值表示成交于最优报价之内。
slippage_bps_mean 为K线内的平均值, _p95 为其尾部值, _vwap 为按规模加权的平均值。凡涉及大额交易,请使用p95。
成交最活跃的前 _buy_ and _sell_ 字段按买卖方向拆分。卖出成本高于买入时,说明买单一侧较薄。
从零讲解,详见 从第一性原理理解市场(我们的互动课程):
When most traders say "slippage," they mean the gap between expected and realized price. But that colloquial definition conflates several distinct costs. Precise measurement requires decomposing execution quality against observable benchmarks — a framework that traces back to Perold's (1988) concept of implementation shortfall.
Perold (1988) defined implementation shortfall as the difference between the return of a paper portfolio (where trades execute at decision prices) and the actual portfolio. This total cost decomposes into:
Our slippage metric captures the market impact component directly: the deviation between the execution price and the best available quote (BBO) at the moment of the trade. For a buy, slippage = trade_price − ask_price. For a sell, slippage = bid_price − trade_price. Negative values indicate price improvement.
This aligns with the framework of Almgren & Chriss (2001), where market impact is modeled as having both temporary (transient) and permanent components — our per-trade slippage captures the instantaneous temporary component.
Bessembinder (2003) showed that execution costs vary systematically with market conditions. In trending markets, buy slippage exceeds sell slippage (buyers chase into thin asks) while sells face ample bids. During panics, it reverses. The asymmetry itself is a regime indicator:
For execution quality benchmarking, comparing your actual slippage to the interval-average slippage tells you whether your order routing is better or worse than the typical market participant. Consistently executing above the median slippage means you're being adversely selected — arriving at the worst moments or using suboptimal routing.
A strategy backtested at mid-price or VWAP but executed with above-average slippage is silently bleeding alpha every trade. Engle, Ferstenberg & Russell (2012) estimated that proper slippage modeling can change the sign of backtest profitability for medium-frequency strategies.
References:
# Install the Aperiodic CLI into ~/.local/bin
mkdir -p "$HOME/.local/bin"
curl -fsSL https://raw.githubusercontent.com/aperiodic-io/cli/main/install.sh | INSTALL_DIR="$HOME/.local/bin" bash
export PATH="$HOME/.local/bin:$PATH"
# Free preview — no API key required
aperiodic slippage --preview \
--exchange binance-futures \
--symbol perpetual-BTC-USDT:USDT \
--interval 5m \
--timestamp exchange \
--start-date 2025-05-01 \
--end-date 2025-05-31 \
--output-dir ./data && echo "Saved to $PWD/data"所有交易所和永续合约,从1分钟到日线K线,均提供 Pro.
滑点 ,API文档中的说明:端点与参数 →