Enhance Validity & Robustness (Metrics, Latency, MSVC Fixes)#19
Enhance Validity & Robustness (Metrics, Latency, MSVC Fixes)#19w0wl0lxd wants to merge 2 commits into
Conversation
This commit consolidates several improvements:
There was a problem hiding this comment.
That's great. I guess we can extend this idea, by creating a semi-realistic event-generator, in a way that respects the key metrics that would make an LOB coherent:
- Synthetic mid price that does a small random walk so that the book doesn't sit at a constant level
- Realistic order type mix
- Controlled aggressiveness/immediate executions
- Price placement relative to mid (creating depth near top + occasional deeper levels)
- Size distribution (heavy tail-ish)
Then a given RATE events/sec must be generated. It might also be useful to introduce a mechanism to control the "burstiness" of event generation to further promote realism. Then I guess we can create a generator thread and a processing thread, each pinned into its own core, and establish communication via a queue (basic single-threaded producer/consumer architecture) and do proper performance analysis. Not a part of this MR though.
|
Format is failing. Just run |
|
Why delete sample data and gitignore? |
I’ve been spending some time tightening up the simulation validity and fixing a few long-standing headaches with the Windows build environment.
The core addition is a MetricsSink. One of the biggest challenges with this simulator has been validating that the internal LOB state actually reflects the expected microstructure signals. Without built-in spread and imbalance tracking, you're forced to do a lot of heavy lifting in post-processing. This sink now handles that natively in C++ on every update, so these metrics are available for live analysis in Python without the manual overhead.
I also tackled the execution model in MultiBookSimulator. Real-world HFT isn’t deterministic when it comes to network and matching delays. I’ve introduced a configurable stochastic latency model supporting LogNormal and Uniform distributions, jitter is now a first-class citizen in the simulation.
On the infra side:
All 123 core tests are green on both Linux and Windows.