2018-01-12 10:49:50 +00:00
|
|
|
# Plotting
|
|
|
|
This page explains how to plot prices, indicator, profits.
|
|
|
|
|
2018-01-28 10:53:52 +00:00
|
|
|
## Installation
|
|
|
|
|
|
|
|
Plotting scripts use Plotly library. Install/upgrade it with:
|
|
|
|
|
|
|
|
```
|
|
|
|
pip install --upgrade plotly
|
|
|
|
```
|
|
|
|
|
|
|
|
At least version 2.3.0 is required.
|
|
|
|
|
2018-01-12 10:49:50 +00:00
|
|
|
## Plot price and indicators
|
|
|
|
Usage for the price plotter:
|
2018-01-28 10:53:52 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
script/plot_dataframe.py [-h] [-p pair] [--live]
|
|
|
|
```
|
2018-01-12 10:49:50 +00:00
|
|
|
|
|
|
|
Example
|
|
|
|
```
|
2018-07-13 22:07:38 +00:00
|
|
|
python scripts/plot_dataframe.py -p BTC/ETH
|
2018-01-12 10:49:50 +00:00
|
|
|
```
|
|
|
|
|
2018-01-28 10:53:52 +00:00
|
|
|
The `-p` pair argument, can be used to specify what
|
2018-01-12 10:49:50 +00:00
|
|
|
pair you would like to plot.
|
|
|
|
|
2018-01-21 12:44:30 +00:00
|
|
|
**Advanced use**
|
|
|
|
|
2018-01-28 10:53:52 +00:00
|
|
|
To plot the current live price use the `--live` flag:
|
2018-01-21 12:44:30 +00:00
|
|
|
```
|
2018-07-13 22:07:38 +00:00
|
|
|
python scripts/plot_dataframe.py -p BTC/ETH --live
|
2018-01-21 12:44:30 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
To plot a timerange (to zoom in):
|
|
|
|
```
|
2018-07-13 22:07:38 +00:00
|
|
|
python scripts/plot_dataframe.py -p BTC/ETH --timerange=100-200
|
2018-01-21 12:44:30 +00:00
|
|
|
```
|
|
|
|
Timerange doesn't work with live data.
|
|
|
|
|
2018-05-19 06:14:42 +00:00
|
|
|
To plot trades stored in a database use `--db-url` argument:
|
|
|
|
```
|
2018-07-13 22:07:38 +00:00
|
|
|
python scripts/plot_dataframe.py --db-url sqlite:///tradesv3.dry_run.sqlite -p BTC/ETH
|
2018-05-19 06:14:42 +00:00
|
|
|
```
|
2018-01-12 09:55:49 +00:00
|
|
|
|
2018-12-30 16:20:16 +00:00
|
|
|
To plot a test strategy the strategy should have first be backtested.
|
2018-06-07 15:13:55 +00:00
|
|
|
The results may then be plotted with the -s argument:
|
|
|
|
```
|
2018-06-07 15:18:19 +00:00
|
|
|
python scripts/plot_dataframe.py -s Strategy_Name -p BTC/ETH --datadir user_data/data/<exchange_name>/
|
2018-06-07 15:13:55 +00:00
|
|
|
```
|
|
|
|
|
2018-01-12 09:55:49 +00:00
|
|
|
## 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
|
|
|
|
more of an estimate.
|
|
|
|
3) Each pair individually profit
|
|
|
|
|
|
|
|
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.
|
|
|
|
Perhaps you want an algorithm that steadily makes small profits,
|
|
|
|
or one that acts less seldom, but makes big swings.
|
|
|
|
|
|
|
|
The third graph can be useful to spot outliers, events in pairs
|
|
|
|
that makes profit spikes.
|
|
|
|
|
|
|
|
Usage for the profit plotter:
|
2018-01-28 10:53:52 +00:00
|
|
|
|
|
|
|
```
|
2018-01-12 09:55:49 +00:00
|
|
|
script/plot_profit.py [-h] [-p pair] [--datadir directory] [--ticker_interval num]
|
2018-01-28 10:53:52 +00:00
|
|
|
```
|
2018-01-12 09:55:49 +00:00
|
|
|
|
2018-01-28 10:53:52 +00:00
|
|
|
The `-p` pair argument, can be used to plot a single pair
|
2018-01-12 09:55:49 +00:00
|
|
|
|
|
|
|
Example
|
|
|
|
```
|
2018-03-15 22:34:13 +00:00
|
|
|
python3 scripts/plot_profit.py --datadir ../freqtrade/freqtrade/tests/testdata-20171221/ -p BTC_LTC
|
2018-01-12 09:55:49 +00:00
|
|
|
```
|