Skip to content

Commit

Permalink
Update ema.ipynb
Browse files Browse the repository at this point in the history
  • Loading branch information
antoinebou12 authored Sep 23, 2023
1 parent f3e1fd6 commit 85ca414
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions notebook/ema.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -72,19 +72,23 @@
"metadata": {},
"outputs": [],
"source": [
"username = 'Your MarketWatch Username'\n",
"password = 'Your MarketWatch Password'\n",
"game_name = 'Your Game Name'\n",
"marketwatch = MarketWatch(username, password)\n",
"today = datetime.today().weekday()\n",
"if today >= 5:\n",
" print('Today is a weekend. Skipping trading.')\n",
"else:\n",
" tech_stocks = ['AAPL', 'GOOGL', 'MSFT']\n",
" health_stocks = ['JNJ', 'MRK', 'PFE']\n",
" utility_stocks = ['NEE', 'DUK', 'D']\n",
" all_stocks = tech_stocks + health_stocks + utility_stocks\n",
" trade_multiple_stocks(all_stocks)"
"while True:\n",
" username = 'Your MarketWatch Username'\n",
" password = 'Your MarketWatch Password'\n",
" game_name = 'Your Game Name'\n",
" marketwatch = MarketWatch(username, password)\n",
" today = datetime.today().weekday()\n",
" if today >= 5:\n",
" print('Today is a weekend. Skipping trading.')\n",
" time.sleep(3600) # Skip for an hour\n",
" else:\n",
" tech_stocks = ['AAPL', 'GOOGL', 'MSFT']\n",
" health_stocks = ['JNJ', 'MRK', 'PFE']\n",
" utility_stocks = ['NEE', 'DUK', 'D']\n",
" all_stocks = tech_stocks + health_stocks + utility_stocks\n",
" trade_multiple_stocks(all_stocks)\n",
" \n",
" time.sleep(300) # Wait for 5 minutes before the next loop"
]
}
],
Expand Down

0 comments on commit 85ca414

Please sign in to comment.