Add entry slippage to call and put spread details before insertion into the trades table

This commit is contained in:
moshferatu 2024-02-20 14:33:31 -08:00
parent df932568b4
commit 0f12e6932c

View File

@ -162,7 +162,8 @@ def _enter_iron_condor(entry_time: datetime):
{'Action': 'SELL', 'Strike': short_call_strike, 'Type': 'CALL'}, {'Action': 'SELL', 'Strike': short_call_strike, 'Type': 'CALL'},
{'Action': 'BUY', 'Strike': long_call_strike, 'Type': 'CALL'} {'Action': 'BUY', 'Strike': long_call_strike, 'Type': 'CALL'}
], ],
'Open': call_spread_fill 'Open': call_spread_fill,
'Entry Slippage': (call_spread_fill - call_spread_mid)
} }
put_spread_details = { put_spread_details = {
@ -170,7 +171,8 @@ def _enter_iron_condor(entry_time: datetime):
{'Action': 'SELL', 'Strike': short_put_strike, 'Type': 'PUT'}, {'Action': 'SELL', 'Strike': short_put_strike, 'Type': 'PUT'},
{'Action': 'BUY', 'Strike': long_put_strike, 'Type': 'PUT'} {'Action': 'BUY', 'Strike': long_put_strike, 'Type': 'PUT'}
], ],
'Open': put_spread_fill 'Open': put_spread_fill,
'Entry Slippage': (put_spread_fill - put_spread_mid)
} }
upsert(pd.DataFrame([{ upsert(pd.DataFrame([{