From 2b3f2e5fa817088c04267c5a488aa371812be1c4 Mon Sep 17 00:00:00 2001 From: Matthias Date: Mon, 6 Jan 2020 12:55:12 +0100 Subject: [PATCH] Add first version of documentation --- docs/plotting.md | 56 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/docs/plotting.md b/docs/plotting.md index ba737562f..5b5199821 100644 --- a/docs/plotting.md +++ b/docs/plotting.md @@ -120,6 +120,62 @@ To plot trades from a backtesting result, use `--export-filename ` freqtrade plot-dataframe --strategy AwesomeStrategy --export-filename user_data/backtest_results/backtest-result.json -p BTC/ETH ``` +### Plot dataframe basics + +![plot-dataframe](assets/plot-dataframe.png) + +plot-dataframe will require backtesting data, a strategy as well as either a backtesting-results file or a Database file, containing trades corresponding to the strategy. + +The resulting plot will have the following elements: + +* Green triangles: Buy signals from the strategy. (Note: not every Buy-signal also generates a trade) +* Red triangles: Sell signals from the strategy. +* Cyan Circles: Trade entry +* Red Square: Trade exit for loss or 0% profit +* Green Square: Trade exit for profit +* Indicators corresponding to the candle scale (e.g. SMA/EMA), as specified with `--indicators1`. +* Indicators with different scales (e.g. MACD, RSI) below the volume bars, as specified via `--indicators2`. +* Volume (bar chart at the bottom of the main chart) + +#### Advanced Plot configuration + +An advanced plot-configuration can be specified in the strategy. + +This configuration allows to specify fixed colors (otherwise consecutive plots may produce different colorschemes each time, making comparisons diffiult.). +It also allows multiple subplots to display both MACD and RSI at the same time. + +Additional features when using plot_config: + +* Specify colors per indicator +* Specify additional subplots + +Sample configuration with inline comments explaining the process: + +``` python + plot_config = { + 'main_plot': { + # Configuration for main plot indicators. + # Specifies `ema10` to be red, and `ema50` to be a shade of gray + 'ema10': {'color': 'red'}, + 'ema50': {'color': '#CCCCCC'}, + }, + 'subplots': { + # Create subplot MACD + "MACD": { + 'macd': {'color': 'blue'}, + 'macdsignal': {'color': 'orange'}, + }, + # Additional subplot RSI + "RSI": { + 'rsi': {'color': 'red'}, + } + } + } +``` + +!!! Note + The above configuration assumes that `ema10`, `ema50`, `macd`, `macdsignal` and `rsi` are columns in the DataFrame created by the strategy. + ## Plot profit ![plot-profit](assets/plot-profit.png)