From f7766d305b73d01ee90d7f45bfca5bbee30dfefd Mon Sep 17 00:00:00 2001 From: Matthias Date: Mon, 27 May 2019 19:42:12 +0200 Subject: [PATCH 1/3] Improve plotting documentation --- docs/plotting.md | 55 +++++++++++++++++++++++++++++++----------------- 1 file changed, 36 insertions(+), 19 deletions(-) diff --git a/docs/plotting.md b/docs/plotting.md index 60c642ab3..20183ab9c 100644 --- a/docs/plotting.md +++ b/docs/plotting.md @@ -1,63 +1,79 @@ # Plotting + This page explains how to plot prices, indicator, profits. ## Installation Plotting scripts use Plotly library. Install/upgrade it with: -``` -pip install --upgrade plotly +``` bash +pip install -U -r requirements-plot.txt ``` At least version 2.3.0 is required. ## Plot price and indicators + Usage for the price plotter: -``` -script/plot_dataframe.py [-h] [-p pairs] [--live] +``` bash +python3 script/plot_dataframe.py [-h] [-p pairs] [--live] ``` Example -``` -python scripts/plot_dataframe.py -p BTC/ETH + +``` bash +python3 scripts/plot_dataframe.py -p BTC/ETH ``` The `-p` pairs argument, can be used to specify pairs you would like to plot. -**Advanced use** +### Advanced use To plot multiple pairs, separate them with a comma: -``` -python scripts/plot_dataframe.py -p BTC/ETH,XRP/ETH + +``` bash +python3 scripts/plot_dataframe.py -p BTC/ETH,XRP/ETH ``` To plot the current live price use the `--live` flag: -``` -python scripts/plot_dataframe.py -p BTC/ETH --live + +``` bash +python3 scripts/plot_dataframe.py -p BTC/ETH --live ``` To plot a timerange (to zoom in): + +``` bash +python3 scripts/plot_dataframe.py -p BTC/ETH --timerange=100-200 ``` -python scripts/plot_dataframe.py -p BTC/ETH --timerange=100-200 -``` + Timerange doesn't work with live data. To plot trades stored in a database use `--db-url` argument: + +``` bash +python3 scripts/plot_dataframe.py --db-url sqlite:///tradesv3.dry_run.sqlite -p BTC/ETH ``` -python scripts/plot_dataframe.py --db-url sqlite:///tradesv3.dry_run.sqlite -p BTC/ETH + +To polt trades from a backtesting result, use `--export-filename ` + +``` bash +python3 scripts/plot_dataframe.py --export-filename user_data/backtest_data/backtest-result.json -p BTC/ETH ``` To plot a test strategy the strategy should have first be backtested. The results may then be plotted with the -s argument: -``` -python scripts/plot_dataframe.py -s Strategy_Name -p BTC/ETH --datadir user_data/data// + +``` bash +python3 scripts/plot_dataframe.py -s Strategy_Name -p BTC/ETH --datadir user_data/data// ``` ## Plot profit The profit plotter show a picture with three plots: + 1) Average closing price for all pairs 2) The summarized profit made by backtesting. Note that this is not the real-world profit, but @@ -76,13 +92,14 @@ that makes profit spikes. Usage for the profit plotter: -``` -script/plot_profit.py [-h] [-p pair] [--datadir directory] [--ticker_interval num] +``` bash +python3 script/plot_profit.py [-h] [-p pair] [--datadir directory] [--ticker_interval num] ``` The `-p` pair argument, can be used to plot a single pair Example -``` + +``` bash python3 scripts/plot_profit.py --datadir ../freqtrade/freqtrade/tests/testdata-20171221/ -p LTC/BTC ``` From 8b028068bbe22b3aa0988c830aeb85316ee844e0 Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 28 May 2019 07:06:26 +0200 Subject: [PATCH 2/3] Fix typos, add section for custom indicators --- docs/plotting.md | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/docs/plotting.md b/docs/plotting.md index 20183ab9c..eb72b0502 100644 --- a/docs/plotting.md +++ b/docs/plotting.md @@ -1,6 +1,6 @@ # Plotting -This page explains how to plot prices, indicator, profits. +This page explains how to plot prices, indicators and profits. ## Installation @@ -10,8 +10,6 @@ Plotting scripts use Plotly library. Install/upgrade it with: pip install -U -r requirements-plot.txt ``` -At least version 2.3.0 is required. - ## Plot price and indicators Usage for the price plotter: @@ -26,8 +24,14 @@ Example python3 scripts/plot_dataframe.py -p BTC/ETH ``` -The `-p` pairs argument, can be used to specify -pairs you would like to plot. +The `-p` pairs argument can be used to specify pairs you would like to plot. + +Specify custom indicators. +Use `--indicators1` for the main plot and `--indicators2` for the subplot below (if values are in a different range than prices). + +``` bash +python3 scripts/plot_dataframe.py -p BTC/ETH --indicators1 sma,ema --indicators2 macd +``` ### Advanced use @@ -57,13 +61,13 @@ To plot trades stored in a database use `--db-url` argument: python3 scripts/plot_dataframe.py --db-url sqlite:///tradesv3.dry_run.sqlite -p BTC/ETH ``` -To polt trades from a backtesting result, use `--export-filename ` +To plot trades from a backtesting result, use `--export-filename ` ``` bash python3 scripts/plot_dataframe.py --export-filename user_data/backtest_data/backtest-result.json -p BTC/ETH ``` -To plot a test strategy the strategy should have first be backtested. +To plot a custom strategy the strategy should have first be backtested. The results may then be plotted with the -s argument: ``` bash @@ -72,7 +76,7 @@ python3 scripts/plot_dataframe.py -s Strategy_Name -p BTC/ETH --datadir user_dat ## Plot profit -The profit plotter show a picture with three plots: +The profit plotter shows a picture with three plots: 1) Average closing price for all pairs 2) The summarized profit made by backtesting. From 89f44c10a1d17e673a105b062d98857e0ee948ab Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 28 May 2019 19:20:41 +0200 Subject: [PATCH 3/3] Fix grammar error --- docs/plotting.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/plotting.md b/docs/plotting.md index eb72b0502..6dc3d13b1 100644 --- a/docs/plotting.md +++ b/docs/plotting.md @@ -87,7 +87,7 @@ The profit plotter shows a picture with three plots: The first graph is good to get a grip of how the overall market progresses. -The second graph will show how you algorithm works or doesnt. +The second graph will show how your algorithm works or doesn't. Perhaps you want an algorithm that steadily makes small profits, or one that acts less seldom, but makes big swings.