Skip to content

Commit

Permalink
test: playground updates
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-abuke committed Jun 26, 2024
1 parent 2d6cdb0 commit f3505ee
Showing 1 changed file with 119 additions and 10 deletions.
129 changes: 119 additions & 10 deletions notebooks/backtesting.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -353,7 +353,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -363,9 +363,17 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 3,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"(36, 15, datetime.date(2023, 9, 1), datetime.date(2024, 4, 1), 13, 3)\n"
]
}
],
"source": [
"# Reflect the 'scenes' table\n",
"scenes = Table('scenes', metadata, autoload_with=engine)\n",
Expand All @@ -381,23 +389,50 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"from sqlalchemy import create_engine, text, inspect\n",
"from sqlalchemy.orm import sessionmaker\n",
"\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"# Create an engine and connect to the database\n",
"Session = sessionmaker(bind=engine)\n",
"session = Session()\n",
"# Close the session\n",
"session = Session()"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"ename": "NameError",
"evalue": "name 'session' is not defined",
"output_type": "error",
"traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[1;32mIn[1], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[43msession\u001b[49m\u001b[38;5;241m.\u001b[39mclose()\n",
"\u001b[1;31mNameError\u001b[0m: name 'session' is not defined"
]
}
],
"source": [
"session.close()"
]
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 16,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -417,7 +452,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 17,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -826,6 +861,80 @@
"}\n",
"run_backtest(config)"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"[*********************100%%**********************] 1 of 1 completed\n",
"\n",
"1 Failed download:\n",
"['FB']: YFTzMissingError('$%ticker%: possibly delisted; No timezone found')\n"
]
},
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Open</th>\n",
" <th>High</th>\n",
" <th>Low</th>\n",
" <th>Close</th>\n",
" <th>Adj Close</th>\n",
" <th>Volume</th>\n",
" </tr>\n",
" <tr>\n",
" <th>Date</th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
"Empty DataFrame\n",
"Columns: [Open, High, Low, Close, Adj Close, Volume]\n",
"Index: []"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import yfinance as yf\n",
"yf.download(\"FB\", start=\"2023-01-01\", end=\"2024-01-01\")"
]
}
],
"metadata": {
Expand Down

0 comments on commit f3505ee

Please sign in to comment.