0
I want create an order for future using ib_insync python module.

from ib_insync import *

# Connect to the IB API
ib = IB()
ib.connect('127.0.0.1', 7497, clientId=2)

# Define the contract for the E-mini S&P 500 Futures contract
contract = Future(symbol='GBL', lastTradeDateOrContractMonth='20230108', exchange='EUREX', currency='EUR')

# Create a market order to buy 1 contract
order = MarketOrder('BUY', 1)

# Place the order
trade = ib.placeOrder(contract, order)
print(trade)

I run this code and no errors. But I can't see any order in tws workstation and when I get all order through the code, order for future didn't exist.

  • Firstly I'd check your expiry date (try 20230608), see here https://pennies.interactivebrokers.com/cstools/contract_info/v3.10/index.php for contract search. – dno May 16 '23 at 16:14

0 Answers0