Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Da5hes committed Sep 10, 2024
1 parent fa205e6 commit a7229c7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/deephaven_ib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1107,7 +1107,7 @@ def request_tick_data_historical(self, contract: RegisteredContract,
what_to_show = tick_type.historical_value()
requests = []

if tick_type not in [TickDataType.MIDPOINT, TickDataType.LAST, TickDataType.BID_ASK]:
if tick_type not in [TickDataType.MIDPOINT, TickDataType.LAST]:
raise Exception(f"Unsupported tick data type: {tick_type}")

for cd in contract.contract_details:
Expand Down Expand Up @@ -1156,7 +1156,12 @@ def order_place(self, contract: RegisteredContract, order: Order) -> Request:
raise Exception(
f"RegisteredContracts with multiple contract details are not supported for orders: {contract}")

req_id = self._client.next_order_id()
if order.orderId == 0 or order.orderId is None:
req_id = self._client.next_order_id()
order.orderId = req_id
else:
req_id = order.orderId

cd = contract.contract_details[0]
self._client.log_request(req_id, "PlaceOrder", cd.contract, {"order": f"Order({order})"})
self._client.placeOrder(req_id, cd.contract, order)
Expand Down

0 comments on commit a7229c7

Please sign in to comment.