Update trade upsert example to strip seconds, microseconds, and timezone information from the trade entry time
This commit is contained in:
parent
e02b2e59e1
commit
75a5682e46
@ -1,4 +1,5 @@
|
||||
pandas
|
||||
psycopg2
|
||||
python-dotenv
|
||||
pytz
|
||||
sqlalchemy
|
@ -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': [
|
||||
[
|
||||
|
Loading…
Reference in New Issue
Block a user