Adding mplfinance and a chart to the template

This commit is contained in:
Artem Veremey
2021-03-02 19:22:17 -08:00
parent 52e812eb35
commit 4e60633abb
2 changed files with 27 additions and 2 deletions

28
notebooks/templates/due_diligence.ipynb Normal file → Executable file
View File

@@ -36,7 +36,32 @@
},
"outputs": [],
"source": [
"ticker=\"PLTR\""
"ticker=\"GME\""
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "jewish-birthday",
"metadata": {},
"outputs": [],
"source": [
"import mplfinance as mpf\n",
"from alpha_vantage.timeseries import TimeSeries\n",
"ts = TimeSeries(key=\"REPLACE_ME\", output_format=\"pandas\")\n",
"df_stock, _ = ts.get_daily_adjusted(symbol=ticker, outputsize=\"compact\")\n",
"df_stock.rename(columns = {'1. open':'Open', '2. high': 'High', '3. low':'Low', '4. close':'Close',\n",
" '5. adjusted close':'Adjusted Close','6. volume':'Volume'}, inplace = True)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "separated-oasis",
"metadata": {},
"outputs": [],
"source": [
"mpf.plot(df_stock.iloc[::-1],type='candle',mav=(10,20,50),volume=True, style='yahoo', figratio=(10,5), figscale=1.25)"
]
},
{
@@ -62,7 +87,6 @@
}
],
"metadata": {
"celltoolbar": "Tags",
"kernelspec": {
"display_name": "Python 3",
"language": "python",

View File

@@ -59,6 +59,7 @@ Markdown==3.3.4
matplotlib==3.3.2
more-itertools==8.7.0
mpld3==0.3
mplfinance==0.12.7a7
multidict==5.1.0
multitasking==0.0.9
networkx==2.5