INNER CODE UNIT · Python
buy_pos
keanekwa/Optiver-Ready-Trader-Go · ASModel.py:192
buy_pos = hedged_pos_needed - self.hedge_position
order_id = next(self.order_ids)
self.hedge_position += buy_pos
self.send_hedge_order(order_id, Side.BID, MAX_ASK_NEAREST_TICK, buy_pos)
self.hedge_bids.add(order_id)
elif self.hedge_position > hedged_pos_needed:
# Sell more futures
sell_pos = self.hedge_position - hedged_pos_needed
order_id = next(self.order_ids)
self.hedge_position -= sell_pos
self.send_hedge_order(order_id, Side.ASK, MIN_BID_NEAREST_TICK, sell_pos)
self.hedge_asks.add(order_id)
def on_order_status_message(self, client_order_id: int, fill_volume: int, remaining_volume: int,
fees: int) -> None:
"""Called when the status of one of your orders changes.