Skip to content

Instantly share code, notes, and snippets.

@Gwill
Forked from stevenbg/bla.py
Created August 24, 2017 14:29
Show Gist options
  • Select an option

  • Save Gwill/1c1f84341a0815afc76d64927093b0de to your computer and use it in GitHub Desktop.

Select an option

Save Gwill/1c1f84341a0815afc76d64927093b0de 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