Skip to content

Instantly share code, notes, and snippets.

@stevenbg
Last active August 24, 2017 14:29
Show Gist options
  • Select an option

  • Save stevenbg/87aeb8c0e59e58eff2fce509aff80d1b to your computer and use it in GitHub Desktop.

Select an option

Save stevenbg/87aeb8c0e59e58eff2fce509aff80d1b to your computer and use it in GitHub Desktop.
import sys
from ibapi.contract import *
from ibapi.order import Order
from ibapi import wrapper
from ibapi.client import EClient
contract = Contract()
contract.symbol = "SIE"
contract.secType = "STK"
contract.currency = "EUR"
contract.exchange = "SMART"
order = Order()
order.action = "BUY"
order.orderType = "LMT"
order.totalQuantity = 100
order.lmtPrice = 20
w = wrapper.EWrapper()
c = EClient(w)
c.connect("127.0.0.1", 7496, clientId=0)
c.placeOrder(1, contract, order)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment