Skip to content

Commit

Permalink
bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
enarjord committed Feb 9, 2022
1 parent 27b0c94 commit 5e07b46
Showing 1 changed file with 28 additions and 8 deletions.
36 changes: 28 additions & 8 deletions hand_tuner_static_grid.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,7 @@
"elapsed = time() - sts\n",
"print(f\"seconds elapsed {elapsed:.4f}\")\n",
"longs, shorts, sdf, analysis = analyze_fills(fills_long, fills_short, stats, config_to_test)\n",
"pprint.pprint(analysis)\n",
"fdf"
"pprint.pprint(analysis)"
]
},
{
Expand All @@ -218,8 +217,19 @@
"metadata": {},
"outputs": [],
"source": [
"sdf.balance.plot()\n",
"sdf.equity.plot(title=\"Balance and equity\", xlabel=\"Time\", ylabel=\"Balance\")"
"sdf.balance_long.plot()\n",
"sdf.equity_long.plot(title=\"Balance and equity long\", xlabel=\"Time\", ylabel=\"Balance\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "ab833d5b-0865-47fa-9792-264015d4e01a",
"metadata": {},
"outputs": [],
"source": [
"sdf.balance_short.plot()\n",
"sdf.equity_short.plot(title=\"Balance and equity short\", xlabel=\"Time\", ylabel=\"Balance\")"
]
},
{
Expand All @@ -229,7 +239,17 @@
"metadata": {},
"outputs": [],
"source": [
"plot_fills(df, fdf, plot_whole_df=True, title=\"Overview Fills\")"
"plot_fills(df, longs, plot_whole_df=True, title=\"Overview Fills Long\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "021dae7c-b8c1-4f0e-856e-e727957e79be",
"metadata": {},
"outputs": [],
"source": [
"plot_fills(df, shorts, plot_whole_df=True, title=\"Overview Fills Short\")"
]
},
{
Expand All @@ -239,12 +259,12 @@
"metadata": {},
"outputs": [],
"source": [
"fdf[fdf.psize > 0.0].psize.plot(\n",
"longs[longs.psize > 0.0].psize.plot(\n",
" title=\"Position size in terms of contracts\",\n",
" xlabel=\"Time\",\n",
" ylabel=\"Long Position size\",\n",
")\n",
"fdf[fdf.psize < 0.0].psize.plot(\n",
"shorts[shorts.psize < 0.0].psize.plot(\n",
" title=\"Position size in terms of contracts\",\n",
" xlabel=\"Time\",\n",
" ylabel=\"Short Position size\",\n",
Expand Down Expand Up @@ -566,7 +586,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.7"
"version": "3.9.8"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 5e07b46

Please sign in to comment.