class_docstr: Decode IB messages and invoke corresponding wrapper methods.
class_docstr_tok: ["Decode","IB","messages","and","invoke","corresponding","wrapper","methods","."]
code: def openOrder(self, fields):
      o = Order()
      c = Contract()
      st = OrderState()
      (
          _,
          o.orderId,
          c.conId,
          c.symbol,
          c.secType,
          c.lastTradeDateOrContractMonth,
          c.strike,
          c.right,
          c.multiplier,
          c.exchange,
          c.currency,
          c.localSymbol,
          c.tradingClass,
          o.action,
          o.totalQuantity,
          o.orderType,
          o.lmtPrice,
          o.auxPrice,
          o.tif,
          o.ocaGroup,
          o.account,
          o.openClose,
          o.origin,
          o.orderRef,
          o.clientId,
          o.permId,
          o.outsideRth,
          o.hidden,
          o.discretionaryAmt,
          o.goodAfterTime,
          _,
          o.faGroup,
          o.faMethod,
          o.faPercentage,
          *fields,
      ) = fields
      if self.serverVersion < 177:
          o.faProfile, *fields = fields
      (
          o.modelCode,
          o.goodTillDate,
          o.rule80A,
          o.percentOffset,
          o.settlingFirm,
          o.shortSaleSlot,
          o.designatedLocation,
          o.exemptCode,
          o.auctionStrategy,
          o.startingPrice,
          o.stockRefPrice,
          o.delta,
          o.stockRangeLower,
          o.stockRangeUpper,
          o.displaySize,
          o.blockOrder,
          o.sweepToFill,
          o.allOrNone,
          o.minQty,
          o.ocaType,
          o.eTradeOnly,
          o.firmQuoteOnly,
          o.nbboPriceCap,
          o.parentId,
          o.triggerMethod,
          o.volatility,
          o.volatilityType,
          o.deltaNeutralOrderType,
          o.deltaNeutralAuxPrice,
          *fields,
      ) = fields
  
      if o.deltaNeutralOrderType:
          (
              o.deltaNeutralConId,
              o.deltaNeutralSettlingFirm,
              o.deltaNeutralClearingAccount,
              o.deltaNeutralClearingIntent,
              o.deltaNeutralOpenClose,
              o.deltaNeutralShortSale,
              o.deltaNeutralShortSaleSlot,
              o.deltaNeutralDesignatedLocation,
              *fields,
          ) = fields
      (
          o.continuousUpdate,
          o.referencePriceType,
          o.trailStopPrice,
          o.trailingPercent,
          o.basisPoints,
          o.basisPointsType,
          c.comboLegsDescrip,
          *fields,
      ) = fields
  
      numLegs = int(fields.pop(0))
      c.comboLegs = []
      for _ in range(numLegs):
          leg: Any = ComboLeg()
          (
              leg.conId,
              leg.ratio,
              leg.action,
              leg.exchange,
              leg.openClose,
              leg.shortSaleSlot,
              leg.designatedLocation,
              leg.exemptCode,
              *fields,
          ) = fields
          self.parse(leg)
          c.comboLegs.append(leg)
  
      numOrderLegs = int(fields.pop(0))
      o.orderComboLegs = []
      for _ in range(numOrderLegs):
          leg = OrderComboLeg()
          leg.price = fields.pop(0)
          self.parse(leg)
          o.orderComboLegs.append(leg)
  
      numParams = int(fields.pop(0))
      if numParams > 0:
          o.smartComboRoutingParams = []
          for _ in range(numParams):
              tag, value, *fields = fields
              o.smartComboRoutingParams.append(TagValue(tag, value))
  
      (
          o.scaleInitLevelSize,
          o.scaleSubsLevelSize,
          increment,
          *fields,
      ) = fields
  
      o.scalePriceIncrement = float(increment or UNSET_DOUBLE)
      if 0 < o.scalePriceIncrement < UNSET_DOUBLE:
          (
              o.scalePriceAdjustValue,
              o.scalePriceAdjustInterval,
              o.scaleProfitOffset,
              o.scaleAutoReset,
              o.scaleInitPosition,
              o.scaleInitFillQty,
              o.scaleRandomPercent,
              *fields,
          ) = fields
  
      o.hedgeType = fields.pop(0)
      if o.hedgeType:
          o.hedgeParam = fields.pop(0)
  
      (
          o.optOutSmartRouting,
          o.clearingAccount,
          o.clearingIntent,
          o.notHeld,
          dncPresent,
          *fields,
      ) = fields
  
      if int(dncPresent):
          conId, delta, price, *fields = fields
          c.deltaNeutralContract = DeltaNeutralContract(
              int(conId or 0), float(delta or 0), float(price or 0)
          )
  
      o.algoStrategy = fields.pop(0)
      if o.algoStrategy:
          numParams = int(fields.pop(0))
          if numParams > 0:
              o.algoParams = []
              for _ in range(numParams):
                  tag, value, *fields = fields
                  o.algoParams.append(TagValue(tag, value))
  
      (
          o.solicited,
          o.whatIf,
          st.status,
          st.initMarginBefore,
          st.maintMarginBefore,
          st.equityWithLoanBefore,
          st.initMarginChange,
          st.maintMarginChange,
          st.equityWithLoanChange,
          st.initMarginAfter,
          st.maintMarginAfter,
          st.equityWithLoanAfter,
          st.commission,
          st.minCommission,
          st.maxCommission,
          st.commissionCurrency,
          st.warningText,
          o.randomizeSize,
          o.randomizePrice,
          *fields,
      ) = fields
  
      if o.orderType in ("PEG BENCH", "PEGBENCH"):
          (
              o.referenceContractId,
              o.isPeggedChangeAmountDecrease,
              o.peggedChangeAmount,
              o.referenceChangeAmount,
              o.referenceExchangeId,
              *fields,
          ) = fields
  
      numConditions = int(fields.pop(0))
      if numConditions > 0:
          for _ in range(numConditions):
              condType = int(fields.pop(0))
              condCls = OrderCondition.createClass(condType)
              n = len(dataclasses.fields(condCls)) - 1
              cond = condCls(condType, *fields[:n])
              self.parse(cond)
              o.conditions.append(cond)
              fields = fields[n:]
          (
              o.conditionsIgnoreRth,
              o.conditionsCancelOrder,
              *fields,
          ) = fields
  
      (
          o.adjustedOrderType,
          o.triggerPrice,
          o.trailStopPrice,
          o.lmtPriceOffset,
          o.adjustedStopPrice,
          o.adjustedStopLimitPrice,
          o.adjustedTrailingAmount,
          o.adjustableTrailingUnit,
          o.softDollarTier.name,
          o.softDollarTier.val,
          o.softDollarTier.displayName,
          o.cashQty,
          o.dontUseAutoPriceForHedge,
          o.isOmsContainer,
          o.discretionaryUpToLimitPrice,
          o.usePriceMgmtAlgo,
          *fields,
      ) = fields
  
      if self.serverVersion >= 159:
          o.duration = fields.pop(0)
      if self.serverVersion >= 160:
          o.postToAts = fields.pop(0)
      if self.serverVersion >= 162:
          o.autoCancelParent = fields.pop(0)
      if self.serverVersion >= 170:
          (
              o.minTradeQty,
              o.minCompeteSize,
              o.competeAgainstBestOffset,
              o.midOffsetAtWhole,
              o.midOffsetAtHalf,
              *fields,
          ) = fields
  
      self.parse(c)
      self.parse(o)
      self.parse(st)
      self.wrapper.openOrder(o.orderId, c, o, st)
  
imports: import dataclasses
  import logging
  from datetime import datetime, timezone
  from typing import Any, cast
  from .contract import ComboLeg, Contract, ContractDescription, ContractDetails, DeltaNeutralContract
  from .objects import BarData, CommissionReport, DepthMktDataDescription, Execution, FamilyCode, HistogramData, HistoricalSession, HistoricalTick, HistoricalTickBidAsk, HistoricalTickLast, NewsProvider, PriceIncrement, SmartComponent, SoftDollarTier, TagValue, TickAttribBidAsk, TickAttribLast
  from .order import Order, OrderComboLeg, OrderCondition, OrderState
  from .util import UNSET_DOUBLE, ZoneInfo, parseIBDatetime
  from .wrapper import Wrapper
label_desc: Use image node_id 32 for calling the Decoder obj's underlying member method code with example usage: obj.openOrder(fields) without return types