diff --git a/backtest_scheduler.py b/backtest_scheduler.py index 06d5626..4f8a99c 100644 --- a/backtest_scheduler.py +++ b/backtest_scheduler.py @@ -3,10 +3,15 @@ import time import traceback from datetime import datetime, timedelta +from discord_messaging import send_message +from dotenv import load_dotenv +from os import getenv from download_spx_quotes import download_quotes from run_backtest import run_backtest +load_dotenv() + def backtest_automation(): try: download_quotes() @@ -16,8 +21,7 @@ def backtest_automation(): start_date = end_date - timedelta(days = 1) run_backtest(start_date, end_date) except: - # TODO: Send Discord notification. - print('Error occurred during backtest automation.') + send_message('Backtest automation failed!', getenv('USER_ID')) traceback.print_exc() if __name__ == '__main__':