Slippage & Transaction Cost Modeling - Quant Researcher Interview Question
Difficulty: Medium
Category: market_microstructure
Asked at: Barclays, Citadel, Two Sigma, Morgan Stanley, JPMorgan, Goldman Sachs, Millennium
Topics: backtesting, transaction-costs, pnl-calculation, numpy
Problem Description
Accurate backtesting requires modeling transaction costs, often decomposed into linear components like bid-ask spreads and quadratic components representing market impact. These costs significantly affect the realized Profit and Loss (PnL) of a trading strategy, necessitating precise calculation methods for realistic performance evaluation.
Task
Implement the function solution(prices, positions, linear_impact, quadratic_impact) to calculate the cumulative Net PnL and Total Transaction Costs for
Practice this medium researcher interview question on MyntBit - the LeetCode for quants with 200+ quant interview questions for Jane Street, Citadel, Two Sigma, and other top quantitative finance firms.