I'm having a hard time submitting an order to my IB Gateway. The TWS logs don't tell me much as to what I am doing wrong:
06:51:30:519 <- 3-42-0-0-IVE-STK--0---ARCA--USD-IVE-----0--0-0-----0--0-0-0-0-0-0-0-0--0-------0--0-0---0-0-0-0-0-0-0-0-0-0-0-0-0-0-0--0-0-0-0-0-0-0-0-----0---0-0--0--
06:51:30:535 -> 4-2-0-321-Error validating request.-'bN' : cause - Invalid order type was entered-
I am just trying to submit a MKT order to flatten my position of 100 shares. Here is the order object I'm sending to the gateway:
I: May-21 08:20:09.497991 | service.go | ib.placeOrder | sent order: {OrderID:1 ClientID:0 PermID:0 Action:SELL TotalQty:100 OrderType:MKT LimitPrice:1.7976931348623157e+308 AuxPrice:1.7976931348623157e+308 TIF: ActiveStartTime: ActiveStopTime: OCAGroup: OCAType:0 OrderRef:Closing position Transmit:true ParentID:0 BlockOrder:false SweepToFill:false DisplaySize:0 TriggerMethod:0 OutsideRTH:false Hidden:false GoodAfterTime: GoodTillDate: OverridePercentageConstraints:false Rule80A: AllOrNone:false MinQty:9223372036854775807 PercentOffset:1.7976931348623157e+308 TrailStopPrice:1.7976931348623157e+308 TrailingPercent:1.7976931348623157e+308 FAGroup: FAProfile: FAMethod: FAPercentage: OpenClose:O Origin:0 ShortSaleSlot:0 DesignatedLocation: ExemptCode:-1 DiscretionaryAmount:0 ETradeOnly:0 FirmQuoteOnly:false NBBOPriceCap:1.7976931348623157e+308 OptOutSmartRouting:false AuctionStrategy:0 StartingPrice:1.7976931348623157e+308 StockRefPrice:1.7976931348623157e+308 Delta:1.7976931348623157e+308 StockRangeLower:1.7976931348623157e+308 StockRangeUpper:1.7976931348623157e+308 Volatility:1.7976931348623157e+308 VolatilityType:9223372036854775807 ContinuousUpdate:0 ReferencePriceType:9223372036854775807 DeltaNeutralOrderType: DeltaNeutralAuxPrice:1.7976931348623157e+308 DeltaNeutral:{ContractID:0 SettlingFirm: ClearingAccount: ClearingIntent: OpenClose: ShortSale:false ShortSaleSlot:0 DesignatedLocation:} BasisPoints:1.7976931348623157e+308 BasisPointsType:9223372036854775807 ScaleInitLevelSize:9223372036854775807 ScaleSubsLevelSize:9223372036854775807 ScalePriceIncrement:1.7976931348623157e+308 ScalePriceAdjustValue:1.7976931348623157e+308 ScalePriceAdjustInterval:9223372036854775807 ScaleProfitOffset:1.7976931348623157e+308 ScaleAutoReset:false ScaleInitPosition:9223372036854775807 ScaleInitFillQty:9223372036854775807 ScaleRandomPercent:false ScaleTable: HedgeType: HedgeParam: Account
U927493 SettlingFirm: ClearingAccount: ClearingIntent: AlgoStrategy: AlgoParams:{Params:[]} WhatIf:false NotHeld:false SmartComboRoutingParams:[] OrderComboLegs:[] OrderMiscOptions:[]}
06:51:30:519 <- 3-42-0-0-IVE-STK--0---ARCA--USD-IVE-----0--0-0-----0--0-0-0-0-0-0-0-0--0-------0--0-0---0-0-0-0-0-0-0-0-0-0-0-0-0-0-0--0-0-0-0-0-0-0-0-----0---0-0--0--
06:51:30:535 -> 4-2-0-321-Error validating request.-'bN' : cause - Invalid order type was entered-
I am just trying to submit a MKT order to flatten my position of 100 shares. Here is the order object I'm sending to the gateway:
I: May-21 08:20:09.497991 | service.go | ib.placeOrder | sent order: {OrderID:1 ClientID:0 PermID:0 Action:SELL TotalQty:100 OrderType:MKT LimitPrice:1.7976931348623157e+308 AuxPrice:1.7976931348623157e+308 TIF: ActiveStartTime: ActiveStopTime: OCAGroup: OCAType:0 OrderRef:Closing position Transmit:true ParentID:0 BlockOrder:false SweepToFill:false DisplaySize:0 TriggerMethod:0 OutsideRTH:false Hidden:false GoodAfterTime: GoodTillDate: OverridePercentageConstraints:false Rule80A: AllOrNone:false MinQty:9223372036854775807 PercentOffset:1.7976931348623157e+308 TrailStopPrice:1.7976931348623157e+308 TrailingPercent:1.7976931348623157e+308 FAGroup: FAProfile: FAMethod: FAPercentage: OpenClose:O Origin:0 ShortSaleSlot:0 DesignatedLocation: ExemptCode:-1 DiscretionaryAmount:0 ETradeOnly:0 FirmQuoteOnly:false NBBOPriceCap:1.7976931348623157e+308 OptOutSmartRouting:false AuctionStrategy:0 StartingPrice:1.7976931348623157e+308 StockRefPrice:1.7976931348623157e+308 Delta:1.7976931348623157e+308 StockRangeLower:1.7976931348623157e+308 StockRangeUpper:1.7976931348623157e+308 Volatility:1.7976931348623157e+308 VolatilityType:9223372036854775807 ContinuousUpdate:0 ReferencePriceType:9223372036854775807 DeltaNeutralOrderType: DeltaNeutralAuxPrice:1.7976931348623157e+308 DeltaNeutral:{ContractID:0 SettlingFirm: ClearingAccount: ClearingIntent: OpenClose: ShortSale:false ShortSaleSlot:0 DesignatedLocation:} BasisPoints:1.7976931348623157e+308 BasisPointsType:9223372036854775807 ScaleInitLevelSize:9223372036854775807 ScaleSubsLevelSize:9223372036854775807 ScalePriceIncrement:1.7976931348623157e+308 ScalePriceAdjustValue:1.7976931348623157e+308 ScalePriceAdjustInterval:9223372036854775807 ScaleProfitOffset:1.7976931348623157e+308 ScaleAutoReset:false ScaleInitPosition:9223372036854775807 ScaleInitFillQty:9223372036854775807 ScaleRandomPercent:false ScaleTable: HedgeType: HedgeParam: Account
U927493 SettlingFirm: ClearingAccount: ClearingIntent: AlgoStrategy: AlgoParams:{Params:[]} WhatIf:false NotHeld:false SmartComboRoutingParams:[] OrderComboLegs:[] OrderMiscOptions:[]}