mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-27 12:40:35 +00:00
Adding mplfinance and a chart to the template
This commit is contained in:
28
notebooks/templates/due_diligence.ipynb
Normal file → Executable file
28
notebooks/templates/due_diligence.ipynb
Normal file → Executable 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",
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user