πChapter 6: "Show and Tell! plot-dataframe Chart Visualization Tutorial"
This article was produced by the Quantitative Trading Lab at https://www.itrade.icu. Visit for more benefits.
During strategy development, backtesting results are often presented in tabular form, making it difficult to quickly identify issues. The plot-dataframe command can visualize buy/sell points, indicator lines, and price movements in charts, helping you instantly see strategy performance.
π― 1. Basic Usage: Plotting Charts
freqtrade plot-dataframe \
--config user_data/config.json \
--strategy MyStrategy \
--timerange 20230101-20230201After execution, an .html file will be generated under user_data/plot/, which can be opened directly in a browser. It includes:
Candlestick price movements
Buy/Sell points (arrows)
Technical indicators (e.g., EMA, MACD)
π§Ύ 2. Parameter Details
--config
Path to the config file, including trading pairs and timeframes
--strategy
Strategy class name (e.g., MyStrategy)
--timerange
Specify the plotting period, format like 20230101-20230201
--indicators1
Indicators plotted on the main chart (e.g., EMA, close)
--indicators2
Sub-chart indicators (e.g., RSI, MACD)
--exportfilename
Export file path (supports .html or .png)
--userdir
Custom user_data path (default is fine)
π 3. Adding Custom Indicators
You can add extra indicators to the chart to validate signal logic:
Example code:
--indicators1will be plotted on the main chart (price chart), e.g., EMA lines.--indicators2will be plotted on sub-charts, e.g., RSI, MACD.
Full example:
β Note:
These indicator names must match the column names in your strategy classβs populate_indicators() method (added to the DataFrame).
Names must exactly match your dataframe column names.
Otherwise, no error will occur, but the chart will not display the desired lines.
Indicators must be defined in
populate_indicators()to take effect.
πΎ 4. Export as HTML / PNG
By default, output is an HTML file. To specify:
To export as PNG (static image):
π Note: Exporting PNG requires additional tools like Puppeteer or headless Chrome. Beginners are recommended to use HTML format.
π³ 5. Running in Docker
Example command in Docker:
Make sure the /quants/freqtrade/user_data directory is correctly mounted in docker-compose.yml.
β
6. Usage Suggestions
Check strategy logic
See if buy/sell points are at appropriate positions
Assist debugging
Compare indicators with signal relationships
Share strategy
Export chart as HTML for easy presentation
Evaluate indicator performance
Plot multiple indicators to check redundancy
π Summary
plot-dataframe is a powerful visualization tool provided by Freqtrade, especially useful for debugging complex strategies and validating buy/sell logic.
Recommended Workflow:
Backtest the strategy:
Plot the chart:
Analyze the chart:
Are strategy buys too early or too late?
Are there frequent false signals?
Are the indicators effective?
Mastering plot-dataframe provides a solid foundation for strategy optimization and more efficient tuning!
Last updated