Skip to content
All library documents

Collecting Live Candlestick Data in a Trading Bot

Article FMZ forum · Author: lengfeng

Summary

This beginner tutorial explains why a live trading system may need to collect its own candlestick history. Some exchanges provide candle data directly, while others may not. The author distinguishes live use from testing: the platform supplies historical candles in its test environment, but does not make its internally collected series available for live trading because its quantity and accuracy may differ slightly from exchange data.

The example repeatedly calls an exchange method to retrieve records, checks whether data was returned, and logs the number of collected minute candles, with a delay between polling cycles. The article states a maximum retained history of 1,411 records; beyond 1,441, the oldest are removed to limit performance impact. It is a basic data-collection illustration rather than a guide to candle aggregation, missing-data handling, timestamp alignment, or storage. It gives no trading results or analysis of the reliability of the resulting series.

Key ideas

  • Some exchanges expose candle history directly, while others require a live system to collect it.
  • The tutorial distinguishes exchange data in live operation from platform-provided historical data in testing.
  • Its example polls for records, checks for a response, and logs the number of minute candles collected.
  • The article describes a bounded record history to limit performance impact.
  • It does not address candle validation, gaps, timestamp alignment, or the quality of collected data.

Tags

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