Pre-Borrow Shares For Shorting

View as MarkdownOpen in Claude

The TWS API supports the ability to pre-borrow shares for shorting.

  • See [here](About Pre-Borrows) for Pre-Borrow Eligibility
  • See here for pricing details

To place a Pre-Borrow order, users must:

  • Assign the contract’s exchange to “PREBORROW”
  • Assign the contract’s security type to “SBL”
  • Assign the order’s orderType to “MKT”
contract = Contract()
contract.symbol = symbol
contract.secType = "SBL"
contract.exchange = "PREBORROW"
contract.currency = "USD"
order = Order()
order.action = "BUY"
order.orderType = "MKT"
order.totalQuantity = quantity