#NEWLINE# @ classmethod #NEWLINE# def openOrder( cls , orderId , contract , order , orderState ) : #NEWLINE# #INDENT# ' generated source for method openOrder ' #NEWLINE# msg = ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( 'open order: orderId=' + str ( orderId ) ) + ' action=' ) + str ( order . m_action ) ) + ' quantity=' ) + str ( order . m_totalQuantity ) ) + ' symbol=' ) + str ( contract . m_symbol ) ) + ' exchange=' ) + str ( contract . m_exchange ) ) + ' secType=' ) + str ( contract . m_secType ) ) + ' type=' ) + str ( order . m_orderType ) ) + ' lmtPrice=' ) + Util . DoubleMaxString ( order . m_lmtPrice ) ) + ' auxPrice=' ) + Util . DoubleMaxString ( order . m_auxPrice ) ) + ' TIF=' ) + str ( order . m_tif ) ) + ' localSymbol=' ) + str ( contract . m_localSymbol ) ) + ' client Id=' ) + str ( order . m_clientId ) ) + ' parent Id=' ) + str ( order . m_parentId ) ) + ' permId=' ) + str ( order . m_permId ) ) + ' outsideRth=' ) + str ( order . m_outsideRth ) ) + ' hidden=' ) + str ( order . m_hidden ) ) + ' discretionaryAmt=' ) + str ( order . m_discretionaryAmt ) ) + ' displaySize=' ) + str ( order . m_displaySize ) ) + ' triggerMethod=' ) + str ( order . m_triggerMethod ) ) + ' goodAfterTime=' ) + str ( order . m_goodAfterTime ) ) + ' goodTillDate=' ) + str ( order . m_goodTillDate ) ) + ' faGroup=' ) + str ( order . m_faGroup ) ) + ' faMethod=' ) + str ( order . m_faMethod ) ) + ' faPercentage=' ) + str ( order . m_faPercentage ) ) + ' faProfile=' ) + str ( order . m_faProfile ) ) + ' shortSaleSlot=' ) + str ( order . m_shortSaleSlot ) ) + ' designatedLocation=' ) + str ( order . m_designatedLocation ) ) + ' exemptCode=' ) + str ( order . m_exemptCode ) ) + ' ocaGroup=' ) + str ( order . m_ocaGroup ) ) + ' ocaType=' ) + str ( order . m_ocaType ) ) + ' rule80A=' ) + str ( order . m_rule80A ) ) + ' allOrNone=' ) + str ( order . m_allOrNone ) ) + ' minQty=' ) + Util . IntMaxString ( order . m_minQty ) ) + ' percentOffset=' ) + Util . DoubleMaxString ( order . m_percentOffset ) ) + ' eTradeOnly=' ) + order . m_eTradeOnly ) + ' firmQuoteOnly=' ) + str ( order . m_firmQuoteOnly ) ) + ' nbboPriceCap=' ) + Util . DoubleMaxString ( order . m_nbboPriceCap ) ) + ' optOutSmartRouting=' ) + str ( order . m_optOutSmartRouting ) ) + ' auctionStrategy=' ) + str ( order . m_auctionStrategy ) ) + ' startingPrice=' ) + Util . DoubleMaxString ( order . m_startingPrice ) ) + ' stockRefPrice=' ) + Util . DoubleMaxString ( order . m_stockRefPrice ) ) + ' delta=' ) + Util . DoubleMaxString ( order . m_delta ) ) + ' stockRangeLower=' ) + Util . DoubleMaxString ( order . m_stockRangeLower ) ) + ' stockRangeUpper=' ) + Util . DoubleMaxString ( order . m_stockRangeUpper ) ) + ' volatility=' ) + Util . DoubleMaxString ( order . m_volatility ) ) + ' volatilityType=' ) + str ( order . m_volatilityType ) ) + ' deltaNeutralOrderType=' ) + str ( order . m_deltaNeutralOrderType ) ) + ' deltaNeutralAuxPrice=' ) + Util . DoubleMaxString ( order . m_deltaNeutralAuxPrice ) ) + ' deltaNeutralConId=' ) + str ( order . m_deltaNeutralConId ) ) + ' deltaNeutralSettlingFirm=' ) + str ( order . m_deltaNeutralSettlingFirm ) ) + ' deltaNeutralClearingAccount=' ) + str ( order . m_deltaNeutralClearingAccount ) ) + ' deltaNeutralClearingIntent=' ) + str ( order . m_deltaNeutralClearingIntent ) ) + ' continuousUpdate=' ) + str ( order . m_continuousUpdate ) ) + ' referencePriceType=' ) + str ( order . m_referencePriceType ) ) + ' trailStopPrice=' ) + Util . DoubleMaxString ( order . m_trailStopPrice ) ) + ' trailingPercent=' ) + Util . DoubleMaxString ( order . m_trailingPercent ) ) + ' scaleInitLevelSize=' ) + Util . IntMaxString ( order . m_scaleInitLevelSize ) ) + ' scaleSubsLevelSize=' ) + Util . IntMaxString ( order . m_scaleSubsLevelSize ) ) + ' scalePriceIncrement=' ) + Util . DoubleMaxString ( order . m_scalePriceIncrement ) ) + ' scalePriceAdjustValue=' ) + Util . DoubleMaxString ( order . m_scalePriceAdjustValue ) ) + ' scalePriceAdjustInterval=' ) + Util . IntMaxString ( order . m_scalePriceAdjustInterval ) ) + ' scaleProfitOffset=' ) + Util . DoubleMaxString ( order . m_scaleProfitOffset ) ) + ' scaleAutoReset=' ) + str ( order . m_scaleAutoReset ) ) + ' scaleInitPosition=' ) + Util . IntMaxString ( order . m_scaleInitPosition ) ) + ' scaleInitFillQty=' ) + Util . IntMaxString ( order . m_scaleInitFillQty ) ) + ' scaleRandomPercent=' ) + str ( order . m_scaleRandomPercent ) ) + ' hedgeType=' ) + str ( order . m_hedgeType ) ) + ' hedgeParam=' ) + str ( order . m_hedgeParam ) ) + ' account=' ) + str ( order . m_account ) ) + ' settlingFirm=' ) + str ( order . m_settlingFirm ) ) + ' clearingAccount=' ) + str ( order . m_clearingAccount ) ) + ' clearingIntent=' ) + str ( order . m_clearingIntent ) ) + ' notHeld=' ) + str ( order . m_notHeld ) ) + ' whatIf=' ) + str ( order . m_whatIf ) ) #NEWLINE# if ( 'BAG' == contract . m_secType ) : #NEWLINE# #INDENT# if ( contract . m_comboLegsDescrip is not None ) : #NEWLINE# #INDENT# msg += ( ' comboLegsDescrip=' + str ( contract . m_comboLegsDescrip ) ) #NEWLINE# #UNINDENT# msg += ' comboLegs={' #NEWLINE# if ( contract . m_comboLegs is not None ) : #NEWLINE# #INDENT# i = 0 #NEWLINE# while ( i < len ( contract . m_comboLegs ) ) : #NEWLINE# #INDENT# comboLeg = contract . m_comboLegs [ i ] #NEWLINE# msg += ( ( ' leg ' + str ( ( i + 1 ) ) ) + ': ' ) #NEWLINE# msg += ( 'conId=' + str ( comboLeg . m_conId ) ) #NEWLINE# msg += ( ' ratio=' + str ( comboLeg . m_ratio ) ) #NEWLINE# msg += ( ' action=' + str ( comboLeg . m_action ) ) #NEWLINE# msg += ( ' exchange=' + str ( comboLeg . m_exchange ) ) #NEWLINE# msg += ( ' openClose=' + str ( comboLeg . m_openClose ) ) #NEWLINE# msg += ( ' shortSaleSlot=' + str ( comboLeg . m_shortSaleSlot ) ) #NEWLINE# msg += ( ' designatedLocation=' + str ( comboLeg . m_designatedLocation ) ) #NEWLINE# msg += ( ' exemptCode=' + str ( comboLeg . m_exemptCode ) ) #NEWLINE# if ( ( order . m_orderComboLegs is not None ) and ( len ( contract . m_comboLegs ) == len ( comboLeg . m_orderComboLegs ) ) ) : #NEWLINE# #INDENT# orderComboLeg = order . m_orderComboLegs [ i ] #NEWLINE# msg += ( ' price=' + Util . DoubleMaxString ( orderComboLeg . m_price ) ) #NEWLINE# #UNINDENT# msg += ';' #NEWLINE# i += 1 #NEWLINE# #UNINDENT# #UNINDENT# msg += '}' #NEWLINE# if ( order . m_basisPoints != Double . MAX_VALUE ) : #NEWLINE# #INDENT# msg += ( ' basisPoints=' + Util . DoubleMaxString ( order . m_basisPoints ) ) #NEWLINE# msg += ( ' basisPointsType=' + Util . IntMaxString ( order . m_basisPointsType ) ) #NEWLINE# #UNINDENT# #UNINDENT# if ( contract . m_underComp is not None ) : #NEWLINE# #INDENT# underComp = contract . m_underComp #NEWLINE# msg += ( ( ( ( ( ' underComp.conId =' + str ( underComp . m_conId ) ) + ' underComp.delta =' ) + str ( underComp . m_delta ) ) + ' underComp.price =' ) + str ( underComp . m_price ) ) #NEWLINE# #UNINDENT# if ( not Util . StringIsEmpty ( order . m_algoStrategy ) ) : #NEWLINE# #INDENT# msg += ( ' algoStrategy=' + str ( order . m_algoStrategy ) ) #NEWLINE# msg += ' algoParams={' #NEWLINE# if ( order . m_algoParams is not None ) : #NEWLINE# #INDENT# algoParams = order . m_algoParams #NEWLINE# i = 0 #NEWLINE# while ( i < len ( algoParams ) ) : #NEWLINE# #INDENT# param = algoParams [ i ] #NEWLINE# if ( i > 0 ) : #NEWLINE# #INDENT# msg += ',' #NEWLINE# #UNINDENT# msg += ( ( str ( param . m_tag ) + '=' ) + str ( param . m_value ) ) #NEWLINE# i += 1 #NEWLINE# #UNINDENT# #UNINDENT# msg += '}' #NEWLINE# #UNINDENT# if ( 'BAG' == contract . m_secType ) : #NEWLINE# #INDENT# msg += ' smartComboRoutingParams={' #NEWLINE# if ( order . m_smartComboRoutingParams is not None ) : #NEWLINE# #INDENT# smartComboRoutingParams = order . m_smartComboRoutingParams #NEWLINE# i = 0 #NEWLINE# while ( i < len ( smartComboRoutingParams ) ) : #NEWLINE# #INDENT# param = smartComboRoutingParams [ i ] #NEWLINE# if ( i > 0 ) : #NEWLINE# #INDENT# msg += ',' #NEWLINE# #UNINDENT# msg += ( ( str ( param . m_tag ) + '=' ) + str ( param . m_value ) ) #NEWLINE# i += 1 #NEWLINE# #UNINDENT# #UNINDENT# msg += '}' #NEWLINE# #UNINDENT# orderStateMsg = ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ' status=' + str ( orderState . m_status ) ) + ' initMargin=' ) + str ( orderState . m_initMargin ) ) + ' maintMargin=' ) + str ( orderState . m_maintMargin ) ) + ' equityWithLoan=' ) + str ( orderState . m_equityWithLoan ) ) + ' commission=' ) + Util . DoubleMaxString ( orderState . m_commission ) ) + ' minCommission=' ) + Util . DoubleMaxString ( orderState . m_minCommission ) ) + ' maxCommission=' ) + Util . DoubleMaxString ( orderState . m_maxCommission ) ) + ' commissionCurrency=' ) + str ( orderState . m_commissionCurrency ) ) + ' warningText=' ) + str ( orderState . m_warningText ) ) #NEWLINE# return ( msg + orderStateMsg )