Filtering Thin-Book Price Spikes in a Forex Market-Making Bot
Summary
The document describes a forex market-making bot that places offers around the mid price and refreshes them at regular intervals. In the market described, thin order books can cause sharp mid-price jumps after a large order; the moves are said to last briefly before the book and price stabilize. Such jumps can leave resting quotes exposed to prices that no longer reflect the recovered market.
The author considers two filters: measuring recent volatility and withdrawing offers above a threshold, or sampling prices and comparing the current price with an exponentially weighted moving average. The question is which approach best protects the bot from these outliers. No answer, test, or performance comparison is included, so the document does not establish that either filter works. Its examples are tied to one market and quote-update cadence; it does not discuss how thresholds, order-book signals, execution costs, or missed trading opportunities should be handled.
Key ideas
- Thin order books can produce transient mid-price jumps after large orders.
- The bot refreshes its market-making offers periodically, creating exposure during a price spike.
- The author considers volatility-based quote withdrawal and distance from an exponentially weighted average.
- The document asks which filter is effective but provides no results or recommendation.
Tags
Full text
# Volatility vs. Moving Average Distance # Volatility vs. Moving Average Distance Currently I am designing a little market making bot for forex trading, that puts offers around the mid price. In the market I am trading it happens the order book becomes so thin that the mid price jumps up or down by quite a bit (say 30%) when one big order hits the order book. Just have a look at this chart around Dec 25th These events always last just for around 30-60 seconds until the order books recover and the mid price becomes stable again. My market making bot updates its offers in 12-15 second intervals. Now my question is how to deal effectively with these "outliers"? My first idea was to measure the volatility before the bot updates its offers. And when the volatility is to high the bot just deletes the offers and waits until the volatility falls below a certain threshold again. My second approach is to sample the price in say 10 second intervals and put these prices in a EWMA model. Then before updating the price I check the relative distance of the current price from the moving average. What would be the most sensible approach to stop the bot from suffering from these outliers of the mid price.
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.