Execution cost
Every TCA vendor approximates one missing number: what the price would have done if you had never traded. Here you can run that world.
ex = tf.tca.analyse(
my_algo, seed=42,
universe=u, days=5)
ex.shortfall_bps() # what it cost
ex.by_step() # where
ex.partial_fills() # asked vs got
Two runs, one seed
Where the cost comes from
There is no slippage formula in the code. A big order pays more because it takes the levels that rest above it. Below is one market buy for 175 shares, replayed from the engine's own reference program.
The book before the order
What 175 shares cost
The number nobody else can measure
Arrival price, VWAP and fitted impact models all stand in for a counterfactual that real data can not supply. Round-trip shortfall measured over eight simulation seeds:
The range crosses zero, so a round trip can end up ahead. This happens when the market moves your way during the order. It is the reason one run tells you nothing about your algorithm.
One known boundary: the fear gauge leaks
VIX drives the market factor's variance, so the market prices fear of your flow. Names that you never touched can move a few basis points through that channel. That is impact, not an artefact of the measurement. If you need the subtraction to be exact, pin VIX in both worlds and the two runs match byte for byte.