Round entry slippage to 3 decimal places when inserting into the trades table

This commit is contained in:
moshferatu 2024-02-21 08:44:58 -08:00
parent 5807aa076c
commit 09ba7dfed3

View File

@ -165,7 +165,7 @@ def _enter_iron_condor(entry_time: datetime):
{'Action': 'BUY', 'Strike': long_call_strike, 'Type': 'CALL'}
],
'Open': call_spread_fill,
'Entry Slippage': (call_spread_fill - call_spread_mid)
'Entry Slippage': round(call_spread_fill - call_spread_mid, 3)
}
put_spread_details = {
@ -174,7 +174,7 @@ def _enter_iron_condor(entry_time: datetime):
{'Action': 'BUY', 'Strike': long_put_strike, 'Type': 'PUT'}
],
'Open': put_spread_fill,
'Entry Slippage': (put_spread_fill - put_spread_mid)
'Entry Slippage': round(put_spread_fill - put_spread_mid, 3)
}
upsert(pd.DataFrame([{