What does max_kline_length control?

The max_kline_length setting defines how many historical candles (klines) are kept in memory per symbol.

It determines how much past market data the bot can access for indicators, signals, and analytics.


⚙️ How It Affects the Bot

  1. Indicator Lookback Windows

    • Indicators like MACD, RSI, Ichimoku Cloud require a certain number of past candles to calculate correctly.
    • Example:

      • MACD → at least 52 candles
      • Ichimoku Cloud → may require 100 candles
  2. Multi-Phase Signal Detection

    • Strategies that compare multiple timeframes or phases need sufficient historical data.
    • Too few candles → signals may be incomplete or inaccurate.
  3. Memory Usage

    • More candles → higher memory consumption
    • Fewer candles → lower memory usage, but risk breaking long-lookback strategies

⚖️ Considerations

  • Too low:

    • Some indicators or strategies may fail
    • Signal accuracy may drop
  • Too high:

    • Increased memory usage
    • Slightly longer processing times

Recommended range for most strategies: 50–100 candles

Adjust based on your strategy requirements and available system resources.


🚀 Summary

max_kline_length controls how many historical candles the bot keeps per symbol:

  • Determines indicator accuracy
  • Supports multi-phase signals
  • Impacts memory usage

Proper tuning ensures both strategy effectiveness and system efficiency.

📎 Related Topics