示例#1
0
 def __eq__(self, p_other):
     if self is p_other:
         return True
     if p_other is None or not isinstance(p_other, (Contract)):
         return False
     l_theOther = p_other
     if (self.m_conId != l_theOther.m_conId):
         return False
     if (Util.StringCompare(self.m_secType, l_theOther.m_secType) != 0):
         return False
     if (Util.StringCompare(self.m_symbol, l_theOther.m_symbol) != 0) or (Util.StringCompare(self.m_exchange, l_theOther.m_exchange) != 0) or (Util.StringCompare(self.m_primaryExch, l_theOther.m_primaryExch) != 0) or (Util.StringCompare(self.m_currency, l_theOther.m_currency) != 0):
         return False
     if not Util.NormalizeString(self.m_secType) == "BOND":
         if (self.m_strike != l_theOther.m_strike):
             return False
         if (Util.StringCompare(self.m_expiry, l_theOther.m_expiry) != 0) or (Util.StringCompare(self.m_right, l_theOther.m_right) != 0) or (Util.StringCompare(self.m_multiplier, l_theOther.m_multiplier) != 0) or (Util.StringCompare(self.m_localSymbol, l_theOther.m_localSymbol) != 0):
             return False
     if not Util.VectorEqualsUnordered(self.m_comboLegs, l_theOther.m_comboLegs):
         return False
     if (self.m_underComp != l_theOther.m_underComp):
         if self.m_underComp is None or l_theOther.m_underComp is None:
             return False
         if not self.m_underComp == l_theOther.m_underComp:
             return False
     return True
示例#2
0
 def __eq__(self, p_other):
     if self is p_other:
         return True
     if p_other is None:
         return False
     l_theOther = p_other
     if (Util.StringCompare(self.m_tag, l_theOther.m_tag) != 0)\
             or (Util.StringCompare(self.m_value, l_theOther.m_value) != 0):
         return False
     return True
示例#3
0
 def __eq__(self, p_other):
     """ generated source for method equals """
     if self is p_other:
         return True
     if p_other is None:
         return False
     l_theOther = p_other
     if Util.StringCompare(self.m_tag, l_theOther.m_tag) != 0 or Util.StringCompare(self.m_value, l_theOther.m_value) != 0:
         return False
     return True
示例#4
0
 def __eq__(self, p_other):
     if self is p_other:
         return True
     if p_other is None:
         return False
     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) 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
     if not Util.VectorEqualsUnordered(self.m_algoParams, l_theOther.m_algoParams):
         return False
     return True
示例#5
0
 def __eq__(self, p_other):
     """ generated source for method equals """
     if self is p_other:
         return True
     if p_other is None or not (isinstance(p_other, (Contract, ))):
         return False
     l_theOther = p_other
     if self.m_conId != l_theOther.m_conId:
         return False
     if Util.StringCompare(self.m_secType, l_theOther.m_secType) != 0:
         return False
     if (Util.StringCompare(self.m_symbol, l_theOther.m_symbol) != 0) or (Util.StringCompare(self.m_exchange, l_theOther.m_exchange) != 0) or (Util.StringCompare(self.m_primaryExch, l_theOther.m_primaryExch) != 0) or (Util.StringCompare(self.m_currency, l_theOther.m_currency) != 0):
         return False
     if not Util.NormalizeString(self.m_secType) == "BOND":
         if self.m_strike != l_theOther.m_strike:
             return False
         if (Util.StringCompare(self.m_expiry, l_theOther.m_expiry) != 0) or (Util.StringCompare(self.m_right, l_theOther.m_right) != 0) or (Util.StringCompare(self.m_multiplier, l_theOther.m_multiplier) != 0) or (Util.StringCompare(self.m_localSymbol, l_theOther.m_localSymbol) != 0) or (Util.StringCompare(self.m_tradingClass, l_theOther.m_tradingClass) != 0):
             return False
     if Util.StringCompare(self.m_secIdType, l_theOther.m_secIdType) != 0:
         return False
     if Util.StringCompare(self.m_secId, l_theOther.m_secId) != 0:
         return False
     #  compare combo legs
     if not Util.VectorEqualsUnordered(self.m_comboLegs, l_theOther.m_comboLegs):
         return False
     if self.m_underComp != l_theOther.m_underComp:
         if self.m_underComp is None or l_theOther.m_underComp is None:
             return False
         if not self.m_underComp == l_theOther.m_underComp:
             return False
     return True
示例#6
0
 def __eq__(self, other):
     if (self == other):
         return True
     if other is None:
         return False
     state = other
     if (self.m_commission != state.m_commission) or (
             self.m_minCommission != state.m_minCommission) or (
                 self.m_maxCommission != state.m_maxCommission):
         return False
     if (Util.StringCompare(self.m_status, state.m_status) != 0) or (
             Util.StringCompare(self.m_initMargin, state.m_initMargin) != 0
     ) or (Util.StringCompare(self.m_maintMargin, state.m_maintMargin) !=
           0) or (Util.StringCompare(
               self.m_equityWithLoan, state.m_equityWithLoan) != 0) or (
                   Util.StringCompare(self.m_commissionCurrency,
                                      state.m_commissionCurrency) != 0):
         return False
     return True
示例#7
0
 def __eq__(self, other):
     """ generated source for method equals """
     if self == other:
         return True
     if other is None:
         return False
     state = other
     if self.m_commission != state.m_commission or self.m_minCommission != state.m_minCommission or self.m_maxCommission != state.m_maxCommission:
         return False
     if Util.StringCompare(
             self.m_status, state.m_status) != 0 or Util.StringCompare(
                 self.m_initMargin,
                 state.m_initMargin) != 0 or Util.StringCompare(
                     self.m_maintMargin,
                     state.m_maintMargin) != 0 or Util.StringCompare(
                         self.m_equityWithLoan,
                         state.m_equityWithLoan) != 0 or Util.StringCompare(
                             self.m_commissionCurrency,
                             state.m_commissionCurrency) != 0:
         return False
     return True
示例#8
0
	def __eq__(self, p_other):
		""" generated source for method equals """
		if self is p_other:
			return True
		if p_other is None:
			return False
		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_trailingPercent != l_theOther.m_trailingPercent 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_optOutSmartRouting != l_theOther.m_optOutSmartRouting 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_deltaNeutralConId != l_theOther.m_deltaNeutralConId or self.m_deltaNeutralShortSale != l_theOther.m_deltaNeutralShortSale or self.m_deltaNeutralShortSaleSlot != l_theOther.m_deltaNeutralShortSaleSlot 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_scalePriceAdjustValue != l_theOther.m_scalePriceAdjustValue or self.m_scalePriceAdjustInterval != l_theOther.m_scalePriceAdjustInterval or self.m_scaleProfitOffset != l_theOther.m_scaleProfitOffset or self.m_scaleAutoReset != l_theOther.m_scaleAutoReset or self.m_scaleInitPosition != l_theOther.m_scaleInitPosition or self.m_scaleInitFillQty != l_theOther.m_scaleInitFillQty or self.m_scaleRandomPercent != l_theOther.m_scaleRandomPercent or self.m_whatIf != l_theOther.m_whatIf or self.m_notHeld != l_theOther.m_notHeld or self.m_exemptCode != l_theOther.m_exemptCode:
			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_activeStartTime, l_theOther.m_activeStartTime) != 0 or Util.StringCompare(self.m_activeStopTime, l_theOther.m_activeStopTime) != 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_deltaNeutralSettlingFirm, l_theOther.m_deltaNeutralSettlingFirm) != 0 or Util.StringCompare(self.m_deltaNeutralClearingAccount, l_theOther.m_deltaNeutralClearingAccount) != 0 or Util.StringCompare(self.m_deltaNeutralClearingIntent, l_theOther.m_deltaNeutralClearingIntent) != 0 or Util.StringCompare(self.m_deltaNeutralOpenClose, l_theOther.m_deltaNeutralOpenClose) != 0 or Util.StringCompare(self.m_deltaNeutralDesignatedLocation, l_theOther.m_deltaNeutralDesignatedLocation) != 0 or Util.StringCompare(self.m_hedgeType, l_theOther.m_hedgeType) != 0 or Util.StringCompare(self.m_hedgeParam, l_theOther.m_hedgeParam) != 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 or Util.StringCompare(self.m_scaleTable, l_theOther.m_scaleTable) != 0:
			return False
		if not Util.VectorEqualsUnordered(self.m_algoParams, l_theOther.m_algoParams):
			return False
		if not Util.VectorEqualsUnordered(self.m_smartComboRoutingParams, l_theOther.m_smartComboRoutingParams):
			return False
		#  compare order combo legs
		if not Util.VectorEqualsUnordered(self.m_orderComboLegs, l_theOther.m_orderComboLegs):
			return False
		return True
示例#9
0
    def __eq__(self, p_other):
        if self is p_other:
            return True
        if p_other is None or not isinstance(p_other, (Contract)):
            return False
        l_theOther = p_other
        if (self.m_conId != l_theOther.m_conId):
            return False

        if self.m_comboLegs and l_theOther.comboLegsSize and len(
                self.m_comboLegs) != len(l_theOther.m_comboLegs):
            return False
        elif self.m_comboLegs or self.m_comboLegs:
            return False

        if (Util.StringCompare(self.m_secType, l_theOther.m_secType) != 0):
            return False
        if (Util.StringCompare(self.m_symbol, l_theOther.m_symbol) != 0) or (
                Util.StringCompare(self.m_exchange, l_theOther.m_exchange) != 0
        ) or (Util.StringCompare(self.m_primaryExch, l_theOther.m_primaryExch)
              != 0) or (Util.StringCompare(self.m_currency,
                                           l_theOther.m_currency) != 0):
            return False
        if not Util.NormalizeString(self.m_secType) == "BOND":
            if (self.m_strike != l_theOther.m_strike):
                return False
            if (Util.StringCompare(self.m_expiry, l_theOther.m_expiry) !=
                    0) or (Util.StringCompare(self.m_right, l_theOther.m_right)
                           != 0) or (Util.StringCompare(
                               self.m_multiplier, l_theOther.m_multiplier) !=
                                     0) or (Util.StringCompare(
                                         self.m_localSymbol,
                                         l_theOther.m_localSymbol) != 0):
                return False
        if self.m_comboLegs and len(self.m_comboLegs) > 0:
            comboLegsSize = len(self.m_comboLegs)
            alreadyMatchedSecondLeg = [
                bool() for __idx0 in range(comboLegsSize)
            ]
            ## for-while
            ctr1 = 0
            while ctr1 < comboLegsSize:
                l_thisComboLeg = self.m_comboLegs[ctr1]
                ctr2 = 0
                ## for-while
                while ctr2 < comboLegsSize:
                    if alreadyMatchedSecondLeg[ctr2]:
                        continue
                    if l_thisComboLeg == l_theOther.m_comboLegs[ctr2]:
                        alreadyMatchedSecondLeg[ctr2] = True
                        break
                    ctr2 += 1
                if ctr2 >= comboLegsSize:
                    return False
                ctr1 += 1
        if (self.m_underComp != l_theOther.m_underComp):
            if self.m_underComp is None or l_theOther.m_underComp is None:
                return False
            if not self.m_underComp == l_theOther.m_underComp:
                return False
        return True