class_docstr: Decode IB messages and invoke corresponding wrapper methods.
class_docstr_tok: ["Decode","IB","messages","and","invoke","corresponding","wrapper","methods","."]
code: def completedOrder(self, fields):
      o = Order()
      c = Contract()
      st = OrderState()
  
      (
          _,
          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.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.startingPrice,
          o.stockRefPrice,
          o.delta,
          o.stockRangeLower,
          o.stockRangeUpper,
          o.displaySize,
          o.sweepToFill,
          o.allOrNone,
          o.minQty,
          o.ocaType,
          o.triggerMethod,
          o.volatility,
          o.volatilityType,
          o.deltaNeutralOrderType,
          o.deltaNeutralAuxPrice,
          *fields,
      ) = fields
  
      if o.deltaNeutralOrderType:
          (
              o.deltaNeutralConId,
              o.deltaNeutralShortSale,
              o.deltaNeutralShortSaleSlot,
              o.deltaNeutralDesignatedLocation,
              *fields,
          ) = fields
      (
          o.continuousUpdate,
          o.referencePriceType,
          o.trailStopPrice,
          o.trailingPercent,
          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.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,
          st.status,
          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.trailStopPrice,
          o.lmtPriceOffset,
          o.cashQty,
          o.dontUseAutoPriceForHedge,
          o.isOmsContainer,
          o.autoCancelDate,
          o.filledQuantity,
          o.refFuturesConId,
          o.autoCancelParent,
          o.shareholder,
          o.imbalanceOnly,
          o.routeMarketableToBbo,
          o.parentPermId,
          st.completedTime,
          st.completedStatus,
          *fields,
      ) = fields
  
      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.completedOrder(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 33 for calling the Decoder obj's underlying member method code with example usage: obj.completedOrder(fields) without return types