malkhut: 3.5H instrumented E2E + calibrated slippage + conditional slippage
This commit is contained in:
@@ -503,7 +503,13 @@ class HftBacktestCWM:
|
||||
if cumulative_usd >= new_fill_price * new_fill_qty:
|
||||
break
|
||||
if cumulative_levels > 0:
|
||||
expected_slippage_bps = cumulative_levels * 0.1 # ~0.1 bps per level consumed
|
||||
# Calibrated slippage: per-asset model from VST data
|
||||
from malkhut.training.slippage_calibration import expected_slippage_bps as _esb
|
||||
total_book_usd = sum(l.price * l.qty for l in (book_depth or ()))
|
||||
expected_slippage_bps = _esb(
|
||||
prev_state.venue.symbol, cumulative_levels,
|
||||
new_fill_price * new_fill_qty, total_book_usd,
|
||||
)
|
||||
|
||||
# Price improvement: how much better than best bid/ask?
|
||||
price_improvement_bps = 0.0
|
||||
|
||||
Reference in New Issue
Block a user