Vectorized Backtest Engine - Quant Researcher Interview Question
Difficulty: Medium
Category: backtesting
Asked at: Citadel, WorldQuant, Two Sigma, AQR Capital Management, G-Research, Millennium
Topics: pandas, numpy, finance, vectorization
Problem Description
Backtesting simulates a trading strategy using historical data to evaluate potential risk and profitability before capital deployment. A critical requirement for any backtest is the elimination of look-ahead bias, ensuring that strategy decisions at any given time rely solely on data available up to that moment.
Task
Implement a function solution(prices, signal) that calculates the performance metrics of a trading strategy based on a series of asset prices and trading signals. The function must
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.