Skip to content
All library documents

Using Collected Market Data as a Custom Backtest Source

Article FMZ digest · Author: 善

Summary

This guide extends a market data collector so FMZ’s backtest system can request historical bars from a custom source. The collector stores exchange K-line data in MongoDB while a small HTTP service runs alongside it. When the backtester requests data for a time range, the service queries the corresponding collection, converts prices and volume to the requested precision, and returns bars in the expected schema.

The article describes running the setup on a VPS with Python, MongoDB, and an FMZ docker, then checking the result by comparing a backtest chart with the source market’s chart. Its example uses a selected exchange name as a stand-in because the custom source cannot yet specify the exchange directly. Data availability depends on what the collector has recorded, and the article presents a prototype rather than a tested solution for multi-market coverage or real-level backtesting.

Key ideas

  • A collector can serve stored K-line history to a backtest system through an HTTP endpoint.
  • The service queries MongoDB by requested time range and returns bars in the required format.
  • Price and volume values are scaled to match the backtest precision parameters.
  • The example checks output by comparing a backtest chart with the source market chart.
  • The setup has exchange-selection limitations and requires data to be collected and stored first.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.