DEV Community

TildAlice
TildAlice

Posted on • Originally published at tildalice.io

Kalman vs Particle vs LSTM: Trade Signal Latency Under 5ms

The 47ms Gap That Cost Real Money

Particle filters ran 47ms slower than Kalman on the same price stream. That doesn't sound like much—until you realize momentum signals decay in 200-400ms on liquid futures. By the time the particle filter converged, the alpha was gone.

I ran this test because I'd seen conflicting advice everywhere. Some quant blogs swear by particle filters for non-linear price dynamics. Others claim LSTM captures regime changes better. But nobody posted actual latency numbers on streaming data. So here's what happened when I fed 100,000 SPY ticks through all three.

A white KN95 face mask against a black background emphasizing health protection.

Photo by Markus Winkler on Pexels

The Test Setup: Streaming 1-Second Bars

The goal was simple: given a noisy price stream, estimate the "true" underlying signal and generate a buy/sell trigger when the filtered signal crosses a threshold. Each filter gets the same input—1-second OHLC bars from SPY futures—and I measure wall-clock time from receiving a bar to emitting a signal.


python
import numpy as np
import time
from filterpy.kalman import KalmanFilter

---

*Continue reading the full article on [TildAlice](https://tildalice.io/kalman-particle-lstm-trade-signal-latency/)*
Enter fullscreen mode Exit fullscreen mode

Top comments (0)