How does kline_refresh_rate differ from refresh_interval?

While both settings control how the bot receives market data, they serve different purposes in the Market Data Engine.


๐Ÿ”น refresh_interval

  • Controls lightweight, frequent price polling
  • Retrieves recent price updates for quick signal reactions
  • Very fast, low-latency polling
  • Directly affects signal responsiveness

Example:

refresh_interval: 3  # poll prices every 3 seconds

๐Ÿ”น kline_refresh_rate

  • Controls full candle (kline) refresh cycles
  • Fetches complete candle data including open, high, low, close, and volume
  • Less frequent than refresh_interval to reduce API load
  • Ensures historical candle data is accurate for indicators and analytics

Example:

kline_refresh_rate: 10  # refresh full candles every 10 seconds

โš–๏ธ Why Separating Them Matters

  1. Performance

    • Quick price polling allows fast signal detection without reloading full candle history every cycle.
  2. API Efficiency

    • Full candle fetches are heavier requests; separating them reduces rate-limit risks.
  3. Accuracy & Stability

    • Historical candles are updated on schedule for indicators and analytics
    • Real-time price changes are captured immediately for trading decisions

๐Ÿš€ Summary

  • refresh_interval โ†’ frequent, lightweight price updates for rapid signal response
  • kline_refresh_rate โ†’ full candle refresh for accurate historical data
  • Separating them optimizes speed, accuracy, and API usage

This distinction ensures the bot reacts fast while maintaining reliable indicator calculations and stable API behavior.

๐Ÿ“Ž Related Topics