INNER CODE UNIT · Python

r

keanekwa/Optiver-Ready-Trader-Go · ASModel.py:116

            r = s - (q * gamma * var * self.T)

			# Bid ask spread
            delta = (gamma * var * self.T + (2 / gamma * math.log(1 + (gamma / k))))

            # Prices to be sent in
            new_bid_price = math.ceil((r - delta / 2)) * TICK_SIZE_IN_CENTS
            new_ask_price = math.ceil((r + delta / 2)) * TICK_SIZE_IN_CENTS

            if self.bid_id != 0 and new_bid_price not in (self.bid_price, 0):
                self.send_cancel_order(self.bid_id)
                self.bid_id = 0
            if self.ask_id != 0 and new_ask_price not in (self.ask_price, 0):
                self.send_cancel_order(self.ask_id)
                self.ask_id = 0

            if self.bid_id == 0 and new_bid_price != 0 and self.position <= POSITION_LIMIT - (LOT_SIZE * len(self.bids) + LOT_SIZE):
                self.bid_id = next(self.order_ids)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…