Evaluating Dynamic Position Sizing with P&L-Based Sharpe Ratios
Summary
The discussion addresses a backtest in which a mean-reversion pairs strategy scales positions as the spread moves farther from its mean. Its central recommendation is to track daily profit and loss in currency terms, reflecting the strategy’s actual position sizes, instead of trying to adjust the mean and standard deviation of percentage returns by weighting them with the number of positions. From a properly constructed P&L series, the researcher can calculate the mean, standard deviation, and Sharpe ratio.
The response emphasizes two requirements: the backtest should be self-financing, so allocation changes are funded through portfolio value, and it should include transaction costs. These choices matter for strategies that roll futures or trade small signals that may not overcome trading costs. P&L can also be compared with initial capital, gross exposure, drawdown, and traded volume to describe other aspects of performance. The advice does not prescribe a single capital-normalization convention or resolve how to optimize sizing; those depend on the strategy and evaluation objective.
Key ideas
- Calculate daily P&L in currency terms so changing position sizes affect measured performance.
- Build a self-financing backtest that accounts for how allocation changes are funded.
- Include transaction costs to distinguish gross from net strategy performance.
- Use P&L mean and volatility to calculate a Sharpe ratio, and consider exposure or drawdown metrics for additional context.
- Financing costs and futures roll costs can materially affect backtest results.
Tags
Full text
# Calculating Sharpe Ratio with dynamic position sizing # Calculating Sharpe Ratio with dynamic position sizing I'm currently backtesting a mean reversion pairs trading strategy. However, instead of simple long or short trading signals, I'm using multiple "levels", where the further away the spread is from the mean, the more positions I put on. However, since the Sharpe Ratio (and other performance metrics) only use percent returns, it only captures whether or not I'm in or out of the market, since regardless of whether or not I'm holding 1 or 10 positions, the percent return is the same. Is there a way to calculate the Sharpe Ratio while accounting for dynamic position sizing? If not, are there any risk-adjusted performance measures that are able to capture this behavior? I was thinking of weighting the mean and standard deviation of the daily returns based on the number of positions for each day, but I'm not sure if that's the right approach. ## Answer by Ezy (score 4) https://quant.stackexchange.com/a/42209 To calculate the sharpe ratio of a strategy backtest you should ultimately go back in $ space and calculate for every day your PNL (profit and loss), not returns, because at the end of the day this reflects better what you practically will do. Important properties of your backtest are that - it needs to be self-financing: no cash is injected from one period to the next so all your changes in portfolio allocation need to be financed by the variation of your portfolio value. This is important for instance if you backtest strategies that roll futures: when you roll from one expiry to the next you need to take into account that the new future and the old future trade at different level (this is also called roll-cost) - properly reflect transaction costs: this will allow you to distinguish between "gross PNL" and "net" PNL and also very importantly will prevent you from selecting strategies that try to monetize signals that are seemingly very robust but too small compared to half-spread say (often signals have very strong predictive power but cannot be monetized because they are too small in magnitude) at the end of the day, your backtest will give you a series of daily PNL (gross and net) for which you can calculate mean, std dev and sharpe ratio. Once you know the total pnl you can measure it in relation to other parameters of your strategy (eg: initial capital, maximum gross exposure, maximum drawdown, gross traded volume etc.. etc..) that will give you additional performance metrics which can be indicative of various properties of your investment strategy ## Answer by David Addison (score 0) https://quant.stackexchange.com/a/42213 Calculating the Sharpe ratio is done a posteriori-that is, after the strategy has been run forward. If dynamic position sizings improve the realized Sharpe ratio, then there may be some sort of interaction between the spread size and expected forward return. But that's just one small point of distinction. A slightly different question might be phrased as such: How to find maximize the Sharpe ratio for a given strategy? There are different ways to answer this question. In a non-smooth universe, such as that of historical/realized stock returns, there may be an optimal solution which is not robust. However, if expected returns (and variances) can be defined by smooth functions, there may be analytical solution(s) which maximize the expected Sharpe ratio. The math to maximize the Sharpe ratio can be quite complicated depending on the level of sophistication and the modeling assumptions used. But to start off, I would recommend reading on optimal Kelly bets (i.e., those which maximize the log rate of return) for a one-stock portfolio, and then branching off from there. So until I have more time to work this through, I'll leave it to others to answer more thoroughly. ## Answer by Charles Fox (score 0) https://quant.stackexchange.com/a/42220 Yes, I've tried to calculated it analytically for another question where the scaling is linear. However, I haven't had a chance to write a simulation to check my work. Roughly, a backtest would roughly look like: Don't forget to adjust for financing costs!
Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.