Docs Download
Home / Docs / Kline / Market Data / Refresh Rates / How does kline_refresh_rate differ from refresh_interval?

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.

Ready to trade? Download MagicTradeBot free and test in paper mode before going live.