From 31b0e3b5e8cc672c7a94a0e708b91a96e870dc9e Mon Sep 17 00:00:00 2001 From: Joe Schr Date: Sat, 24 Apr 2021 13:25:28 +0200 Subject: [PATCH 1/2] add distribution graph to example notebook --- .../templates/strategy_analysis_example.ipynb | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/freqtrade/templates/strategy_analysis_example.ipynb b/freqtrade/templates/strategy_analysis_example.ipynb index 491afbdd7..0bc593e2d 100644 --- a/freqtrade/templates/strategy_analysis_example.ipynb +++ b/freqtrade/templates/strategy_analysis_example.ipynb @@ -282,6 +282,28 @@ "graph.show(renderer=\"browser\")\n" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Plot average profit per trade as distribution graph" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.figure_factory as ff\n", + "\n", + "hist_data = [trades.profit_ratio]\n", + "group_labels = ['profit_ratio'] # name of the dataset\n", + "\n", + "fig = ff.create_distplot(hist_data, group_labels,bin_size=0.01)\n", + "fig.show()\n" + ] + }, { "cell_type": "markdown", "metadata": {}, From b223775385684c0698a143538ad8acb9086730ca Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 24 Apr 2021 15:56:53 +0200 Subject: [PATCH 2/2] Update "output" of jupyter notebook as well --- docs/strategy_analysis_example.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/strategy_analysis_example.md b/docs/strategy_analysis_example.md index 5c479aa0b..4c938500c 100644 --- a/docs/strategy_analysis_example.md +++ b/docs/strategy_analysis_example.md @@ -195,4 +195,18 @@ graph.show(renderer="browser") ``` +## Plot average profit per trade as distribution graph + + +```python +import plotly.figure_factory as ff + +hist_data = [trades.profit_ratio] +group_labels = ['profit_ratio'] # name of the dataset + +fig = ff.create_distplot(hist_data, group_labels,bin_size=0.01) +fig.show() + +``` + Feel free to submit an issue or Pull Request enhancing this document if you would like to share ideas on how to best analyze the data.