Skip to content
All library documents

Building and Testing Trading Strategies in Freqtrade

Article Freqtrade docs

Summary

This quick start explains how a Freqtrade strategy turns exchange candle data into indicators, entry and exit signals, and orders. A strategy is implemented as a Python class with separate methods for calculating indicators and populating long or short signals. The example uses RSI to illustrate a basic long entry below 30 and exit above 70, alongside a 15-minute timeframe, a stop-loss setting, and a minimum return target. It also explains that available stake, open-trade limits, existing positions, conflicting signals, and strategy callbacks can prevent a signal from becoming an order.

The guide distinguishes historical backtesting from dry-run forward testing with live market data. It cautions that backtests can be misleading: they assume fills and simplified execution timing, while live dry runs can differ in fill prices, delays, and resulting profit calculations. It recommends comparing the two modes and checking signal consistency, and mentions lookahead and recursive analysis as basic flaw checks. The example teaches platform structure, not a validated profitable strategy; the guide also notes that public backtest results may be unrealistic.

Key ideas

  • A Freqtrade strategy calculates indicators from candle data and uses them to create entry and exit signals.
  • Separate strategy methods populate indicators, long or short entries, and exits.
  • A signal may fail to create an order because of stake, slot, existing-position, collision, or callback constraints.
  • Backtests and dry runs differ in fill assumptions, timing, and resulting profit calculations.
  • Strategy examples and backtest results require careful validation and do not establish future profitability.

Tags

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