Choose Mean or Median for Trading Profit Metrics
Hudson River TradingSoftware Engineer · Technical ScreenLast updated
This problem tests your understanding of statistical measures of central tendency, specifically how different distributions affect the choice between mean and median in high-frequency trading scenarios.
The Problem
Imagine you are building a monitoring dashboard for a high-frequency trading strategy. The strategy executes thousands of trades daily across various liquid assets. You need to provide a single metric that represents the 'typical' profit per trade for a given asset over the last hour.
Your manager suggests using the arithmetic mean to track performance because it is additive and aligns with total PnL. A junior developer suggests using the median because they are worried that sudden market spikes or 'fat-tail' events (extreme winning or losing trades) are skewing the daily averages.
Task
- Explain the statistical trade-offs between using the mean and the median in this context.
- Consider a scenario where your trading strategy has a 'stop-loss' mechanism that limits losses to a fixed amount, but profits are uncapped. How does this asymmetry affect the distribution of your profit data?
- Propose a metric or a combination of metrics that would give the most actionable feedback to the strategy developers without being misleading.
Guidelines
- Assume the profit distribution is not necessarily normal.
- Consider the implications of latency and computational complexity if the data stream is high-volume.
- Focus on robustness against outliers versus the mathematical property of representativeness.
Hints
Hint 1
Consider the difference between a symmetric distribution and a skewed distribution when evaluating how the mean and median react to extreme values.
Hint 2
Think about the mathematical definition of 'total profit' and whether the median of individual trades relates linearly to the sum of all trades.
Hint 3
Recall that in financial time series, outliers often represent significant market regimes or system errors, which might be important to capture rather than ignore.
Follow-up questions
- If we use a trimmed mean, how do we decide the optimal percentage of trades to discard from the tails?
- How would your choice change if the primary purpose of the metric was for an automated risk-control system that triggers a circuit breaker?
- How does the choice between mean and median change if you are analyzing trade latency (duration) instead of trade profit?
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.