MCPcopy Create free account
hub / github.com/TraderAlice/OpenAlice / decodeComboLegs

Method decodeComboLegs

packages/ibkr/src/order-decoder.ts:314–346  ·  view source on GitHub ↗
(fields: Iterator<string>)

Source from the content-addressed store, hash-verified

312 }
313
314 decodeComboLegs(fields: Iterator<string>): void {
315 this.contract.comboLegsDescrip = decodeStr(fields)
316
317 if (this.version >= 29) {
318 const comboLegsCount = decodeInt(fields)
319
320 if (comboLegsCount > 0) {
321 this.contract.comboLegs = []
322 for (let i = 0; i < comboLegsCount; i++) {
323 const comboLeg = new ComboLeg()
324 comboLeg.conId = decodeInt(fields)
325 comboLeg.ratio = decodeInt(fields)
326 comboLeg.action = decodeStr(fields)
327 comboLeg.exchange = decodeStr(fields)
328 comboLeg.openClose = decodeInt(fields)
329 comboLeg.shortSaleSlot = decodeInt(fields)
330 comboLeg.designatedLocation = decodeStr(fields)
331 comboLeg.exemptCode = decodeInt(fields)
332 this.contract.comboLegs.push(comboLeg)
333 }
334 }
335
336 const orderComboLegsCount = decodeInt(fields)
337 if (orderComboLegsCount > 0) {
338 this.order.orderComboLegs = []
339 for (let i = 0; i < orderComboLegsCount; i++) {
340 const orderComboLeg = new OrderComboLeg()
341 orderComboLeg.price = decodeFloat(fields, SHOW_UNSET)
342 this.order.orderComboLegs.push(orderComboLeg)
343 }
344 }
345 }
346 }
347
348 decodeSmartComboRoutingParams(fields: Iterator<string>): void {
349 if (this.version >= 26) {

Callers 1

applyOrderHandlersFunction · 0.95

Calls 4

decodeFloatFunction · 0.85
decodeStrFunction · 0.70
decodeIntFunction · 0.70
pushMethod · 0.65

Tested by

no test coverage detected