Robust Short-Window Volatility Estimation for Market Making
Summary
The document addresses noisy volatility estimates for a market-making bot that receives frequent prices and maintains a rolling window of several minutes. It recommends estimating variability from tick-to-tick price changes or returns, rather than from the price levels themselves, since levels can reflect movement across the window rather than the size of individual changes.
For smoothing, it suggests an exponential moving average to reduce stored state relative to a simple moving average. It also proposes mean absolute deviation as a more outlier-resistant alternative to squared deviations, with a scale adjustment of the square root of pi over two to align it with standard deviation under a normal model. Extreme changes could be capped relative to a current volatility estimate to limit their influence. These are practical suggestions rather than a comparative evaluation: the document gives no empirical test, and the scaling and thresholding choices may need adjustment for the instrument, sampling frequency, and return distribution.
Key ideas
- Estimate short-horizon volatility from price changes or returns, not raw price levels.
- An exponential moving average can smooth an estimate while requiring less state than a simple moving average.
- Mean absolute deviation is less sensitive to large observations than variance-based estimation.
- Under a normal model, scale mean absolute deviation by the square root of pi over two to match standard deviation units.
- Capping extreme changes may reduce outlier influence, but the threshold is a design choice.
Tags
Full text
# What volatility estimator for continuous data and small time window?
# What volatility estimator for continuous data and small time window?
I want to know which volatility estimator should I use for the following scenario:
I am implementing a market making bot and therefore I need to make estimations of the volatility of the price in the fashion of asking: What was the volatility of the price in the last couple of Minutes? (5-30 Minutes)
The data I've got available for the estimation is a set of all the prices in that time period at an interval of about 2-5 seconds, which are about 500 data point. And every time a new data point is added to the set, all data points that are older than the period of interest (5-30 Minutes) are removed from it.
Right now I use a basic estimator that calculates the variance of all the prices, however the problem with that is: the volatility oscillates way to much. I would expect the volatility to change slow and continuous over time.
## Answer by Chris Taylor (score 3, accepted)
https://quant.stackexchange.com/a/30174
First, you should use an exponential moving average, since the amount of state you need to keep is much smaller than for a simple moving average.
Second the well known estimator of volatility,
$$ \hat{\sigma} = \sqrt{\frac{1}{n}\sum_{i=1}^n (x_i - \bar{x})^2} $$
is not very robust, since the squaring amplifies the contribution of outliers (which is why you are observing a very noisy volatility estimate - high frequency data has a lot of outliers).
Instead, consider using a mean absolute deviation estimate,
$$ \hat{\sigma}_{MAD} = \frac{1}{n} \sum_{i=1}^n |x_i - \bar{x}| $$
which is more robust to outliers. You need to multiply this by a factor of $\sqrt{\pi/2}$ so that it matches the scale of the standard deviation estimator above.
The quantities $x_i$ should be the price differences from tick to tick, i.e.
$$ x_i = p_i - p_{i-1} $$
or maybe the returns,
$$ x_i = \frac{p_i}{p_{i-1}} - 1 $$
You might want to consider thresholding the $x_i$ to some maximum value, say 5x or 10x the current volatility estimate, to reduce the impact of outliers even further.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.