diff --git a/requirements.txt b/requirements.txt index 5225320..0a0829d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,5 @@ pandas psycopg2 python-dotenv +pytz sqlalchemy \ No newline at end of file diff --git a/upsert_trade_example.py b/upsert_trade_example.py index bca2f9a..2202c48 100644 --- a/upsert_trade_example.py +++ b/upsert_trade_example.py @@ -1,12 +1,17 @@ import pandas as pd from database.trades import upsert +from datetime import datetime +from pytz import timezone + +now = datetime.now().astimezone(timezone('US/Eastern')) +now = now.replace(second = 0, microsecond = 0, tzinfo = None) trade_data = { - 'Date': ['2024-01-22'], + 'Date': [now.date()], 'Symbol': ['SPX'], - 'Strategy': ['Iron Condor @ Market Open'], - 'Entry Time': [pd.to_datetime('2024-01-22 09:30:00')], + 'Strategy': ['Iron Condor'], + 'Entry Time': [now], 'Exit Time': [None], 'Spreads': [ [