Skip to content

Commit 4028603

Browse files
committed
Initial bokeh plotting implementation
1 parent b41f388 commit 4028603

7 files changed

+1667
-159
lines changed

README.md

+77-5
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,94 @@ A Jupyter Notebook to make backtesting, analysis and plotting of freqtrade strat
44

55
## Prerequisites
66

7+
Clone this repository onto your machine.
8+
79
You will need to install jupyter to run this notebook. Please follow any Jupyter installation instructions for your OS or environment.
810

9-
You will also need extra dependencies for running the notebook. If using an existing freqtrade install (setup.sh script), activate the environment and:
11+
You will also need extra dependencies for running the notebook. If using an existing freqtrade install (setup.sh script), activate your existing freqtrade venv environment and pip install:
12+
13+
```
14+
cd /path/to/freqtrade
15+
source .env/bin/activate
1016
11-
`pip install tqdm quantstats`
17+
pip install -r /path/to/freqtrade_analysis_notebook/requirements.txt
18+
```
1219

1320
### Docker
1421

1522
This has not been tested in any docker environments, so YMMV, but some instructions that might be useful are in [this issue](https://github.com/froggleston/freqtrade_analysis_notebook/issues/1)
1623

1724
## Installation
1825

19-
Copy both files into your base freqtrade folder, **not** the user_data/notebooks folder.
26+
Follow one of the two methods below:
27+
28+
### Easiest installation
29+
30+
- Copy all `.py` files and the `RollingBacktestNotebook.ipynb` into your base freqtrade folder, **not** the user_data/notebooks folder.
31+
- Set the `freqtrade_dir` variable in the notebook to `"."`
32+
33+
### Easy-ish installation
34+
35+
- Leave the `.py` files and `RollingBacktestNotebook.ipynb` notebook in your cloned directory.
36+
- Set the `freqtrade_dir` to the absolute path of your base freqtrade folder, e.g. `/home/froggleston/freqtrade`
37+
- If you set your `user_data_dir` and `strategy_path` in your config, they need to also be set to the absolute paths to your folders, e.g.
38+
- `"user_data_dir" : "/home/froggleston/freqtrade/user_data"`
39+
- `"strategy_path": "/home/froggleston/freqtrade/user_data/strategies"`
2040

2141
## Running
2242

23-
With your venv activated, start your jupyter server in the freqtrade folder, and open the ipynb file. Run the cells as normal.
43+
### Via the command line
44+
45+
If you copied the notebook and helper files to your freqtrade folder, navigate there:
46+
47+
```
48+
cd /path/to/freqtrade
49+
```
50+
51+
Or if you left the notebook and helper files in the cloned git folder, navigate there:
52+
53+
```
54+
cd /path/to/freqtrade_analysis_notebook
55+
```
56+
57+
Then run the jupyter server:
58+
59+
```
60+
jupyter notebook --port 8889 --ip 0.0.0.0 --no-browser --NotebookApp.allow_origin='*'
61+
```
62+
63+
The output from the command should contain three links to the Jupyter server.
64+
Pick any of these to open up a new Jupyter file browser tab in your preferred browser.
65+
66+
### Via an IDE
67+
68+
If using an IDE like vscode, install an available jupyter extension and open the freqtrade folder. Then open the ipynb file and run the cells as normal.
69+
70+
## Usage
71+
72+
Use the toolbar at the top of the plot to change behaviour or select/deselect data series.
73+
74+
Pan x only, pan x and y, or drag zoom to move around. The plot will automatically readjust to fit the candles in the current view.
75+
76+
Clicking Reset will zoom back out to the whole configured `plot_tr` timerange.
77+
78+
Click on a data point to view the indicator values in the main plot for that x index. When selected a dashed line will appear through all subplots making it easier to keep track of the selected date index across large numbers of subplots. Double clicking anywhere in the plot removes the highlight.
79+
80+
Mouseover main plot and subplot data series to see individual values.
81+
82+
## Known Issues
83+
84+
### bokeh
85+
86+
- If you scroll wheel in or out too fast it breaks the plot and you have to regenerate it by re-running the cell.
87+
- Click selection requires clicking on a data point and not anywhere on the plot.
88+
- Clicking a data series in the legend will only hide the line plot for that series and not the scatter (which is used for click selection).
89+
- Hover tooltips for the main plot are very difficult to get working and maintain readability, hence the summary table on the right.
90+
- The summary table on the right cannot be auto-sorted, so to get the indicator list for a click selection point, click the value column twice to sort descending. (After you've done this once however, the table maintains that sort order when selecting other data points).
91+
- The signal tooltips appear overlaid on the candle tolltips, making the candle data hard to read.
92+
- No OHLCV data in the summary table.
93+
94+
### plotly
2495

25-
If using an IDE like vscode, install the jupyter extension and open the freqtrade folder. Then open the ipynb file and run the cells as normal.
96+
- works but slow
97+
- not as fancy

0 commit comments

Comments
 (0)