Modified:
/trunk/demo/example_opt
/trunk/ib/ext/ContractDetails.py
/trunk/ib/ext/EClientSocket.py
/trunk/ib/ext/EReader.py
/trunk/ib/ext/EWrapper.py
/trunk/ib/ext/EWrapperMsgGenerator.py
/trunk/ib/ext/Order.py
/trunk/ib/ext/TickType.py
/trunk/ib/lib/__init__.py
/trunk/ib/opt/sender.py
=======================================
--- /trunk/demo/example_opt Mon Dec 10 13:14:25 2007
+++ /trunk/demo/example_opt Sun Aug 2 03:17:47 2009
@@ -24,12 +24,22 @@
con.register(my_account_handler, 'UpdateAccountValue')
con.register(my_tick_handler, message.TickSize, message.TickPrice)
con.connect()
- con.reqAccountUpdates(1, '')
-
- qqqq = Contract()
- qqqq.m_symbol = 'QQQQ'
- qqqq.m_secType = 'STK'
- qqqq.m_exchange = 'SMART'
- con.reqMktData(1, qqqq, '', False)
-
- sleep(10)
+
+ def inner():
+
+ con.reqAccountUpdates(1, '')
+ qqqq = Contract()
+ qqqq.m_symbol = 'QQQQ'
+ qqqq.m_secType = 'STK'
+ qqqq.m_exchange = 'SMART'
+ con.reqMktData(1, qqqq, '', False)
+
+ inner()
+ sleep(5)
+ print 'disconnected', con.disconnect()
+ sleep(3)
+ print 'reconnected', con.reconnect()
+ inner()
+ sleep(3)
+
+ print 'again disconnected', con.disconnect()
=======================================
--- /trunk/ib/ext/ContractDetails.py Mon Jan 26 11:44:03 2009
+++ /trunk/ib/ext/ContractDetails.py Sun Aug 2 03:17:47 2009
@@ -28,6 +28,7 @@
m_orderTypes = ""
m_validExchanges = ""
m_underConId = 0
+ m_longName = ""
m_cusip = ""
m_ratings = ""
m_descAppend = ""
@@ -50,14 +51,15 @@
self.m_minTick = 0
self.m_underConId = 0
- @__init__.register(object, Contract, str, str, float, str, str, int)
+ @__init__.register(object, Contract, str, str, float, str, str, int,
str)
def __init___0(self, p_summary,
p_marketName,
p_tradingClass,
p_minTick,
p_orderTypes,
p_validExchanges,
- p_underConId):
+ p_underConId,
+ p_longName):
self.m_summary = p_summary
self.m_marketName = p_marketName
self.m_tradingClass = p_tradingClass
@@ -65,5 +67,6 @@
self.m_orderTypes = p_orderTypes
self.m_validExchanges = p_validExchanges
self.m_underConId = p_underConId
+ self.m_longName = p_longName
=======================================
--- /trunk/ib/ext/EClientSocket.py Mon Jan 26 16:00:45 2009
+++ /trunk/ib/ext/EClientSocket.py Sun Aug 2 03:17:47 2009
@@ -33,7 +33,7 @@
""" generated source for EClientSocket
"""
- CLIENT_VERSION = 42
+ CLIENT_VERSION = 45
SERVER_VERSION = 38
EOL = 0
BAG_SEC_TYPE = "BAG"
@@ -94,6 +94,7 @@
MIN_SERVER_VER_SCALE_ORDERS2 = 40
MIN_SERVER_VER_ALGO_ORDERS = 41
MIN_SERVER_VER_EXECUTION_DATA_CHAIN = 42
+ MIN_SERVER_VER_NOT_HELD = 44
m_anyWrapper = None
m_dos = None
m_connected = bool()
@@ -613,7 +614,11 @@
if not self.IsEmpty(order.m_algoStrategy):
self.error(id, EClientErrors.UPDATE_TWS, " It does not
support algo orders.")
return
- VERSION = 27
+ if self.m_serverVersion < self.MIN_SERVER_VER_NOT_HELD:
+ if order.m_notHeld:
+ self.error(id, EClientErrors.UPDATE_TWS, " It does not
support notHeld parameter.")
+ return
+ VERSION = 27 if self.m_serverVersion <
self.MIN_SERVER_VER_NOT_HELD else 28
try:
self.send(self.PLACE_ORDER)
self.send(VERSION)
@@ -741,6 +746,8 @@
if self.m_serverVersion >= self.MIN_SERVER_VER_PTA_ORDERS:
self.send(order.m_clearingAccount)
self.send(order.m_clearingIntent)
+ if self.m_serverVersion >= self.MIN_SERVER_VER_NOT_HELD:
+ self.send(order.m_notHeld)
if self.m_serverVersion >= self.MIN_SERVER_VER_UNDER_COMP:
if contract.m_underComp is not None:
underComp = contract.m_underComp
=======================================
--- /trunk/ib/ext/EReader.py Mon Jan 26 16:00:45 2009
+++ /trunk/ib/ext/EReader.py Sun Aug 2 03:17:47 2009
@@ -66,6 +66,7 @@
ACCT_DOWNLOAD_END = 54
EXECUTION_DATA_END = 55
DELTA_NEUTRAL_VALIDATION = 56
+ TICK_SNAPSHOT_END = 57
m_parent = None
m_dis = None
@@ -354,6 +355,8 @@
if version >= 19:
order.m_clearingAccount = self.readStr()
order.m_clearingIntent = self.readStr()
+ if version >= 22:
+ order.m_notHeld = self.readBoolFromInt()
if version >= 20:
if self.readBoolFromInt():
underComp = UnderComp()
@@ -447,6 +450,9 @@
contract.m_priceMagnifier = self.readInt()
if version >= 4:
contract.m_underConId = self.readInt()
+ if version >= 5:
+ contract.m_longName = self.readStr()
+ contract.m_summary.m_primaryExch = self.readStr()
self.eWrapper().contractDetails(reqId, contract)
elif msgId == self.BOND_CONTRACT_DATA:
version = self.readInt()
@@ -480,6 +486,8 @@
contract.m_nextOptionType = self.readStr()
contract.m_nextOptionPartial = self.readBoolFromInt()
contract.m_notes = self.readStr()
+ if version >= 4:
+ contract.m_longName = self.readStr()
self.eWrapper().bondContractDetails(reqId, contract)
elif msgId == self.EXECUTION_DATA:
version = self.readInt()
@@ -628,6 +636,10 @@
underComp.m_delta = self.readDouble()
underComp.m_price = self.readDouble()
self.eWrapper().deltaNeutralValidation(reqId, underComp)
+ elif msgId == self.TICK_SNAPSHOT_END:
+ self.readInt()
+ reqId = self.readInt()
+ self.eWrapper().tickSnapshotEnd(reqId)
else:
self.m_parent.error(EClientErrors.NO_VALID_ID,
EClientErrors.UNKNOWN_ID.code(), EClientErrors.UNKNOWN_ID.msg())
return False
=======================================
--- /trunk/ib/ext/EWrapper.py Mon Jan 26 11:44:03 2009
+++ /trunk/ib/ext/EWrapper.py Sun Aug 2 03:17:47 2009
@@ -179,4 +179,7 @@
def deltaNeutralValidation(self, reqId, underComp):
raise NotImplementedError()
-
+ def tickSnapshotEnd(self, reqId):
+ raise NotImplementedError()
+
+
=======================================
--- /trunk/ib/ext/EWrapperMsgGenerator.py Mon Jan 26 16:00:45 2009
+++ /trunk/ib/ext/EWrapperMsgGenerator.py Sun Aug 2 03:17:47 2009
@@ -79,7 +79,7 @@
@classmethod
def openOrder(cls, orderId, contract, order, orderState):
- msg = "open order: orderId=" + orderId + " action=" +
order.m_action + " quantity=" + order.m_totalQuantity + " symbol=" +
contract.m_symbol + " exchange=" + contract.m_exchange + " secType=" +
contract.m_secType + " type=" + order.m_orderType + " lmtPrice=" +
order.m_lmtPrice + " auxPrice=" + order.m_auxPrice + " TIF=" + order.m_tif
+ " localSymbol=" + contract.m_localSymbol + " client Id=" +
order.m_clientId + " parent Id=" + order.m_parentId + " permId=" +
order.m_permId + " outsideRth=" + order.m_outsideRth + " hidden=" +
order.m_hidden + " discretionaryAmt=" + order.m_discretionaryAmt + "
triggerMethod=" + order.m_triggerMethod + " goodAfterTime=" +
order.m_goodAfterTime + " goodTillDate=" + order.m_goodTillDate + "
faGroup=" + order.m_faGroup + " faMethod=" + order.m_faMethod + "
faPercentage=" + order.m_faPercentage + " faProfile=" + order.m_faProfile
+ " shortSaleSlot=" + order.m_shortSaleSlot + " designatedLocation=" +
order.m_designatedLocation + " ocaGroup=" + order.m_ocaGroup + " ocaType="
+ order.m_ocaType + " rule80A=" + order.m_rule80A + " allOrNone=" +
order.m_allOrNone + " minQty=" + order.m_minQty + " percentOffset=" +
order.m_percentOffset + " eTradeOnly=" + order.m_eTradeOnly + "
firmQuoteOnly=" + order.m_firmQuoteOnly + " nbboPriceCap=" +
order.m_nbboPriceCap + " auctionStrategy=" + order.m_auctionStrategy + "
startingPrice=" + order.m_startingPrice + " stockRefPrice=" +
order.m_stockRefPrice + " delta=" + order.m_delta + " stockRangeLower=" +
order.m_stockRangeLower + " stockRangeUpper=" + order.m_stockRangeUpper + "
volatility=" + order.m_volatility + " volatilityType=" +
order.m_volatilityType + " deltaNeutralOrderType=" +
order.m_deltaNeutralOrderType + " deltaNeutralAuxPrice=" +
order.m_deltaNeutralAuxPrice + " continuousUpdate=" +
order.m_continuousUpdate + " referencePriceType=" +
order.m_referencePriceType + " trailStopPrice=" + order.m_trailStopPrice
+ " scaleInitLevelSize=" + Util.IntMaxString(order.m_scaleInitLevelSize)
+ " scaleSubsLevelSize=" + Util.IntMaxString(order.m_scaleSubsLevelSize)
+ " scalePriceIncrement=" +
Util.DoubleMaxString(order.m_scalePriceIncrement) + " account=" +
order.m_account + " settlingFirm=" + order.m_settlingFirm + "
clearingAccount=" + order.m_clearingAccount + " clearingIntent=" +
order.m_clearingIntent + " whatIf=" + order.m_whatIf
+ msg = "open order: orderId=" + orderId + " action=" +
order.m_action + " quantity=" + order.m_totalQuantity + " symbol=" +
contract.m_symbol + " exchange=" + contract.m_exchange + " secType=" +
contract.m_secType + " type=" + order.m_orderType + " lmtPrice=" +
order.m_lmtPrice + " auxPrice=" + order.m_auxPrice + " TIF=" + order.m_tif
+ " localSymbol=" + contract.m_localSymbol + " client Id=" +
order.m_clientId + " parent Id=" + order.m_parentId + " permId=" +
order.m_permId + " outsideRth=" + order.m_outsideRth + " hidden=" +
order.m_hidden + " discretionaryAmt=" + order.m_discretionaryAmt + "
triggerMethod=" + order.m_triggerMethod + " goodAfterTime=" +
order.m_goodAfterTime + " goodTillDate=" + order.m_goodTillDate + "
faGroup=" + order.m_faGroup + " faMethod=" + order.m_faMethod + "
faPercentage=" + order.m_faPercentage + " faProfile=" + order.m_faProfile
+ " shortSaleSlot=" + order.m_shortSaleSlot + " designatedLocation=" +
order.m_designatedLocation + " ocaGroup=" + order.m_ocaGroup + " ocaType="
+ order.m_ocaType + " rule80A=" + order.m_rule80A + " allOrNone=" +
order.m_allOrNone + " minQty=" + order.m_minQty + " percentOffset=" +
order.m_percentOffset + " eTradeOnly=" + order.m_eTradeOnly + "
firmQuoteOnly=" + order.m_firmQuoteOnly + " nbboPriceCap=" +
order.m_nbboPriceCap + " auctionStrategy=" + order.m_auctionStrategy + "
startingPrice=" + order.m_startingPrice + " stockRefPrice=" +
order.m_stockRefPrice + " delta=" + order.m_delta + " stockRangeLower=" +
order.m_stockRangeLower + " stockRangeUpper=" + order.m_stockRangeUpper + "
volatility=" + order.m_volatility + " volatilityType=" +
order.m_volatilityType + " deltaNeutralOrderType=" +
order.m_deltaNeutralOrderType + " deltaNeutralAuxPrice=" +
order.m_deltaNeutralAuxPrice + " continuousUpdate=" +
order.m_continuousUpdate + " referencePriceType=" +
order.m_referencePriceType + " trailStopPrice=" + order.m_trailStopPrice
+ " scaleInitLevelSize=" + Util.IntMaxString(order.m_scaleInitLevelSize)
+ " scaleSubsLevelSize=" + Util.IntMaxString(order.m_scaleSubsLevelSize)
+ " scalePriceIncrement=" +
Util.DoubleMaxString(order.m_scalePriceIncrement) + " account=" +
order.m_account + " settlingFirm=" + order.m_settlingFirm + "
clearingAccount=" + order.m_clearingAccount + " clearingIntent=" +
order.m_clearingIntent + " notHeld=" + order.m_notHeld + " whatIf=" +
order.m_whatIf
if "BAG" == contract.m_secType:
if contract.m_comboLegsDescrip is not None:
msg += " comboLegsDescrip=" + contract.m_comboLegsDescrip
@@ -146,7 +146,7 @@
@classmethod
def contractDetailsMsg(cls, contractDetails):
- msg = "marketName = " + cls.contractDetails.m_marketName + "\n"
+ "tradingClass = " + cls.contractDetails.m_tradingClass + "\n" + "minTick
= " + cls.contractDetails.m_minTick + "\n" + "price magnifier = " +
cls.contractDetails.m_priceMagnifier + "\n" + "orderTypes = " +
cls.contractDetails.m_orderTypes + "\n" + "validExchanges = " +
cls.contractDetails.m_validExchanges + "\n" + "underConId = " +
cls.contractDetails.m_underConId + "\n"
+ msg = "marketName = " + cls.contractDetails.m_marketName + "\n"
+ "tradingClass = " + cls.contractDetails.m_tradingClass + "\n" + "minTick
= " + cls.contractDetails.m_minTick + "\n" + "price magnifier = " +
cls.contractDetails.m_priceMagnifier + "\n" + "orderTypes = " +
cls.contractDetails.m_orderTypes + "\n" + "validExchanges = " +
cls.contractDetails.m_validExchanges + "\n" + "underConId = " +
cls.contractDetails.m_underConId + "\n" + "longName = " +
cls.contractDetails.m_longName + "\n"
return msg
@classmethod
@@ -157,7 +157,7 @@
@classmethod
def bondContractDetails(cls, reqId, contractDetails):
contract = cls.contractDetails.m_summary
- msg = "reqId = " + reqId + "
===================================\n" + " ---- Bond Contract Details begin
----\n" + "symbol = " + contract.m_symbol + "\n" + "secType = " +
contract.m_secType + "\n" + "cusip = " + cls.contractDetails.m_cusip + "\n"
+ "coupon = " + cls.contractDetails.m_coupon + "\n" + "maturity = " +
cls.contractDetails.m_maturity + "\n" + "issueDate = " +
cls.contractDetails.m_issueDate + "\n" + "ratings = " +
cls.contractDetails.m_ratings + "\n" + "bondType = " +
cls.contractDetails.m_bondType + "\n" + "couponType = " +
cls.contractDetails.m_couponType + "\n" + "convertible = " +
cls.contractDetails.m_convertible + "\n" + "callable = " +
cls.contractDetails.m_callable + "\n" + "putable = " +
cls.contractDetails.m_putable + "\n" + "descAppend = " +
cls.contractDetails.m_descAppend + "\n" + "exchange = " +
contract.m_exchange + "\n" + "currency = " + contract.m_currency + "\n"
+ "marketName = " + cls.contractDetails.m_marketName + "\n" + "tradingClass
= " + cls.contractDetails.m_tradingClass + "\n" + "conid = " +
contract.m_conId + "\n" + "minTick = " + cls.contractDetails.m_minTick
+ "\n" + "orderTypes = " + cls.contractDetails.m_orderTypes + "\n"
+ "validExchanges = " + cls.contractDetails.m_validExchanges + "\n"
+ "nextOptionDate = " + cls.contractDetails.m_nextOptionDate + "\n"
+ "nextOptionType = " + cls.contractDetails.m_nextOptionType + "\n"
+ "nextOptionPartial = " + cls.contractDetails.m_nextOptionPartial + "\n"
+ "notes = " + cls.contractDetails.m_notes + "\n" + " ---- Bond Contract
Details End ----\n"
+ msg = "reqId = " + reqId + "
===================================\n" + " ---- Bond Contract Details begin
----\n" + "symbol = " + contract.m_symbol + "\n" + "secType = " +
contract.m_secType + "\n" + "cusip = " + cls.contractDetails.m_cusip + "\n"
+ "coupon = " + cls.contractDetails.m_coupon + "\n" + "maturity = " +
cls.contractDetails.m_maturity + "\n" + "issueDate = " +
cls.contractDetails.m_issueDate + "\n" + "ratings = " +
cls.contractDetails.m_ratings + "\n" + "bondType = " +
cls.contractDetails.m_bondType + "\n" + "couponType = " +
cls.contractDetails.m_couponType + "\n" + "convertible = " +
cls.contractDetails.m_convertible + "\n" + "callable = " +
cls.contractDetails.m_callable + "\n" + "putable = " +
cls.contractDetails.m_putable + "\n" + "descAppend = " +
cls.contractDetails.m_descAppend + "\n" + "exchange = " +
contract.m_exchange + "\n" + "currency = " + contract.m_currency + "\n"
+ "marketName = " + cls.contractDetails.m_marketName + "\n" + "tradingClass
= " + cls.contractDetails.m_tradingClass + "\n" + "conid = " +
contract.m_conId + "\n" + "minTick = " + cls.contractDetails.m_minTick
+ "\n" + "orderTypes = " + cls.contractDetails.m_orderTypes + "\n"
+ "validExchanges = " + cls.contractDetails.m_validExchanges + "\n"
+ "nextOptionDate = " + cls.contractDetails.m_nextOptionDate + "\n"
+ "nextOptionType = " + cls.contractDetails.m_nextOptionType + "\n"
+ "nextOptionPartial = " + cls.contractDetails.m_nextOptionPartial + "\n"
+ "notes = " + cls.contractDetails.m_notes + "\n" + "longName = " +
cls.contractDetails.m_longName + "\n" + " ---- Bond Contract Details End
----\n"
return msg
@classmethod
@@ -260,4 +260,8 @@
def deltaNeutralValidation(cls, reqId, underComp):
return "id = " + reqId + " underComp.conId =" + underComp.m_conId
+ " underComp.delta =" + underComp.m_delta + " underComp.price =" +
underComp.m_price
-
+ @classmethod
+ def tickSnapshotEnd(cls, tickerId):
+ return "id=" + tickerId + " =============== end ==============="
+
+
=======================================
--- /trunk/ib/ext/Order.py Mon Jan 26 11:44:03 2009
+++ /trunk/ib/ext/Order.py Sun Aug 2 03:17:47 2009
@@ -97,6 +97,7 @@
m_algoStrategy = ""
m_algoParams = list()
m_whatIf = bool()
+ m_notHeld = bool()
def __init__(self):
self.m_outsideRth = False
@@ -124,6 +125,7 @@
self.m_scaleSubsLevelSize = Integer.MAX_VALUE
self.m_scalePriceIncrement = Double.MAX_VALUE
self.m_whatIf = False
+ self.m_notHeld = False
def __eq__(self, p_other):
if self is p_other:
@@ -133,7 +135,7 @@
l_theOther = p_other
if (self.m_permId == l_theOther.m_permId):
return True
- if (self.m_orderId != l_theOther.m_orderId) or (self.m_clientId !=
l_theOther.m_clientId) or (self.m_totalQuantity !=
l_theOther.m_totalQuantity) or (self.m_lmtPrice != l_theOther.m_lmtPrice)
or (self.m_auxPrice != l_theOther.m_auxPrice) or (self.m_ocaType !=
l_theOther.m_ocaType) or (self.m_transmit != l_theOther.m_transmit) or
(self.m_parentId != l_theOther.m_parentId) or (self.m_blockOrder !=
l_theOther.m_blockOrder) or (self.m_sweepToFill !=
l_theOther.m_sweepToFill) or (self.m_displaySize !=
l_theOther.m_displaySize) or (self.m_triggerMethod !=
l_theOther.m_triggerMethod) or (self.m_outsideRth !=
l_theOther.m_outsideRth) or (self.m_hidden != l_theOther.m_hidden) or
(self.m_overridePercentageConstraints !=
l_theOther.m_overridePercentageConstraints) or (self.m_allOrNone !=
l_theOther.m_allOrNone) or (self.m_minQty != l_theOther.m_minQty) or
(self.m_percentOffset != l_theOther.m_percentOffset) or
(self.m_trailStopPrice != l_theOther.m_trailStopPrice) or (self.m_origin !=
l_theOther.m_origin) or (self.m_shortSaleSlot !=
l_theOther.m_shortSaleSlot) or (self.m_discretionaryAmt !=
l_theOther.m_discretionaryAmt) or (self.m_eTradeOnly !=
l_theOther.m_eTradeOnly) or (self.m_firmQuoteOnly !=
l_theOther.m_firmQuoteOnly) or (self.m_nbboPriceCap !=
l_theOther.m_nbboPriceCap) or (self.m_auctionStrategy !=
l_theOther.m_auctionStrategy) or (self.m_startingPrice !=
l_theOther.m_startingPrice) or (self.m_stockRefPrice !=
l_theOther.m_stockRefPrice) or (self.m_delta != l_theOther.m_delta) or
(self.m_stockRangeLower != l_theOther.m_stockRangeLower) or
(self.m_stockRangeUpper != l_theOther.m_stockRangeUpper) or
(self.m_volatility != l_theOther.m_volatility) or (self.m_volatilityType !=
l_theOther.m_volatilityType) or (self.m_continuousUpdate !=
l_theOther.m_continuousUpdate) or (self.m_referencePriceType !=
l_theOther.m_referencePriceType) or (self.m_deltaNeutralAuxPrice !=
l_theOther.m_deltaNeutralAuxPrice) or (self.m_basisPoints !=
l_theOther.m_basisPoints) or (self.m_basisPointsType !=
l_theOther.m_basisPointsType) or (self.m_scaleInitLevelSize !=
l_theOther.m_scaleInitLevelSize) or (self.m_scaleSubsLevelSize !=
l_theOther.m_scaleSubsLevelSize) or (self.m_scalePriceIncrement !=
l_theOther.m_scalePriceIncrement) or (self.m_whatIf != l_theOther.m_whatIf):
+ if (self.m_orderId != l_theOther.m_orderId) or (self.m_clientId !=
l_theOther.m_clientId) or (self.m_totalQuantity !=
l_theOther.m_totalQuantity) or (self.m_lmtPrice != l_theOther.m_lmtPrice)
or (self.m_auxPrice != l_theOther.m_auxPrice) or (self.m_ocaType !=
l_theOther.m_ocaType) or (self.m_transmit != l_theOther.m_transmit) or
(self.m_parentId != l_theOther.m_parentId) or (self.m_blockOrder !=
l_theOther.m_blockOrder) or (self.m_sweepToFill !=
l_theOther.m_sweepToFill) or (self.m_displaySize !=
l_theOther.m_displaySize) or (self.m_triggerMethod !=
l_theOther.m_triggerMethod) or (self.m_outsideRth !=
l_theOther.m_outsideRth) or (self.m_hidden != l_theOther.m_hidden) or
(self.m_overridePercentageConstraints !=
l_theOther.m_overridePercentageConstraints) or (self.m_allOrNone !=
l_theOther.m_allOrNone) or (self.m_minQty != l_theOther.m_minQty) or
(self.m_percentOffset != l_theOther.m_percentOffset) or
(self.m_trailStopPrice != l_theOther.m_trailStopPrice) or (self.m_origin !=
l_theOther.m_origin) or (self.m_shortSaleSlot !=
l_theOther.m_shortSaleSlot) or (self.m_discretionaryAmt !=
l_theOther.m_discretionaryAmt) or (self.m_eTradeOnly !=
l_theOther.m_eTradeOnly) or (self.m_firmQuoteOnly !=
l_theOther.m_firmQuoteOnly) or (self.m_nbboPriceCap !=
l_theOther.m_nbboPriceCap) or (self.m_auctionStrategy !=
l_theOther.m_auctionStrategy) or (self.m_startingPrice !=
l_theOther.m_startingPrice) or (self.m_stockRefPrice !=
l_theOther.m_stockRefPrice) or (self.m_delta != l_theOther.m_delta) or
(self.m_stockRangeLower != l_theOther.m_stockRangeLower) or
(self.m_stockRangeUpper != l_theOther.m_stockRangeUpper) or
(self.m_volatility != l_theOther.m_volatility) or (self.m_volatilityType !=
l_theOther.m_volatilityType) or (self.m_continuousUpdate !=
l_theOther.m_continuousUpdate) or (self.m_referencePriceType !=
l_theOther.m_referencePriceType) or (self.m_deltaNeutralAuxPrice !=
l_theOther.m_deltaNeutralAuxPrice) or (self.m_basisPoints !=
l_theOther.m_basisPoints) or (self.m_basisPointsType !=
l_theOther.m_basisPointsType) or (self.m_scaleInitLevelSize !=
l_theOther.m_scaleInitLevelSize) or (self.m_scaleSubsLevelSize !=
l_theOther.m_scaleSubsLevelSize) or (self.m_scalePriceIncrement !=
l_theOther.m_scalePriceIncrement) or (self.m_whatIf != l_theOther.m_whatIf)
or (self.m_notHeld != l_theOther.m_notHeld):
return False
if (Util.StringCompare(self.m_action, l_theOther.m_action) != 0)
or (Util.StringCompare(self.m_orderType, l_theOther.m_orderType) != 0) or
(Util.StringCompare(self.m_tif, l_theOther.m_tif) != 0) or
(Util.StringCompare(self.m_ocaGroup, l_theOther.m_ocaGroup) != 0) or
(Util.StringCompare(self.m_orderRef, l_theOther.m_orderRef) != 0) or
(Util.StringCompare(self.m_goodAfterTime, l_theOther.m_goodAfterTime) != 0)
or (Util.StringCompare(self.m_goodTillDate, l_theOther.m_goodTillDate) !=
0) or (Util.StringCompare(self.m_rule80A, l_theOther.m_rule80A) != 0) or
(Util.StringCompare(self.m_faGroup, l_theOther.m_faGroup) != 0) or
(Util.StringCompare(self.m_faProfile, l_theOther.m_faProfile) != 0) or
(Util.StringCompare(self.m_faMethod, l_theOther.m_faMethod) != 0) or
(Util.StringCompare(self.m_faPercentage, l_theOther.m_faPercentage) != 0)
or (Util.StringCompare(self.m_openClose, l_theOther.m_openClose) != 0) or
(Util.StringCompare(self.m_designatedLocation,
l_theOther.m_designatedLocation) != 0) or
(Util.StringCompare(self.m_deltaNeutralOrderType,
l_theOther.m_deltaNeutralOrderType) != 0) or
(Util.StringCompare(self.m_account, l_theOther.m_account) != 0) or
(Util.StringCompare(self.m_settlingFirm, l_theOther.m_settlingFirm) != 0)
or (Util.StringCompare(self.m_clearingAccount,
l_theOther.m_clearingAccount) != 0) or
(Util.StringCompare(self.m_clearingIntent, l_theOther.m_clearingIntent) !=
0) or (Util.StringCompare(self.m_algoStrategy,
l_theOther.m_algoStrategy) != 0):
return False
=======================================
--- /trunk/ib/ext/TickType.py Sat Aug 30 04:04:23 2008
+++ /trunk/ib/ext/TickType.py Sun Aug 2 03:17:47 2009
@@ -66,6 +66,7 @@
LAST_TIMESTAMP = 45
SHORTABLE = 46
FUNDAMENTAL_RATIOS = 47
+ RT_VOLUME = 48
@classmethod
def getField(cls, tickType):
@@ -165,6 +166,8 @@
return "shortable"
elif tickType == cls.FUNDAMENTAL_RATIOS:
return "fundamentals"
+ elif tickType == cls.RT_VOLUME:
+ return "RTVolume"
else:
return "unknown"
=======================================
--- /trunk/ib/lib/__init__.py Wed May 14 10:21:50 2008
+++ /trunk/ib/lib/__init__.py Sun Aug 2 03:17:47 2009
@@ -97,6 +97,7 @@
@param stream any object with recv method
"""
+ self.stream = stream
self.recv = stream.recv
def readByte(self, unpack=struct.unpack):
@@ -357,3 +358,12 @@
@param dis ignored
"""
ThreadType.__init__(self, name=name)
+
+
+ def term(self):
+ def isInterrupted():
+ print 'down town'
+ return True
+ self.isInterrupted = isInterrupted
+ self.m_dis.stream.shutdown(socket.SHUT_RDWR)
+ self.m_dis.stream.close()
=======================================
--- /trunk/ib/opt/sender.py Fri Dec 19 12:52:29 2008
+++ /trunk/ib/opt/sender.py Sun Aug 2 03:17:47 2009
@@ -28,9 +28,12 @@
@keyparam clientType=EClientSocket callable producing socket client
@return True if connected, False otherwise
"""
- self.client = client = clientType(handler)
- client.eConnect(host, port, clientId)
- return client.isConnected()
+ def reconnect():
+ self.client = client = clientType(handler)
+ client.eConnect(host, port, clientId)
+ return client.isConnected()
+ self.reconnect = reconnect
+ return self.reconnect()
def disconnect(self):
""" Disconnects the client.