File tree 1 file changed +10
-2
lines changed
nautilus_trader/adapters/bybit
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -1127,7 +1127,8 @@ def _process_execution(
1127
1127
1128
1128
if client_order_id is None :
1129
1129
self ._log .debug (
1130
- f"Cannot process order execution for { venue_order_id !r} : no `ClientOrderId` found (most likely due to being an external order)" ,
1130
+ f"Cannot process order execution for { venue_order_id !r} : "
1131
+ "no `ClientOrderId` found (most likely due to being an external order)" ,
1131
1132
)
1132
1133
return
1133
1134
@@ -1152,9 +1153,16 @@ def _process_execution(
1152
1153
strategy_id = order .strategy_id
1153
1154
order_type = order .order_type
1154
1155
1156
+ if strategy_id is None :
1157
+ raise ValueError (
1158
+ f"Cannot handle trade event: strategy ID not found for { client_order_id !r} " ,
1159
+ )
1160
+
1155
1161
instrument = self ._cache .instrument (instrument_id )
1156
1162
if instrument is None :
1157
- raise ValueError (f"Cannot handle trade event: instrument { instrument_id } not found" )
1163
+ raise ValueError (
1164
+ f"Cannot handle trade event: instrument { instrument_id } not found" ,
1165
+ )
1158
1166
1159
1167
quote_currency = instrument .quote_currency
1160
1168
is_maker = execution .isMaker
You can’t perform that action at this time.
0 commit comments