Skip to main content

ib_async.order

Generated from the installed ib_async 2.1.0 package. Signatures and defaults are version-specific.

Order types used by Interactive Brokers.

Public constants

NameValue
UNSET_DOUBLE1.7976931348623157e+308
UNSET_INTEGER2147483647

BracketOrder

BracketOrder(parent: ForwardRef('Order'), takeProfit: ForwardRef('Order'), stopLoss: ForwardRef('Order'))

BracketOrder(parent, takeProfit, stopLoss)

ExecutionCondition

ExecutionCondition(condType: 'int' = 5, conjunction: 'str' = 'a', secType: 'str' = '', exch: 'str' = '', symbol: 'str' = '') -> None

ExecutionCondition(condType: 'int' = 5, conjunction: 'str' = 'a', secType: 'str' = '', exch: 'str' = '', symbol: 'str' = '')

Fields

NameTypeDefault
condTypeint5
conjunctionstra
secTypestr``
exchstr``
symbolstr``

dict

dict(obj) -> dict

Return dataclass values as dict. This is a non-recursive variant of dataclasses.asdict.

nonDefaults

nonDefaults(obj) -> dict[str, typing.Any]

For a dataclass instance get the fields that are different from the default values and return as dict.

tuple

tuple(obj) -> tuple[typing.Any, ...]

Return dataclass values as tuple. This is a non-recursive variant of dataclasses.astuple.

update

update(obj, *srcObjs, **kwargs) -> object

Update fields of the given dataclass object from zero or more dataclass source objects and/or from keyword arguments.

LimitOrder

LimitOrder(action: 'str', totalQuantity: 'float', lmtPrice: 'float', **kwargs)

Order for trading contracts.

https://interactivebrokers.github.io/tws-api/available_orders.html

Fields

NameTypeDefault
orderIdint0
clientIdint0
permIdint0
actionstr``
totalQuantityfloat0.0
orderTypestr``
lmtPricefloat | Decimal | None1.7976931348623157e+308
auxPricefloat | Decimal | None1.7976931348623157e+308
tifstr``
activeStartTimestr``
activeStopTimestr``
ocaGroupstr``
ocaTypeint0
orderRefstr``
transmitboolTrue
parentIdint0
blockOrderboolFalse
sweepToFillboolFalse
displaySizeint0
triggerMethodint0
outsideRthboolFalse
hiddenboolFalse
goodAfterTimestr``
goodTillDatestr``
rule80Astr``
allOrNoneboolFalse
minQtyint2147483647
percentOffsetfloat | Decimal1.7976931348623157e+308
overridePercentageConstraintsboolFalse
trailStopPricefloat | Decimal1.7976931348623157e+308
trailingPercentfloat | Decimal1.7976931348623157e+308
faGroupstr``
faProfilestr``
faMethodstr``
faPercentagestr``
designatedLocationstr``
openClosestrO
originint0
shortSaleSlotint0
exemptCodeint-1
discretionaryAmtfloat0.0
eTradeOnlyboolFalse
firmQuoteOnlyboolFalse
nbboPriceCapfloat | Decimal1.7976931348623157e+308
optOutSmartRoutingboolFalse
auctionStrategyint0
startingPricefloat | Decimal1.7976931348623157e+308
stockRefPricefloat | Decimal1.7976931348623157e+308
deltafloat | Decimal1.7976931348623157e+308
stockRangeLowerfloat | Decimal1.7976931348623157e+308
stockRangeUpperfloat | Decimal1.7976931348623157e+308
randomizePriceboolFalse
randomizeSizeboolFalse
volatilityfloat | Decimal1.7976931348623157e+308
volatilityTypeint2147483647
deltaNeutralOrderTypestr``
deltaNeutralAuxPricefloat | Decimal1.7976931348623157e+308
deltaNeutralConIdint0
deltaNeutralSettlingFirmstr``
deltaNeutralClearingAccountstr``
deltaNeutralClearingIntentstr``
deltaNeutralOpenClosestr``
deltaNeutralShortSaleboolFalse
deltaNeutralShortSaleSlotint0
deltaNeutralDesignatedLocationstr``
continuousUpdateboolFalse
referencePriceTypeint2147483647
basisPointsfloat | Decimal1.7976931348623157e+308
basisPointsTypeint2147483647
scaleInitLevelSizeint2147483647
scaleSubsLevelSizeint2147483647
scalePriceIncrementfloat | Decimal1.7976931348623157e+308
scalePriceAdjustValuefloat | Decimal1.7976931348623157e+308
scalePriceAdjustIntervalint2147483647
scaleProfitOffsetfloat | Decimal1.7976931348623157e+308
scaleAutoResetboolFalse
scaleInitPositionint2147483647
scaleInitFillQtyint2147483647
scaleRandomPercentboolFalse
scaleTablestr``
hedgeTypestr``
hedgeParamstr``
accountstr``
settlingFirmstr``
clearingAccountstr``
clearingIntentstr``
algoStrategystr``
algoParamslist[TagValue]factory: list
smartComboRoutingParamslist[TagValue]factory: list
algoIdstr``
whatIfboolFalse
notHeldboolFalse
solicitedboolFalse
modelCodestr``
orderComboLegslist[OrderComboLeg]factory: list
orderMiscOptionslist[TagValue]factory: list
referenceContractIdint0
peggedChangeAmountfloat0.0
isPeggedChangeAmountDecreaseboolFalse
referenceChangeAmountfloat0.0
referenceExchangeIdstr``
adjustedOrderTypestr``
triggerPricefloat | Decimal | None1.7976931348623157e+308
adjustedStopPricefloat | Decimal1.7976931348623157e+308
adjustedStopLimitPricefloat | Decimal1.7976931348623157e+308
adjustedTrailingAmountfloat | Decimal1.7976931348623157e+308
adjustableTrailingUnitint0
lmtPriceOffsetfloat | Decimal1.7976931348623157e+308
conditionslist[OrderCondition]factory: list
conditionsCancelOrderboolFalse
conditionsIgnoreRthboolFalse
extOperatorstr``
softDollarTierSoftDollarTierfactory: SoftDollarTier
cashQtyfloat | Decimal1.7976931348623157e+308
mifid2DecisionMakerstr``
mifid2DecisionAlgostr``
mifid2ExecutionTraderstr``
mifid2ExecutionAlgostr``
dontUseAutoPriceForHedgeboolFalse
isOmsContainerboolFalse
discretionaryUpToLimitPriceboolFalse
autoCancelDatestr``
filledQuantityfloat | Decimal1.7976931348623157e+308
refFuturesConIdint0
autoCancelParentboolFalse
shareholderstr``
imbalanceOnlyboolFalse
routeMarketableToBboboolFalse
parentPermIdint0
usePriceMgmtAlgoboolFalse
durationint2147483647
postToAtsint2147483647
advancedErrorOverridestr``
manualOrderTimestr``
minTradeQtyint2147483647
minCompeteSizeint2147483647
competeAgainstBestOffsetfloat | Decimal1.7976931348623157e+308
midOffsetAtWholefloat | Decimal1.7976931348623157e+308
midOffsetAtHalffloat | Decimal1.7976931348623157e+308

dict

dict(obj) -> dict

Return dataclass values as dict. This is a non-recursive variant of dataclasses.asdict.

nonDefaults

nonDefaults(obj) -> dict[str, typing.Any]

For a dataclass instance get the fields that are different from the default values and return as dict.

tuple

tuple(obj) -> tuple[typing.Any, ...]

Return dataclass values as tuple. This is a non-recursive variant of dataclasses.astuple.

update

update(obj, *srcObjs, **kwargs) -> object

Update fields of the given dataclass object from zero or more dataclass source objects and/or from keyword arguments.

MarginCondition

MarginCondition(condType: 'int' = 4, conjunction: 'str' = 'a', isMore: 'bool' = True, percent: 'int' = 0) -> None

MarginCondition(condType: 'int' = 4, conjunction: 'str' = 'a', isMore: 'bool' = True, percent: 'int' = 0)

Fields

NameTypeDefault
condTypeint4
conjunctionstra
isMoreboolTrue
percentint0

dict

dict(obj) -> dict

Return dataclass values as dict. This is a non-recursive variant of dataclasses.asdict.

nonDefaults

nonDefaults(obj) -> dict[str, typing.Any]

For a dataclass instance get the fields that are different from the default values and return as dict.

tuple

tuple(obj) -> tuple[typing.Any, ...]

Return dataclass values as tuple. This is a non-recursive variant of dataclasses.astuple.

update

update(obj, *srcObjs, **kwargs) -> object

Update fields of the given dataclass object from zero or more dataclass source objects and/or from keyword arguments.

MarketOrder

MarketOrder(action: 'str', totalQuantity: 'float', **kwargs)

Order for trading contracts.

https://interactivebrokers.github.io/tws-api/available_orders.html

Fields

NameTypeDefault
orderIdint0
clientIdint0
permIdint0
actionstr``
totalQuantityfloat0.0
orderTypestr``
lmtPricefloat | Decimal | None1.7976931348623157e+308
auxPricefloat | Decimal | None1.7976931348623157e+308
tifstr``
activeStartTimestr``
activeStopTimestr``
ocaGroupstr``
ocaTypeint0
orderRefstr``
transmitboolTrue
parentIdint0
blockOrderboolFalse
sweepToFillboolFalse
displaySizeint0
triggerMethodint0
outsideRthboolFalse
hiddenboolFalse
goodAfterTimestr``
goodTillDatestr``
rule80Astr``
allOrNoneboolFalse
minQtyint2147483647
percentOffsetfloat | Decimal1.7976931348623157e+308
overridePercentageConstraintsboolFalse
trailStopPricefloat | Decimal1.7976931348623157e+308
trailingPercentfloat | Decimal1.7976931348623157e+308
faGroupstr``
faProfilestr``
faMethodstr``
faPercentagestr``
designatedLocationstr``
openClosestrO
originint0
shortSaleSlotint0
exemptCodeint-1
discretionaryAmtfloat0.0
eTradeOnlyboolFalse
firmQuoteOnlyboolFalse
nbboPriceCapfloat | Decimal1.7976931348623157e+308
optOutSmartRoutingboolFalse
auctionStrategyint0
startingPricefloat | Decimal1.7976931348623157e+308
stockRefPricefloat | Decimal1.7976931348623157e+308
deltafloat | Decimal1.7976931348623157e+308
stockRangeLowerfloat | Decimal1.7976931348623157e+308
stockRangeUpperfloat | Decimal1.7976931348623157e+308
randomizePriceboolFalse
randomizeSizeboolFalse
volatilityfloat | Decimal1.7976931348623157e+308
volatilityTypeint2147483647
deltaNeutralOrderTypestr``
deltaNeutralAuxPricefloat | Decimal1.7976931348623157e+308
deltaNeutralConIdint0
deltaNeutralSettlingFirmstr``
deltaNeutralClearingAccountstr``
deltaNeutralClearingIntentstr``
deltaNeutralOpenClosestr``
deltaNeutralShortSaleboolFalse
deltaNeutralShortSaleSlotint0
deltaNeutralDesignatedLocationstr``
continuousUpdateboolFalse
referencePriceTypeint2147483647
basisPointsfloat | Decimal1.7976931348623157e+308
basisPointsTypeint2147483647
scaleInitLevelSizeint2147483647
scaleSubsLevelSizeint2147483647
scalePriceIncrementfloat | Decimal1.7976931348623157e+308
scalePriceAdjustValuefloat | Decimal1.7976931348623157e+308
scalePriceAdjustIntervalint2147483647
scaleProfitOffsetfloat | Decimal1.7976931348623157e+308
scaleAutoResetboolFalse
scaleInitPositionint2147483647
scaleInitFillQtyint2147483647
scaleRandomPercentboolFalse
scaleTablestr``
hedgeTypestr``
hedgeParamstr``
accountstr``
settlingFirmstr``
clearingAccountstr``
clearingIntentstr``
algoStrategystr``
algoParamslist[TagValue]factory: list
smartComboRoutingParamslist[TagValue]factory: list
algoIdstr``
whatIfboolFalse
notHeldboolFalse
solicitedboolFalse
modelCodestr``
orderComboLegslist[OrderComboLeg]factory: list
orderMiscOptionslist[TagValue]factory: list
referenceContractIdint0
peggedChangeAmountfloat0.0
isPeggedChangeAmountDecreaseboolFalse
referenceChangeAmountfloat0.0
referenceExchangeIdstr``
adjustedOrderTypestr``
triggerPricefloat | Decimal | None1.7976931348623157e+308
adjustedStopPricefloat | Decimal1.7976931348623157e+308
adjustedStopLimitPricefloat | Decimal1.7976931348623157e+308
adjustedTrailingAmountfloat | Decimal1.7976931348623157e+308
adjustableTrailingUnitint0
lmtPriceOffsetfloat | Decimal1.7976931348623157e+308
conditionslist[OrderCondition]factory: list
conditionsCancelOrderboolFalse
conditionsIgnoreRthboolFalse
extOperatorstr``
softDollarTierSoftDollarTierfactory: SoftDollarTier
cashQtyfloat | Decimal1.7976931348623157e+308
mifid2DecisionMakerstr``
mifid2DecisionAlgostr``
mifid2ExecutionTraderstr``
mifid2ExecutionAlgostr``
dontUseAutoPriceForHedgeboolFalse
isOmsContainerboolFalse
discretionaryUpToLimitPriceboolFalse
autoCancelDatestr``
filledQuantityfloat | Decimal1.7976931348623157e+308
refFuturesConIdint0
autoCancelParentboolFalse
shareholderstr``
imbalanceOnlyboolFalse
routeMarketableToBboboolFalse
parentPermIdint0
usePriceMgmtAlgoboolFalse
durationint2147483647
postToAtsint2147483647
advancedErrorOverridestr``
manualOrderTimestr``
minTradeQtyint2147483647
minCompeteSizeint2147483647
competeAgainstBestOffsetfloat | Decimal1.7976931348623157e+308
midOffsetAtWholefloat | Decimal1.7976931348623157e+308
midOffsetAtHalffloat | Decimal1.7976931348623157e+308

dict

dict(obj) -> dict

Return dataclass values as dict. This is a non-recursive variant of dataclasses.asdict.

nonDefaults

nonDefaults(obj) -> dict[str, typing.Any]

For a dataclass instance get the fields that are different from the default values and return as dict.

tuple

tuple(obj) -> tuple[typing.Any, ...]

Return dataclass values as tuple. This is a non-recursive variant of dataclasses.astuple.

update

update(obj, *srcObjs, **kwargs) -> object

Update fields of the given dataclass object from zero or more dataclass source objects and/or from keyword arguments.

Order

Order(orderId: 'int' = 0, clientId: 'int' = 0, permId: 'int' = 0, action: 'str' = '', totalQuantity: 'float' = 0.0, orderType: 'str' = '', lmtPrice: 'float | Decimal | None' = 1.7976931348623157e+308, auxPrice: 'float | Decimal | None' = 1.7976931348623157e+308, tif: 'str' = '', activeStartTime: 'str' = '', activeStopTime: 'str' = '', ocaGroup: 'str' = '', ocaType: 'int' = 0, orderRef: 'str' = '', transmit: 'bool' = True, parentId: 'int' = 0, blockOrder: 'bool' = False, sweepToFill: 'bool' = False, displaySize: 'int' = 0, triggerMethod: 'int' = 0, outsideRth: 'bool' = False, hidden: 'bool' = False, goodAfterTime: 'str' = '', goodTillDate: 'str' = '', rule80A: 'str' = '', allOrNone: 'bool' = False, minQty: 'int' = 2147483647, percentOffset: 'float | Decimal' = 1.7976931348623157e+308, overridePercentageConstraints: 'bool' = False, trailStopPrice: 'float | Decimal' = 1.7976931348623157e+308, trailingPercent: 'float | Decimal' = 1.7976931348623157e+308, faGroup: 'str' = '', faProfile: 'str' = '', faMethod: 'str' = '', faPercentage: 'str' = '', designatedLocation: 'str' = '', openClose: 'str' = 'O', origin: 'int' = 0, shortSaleSlot: 'int' = 0, exemptCode: 'int' = -1, discretionaryAmt: 'float' = 0.0, eTradeOnly: 'bool' = False, firmQuoteOnly: 'bool' = False, nbboPriceCap: 'float | Decimal' = 1.7976931348623157e+308, optOutSmartRouting: 'bool' = False, auctionStrategy: 'int' = 0, startingPrice: 'float | Decimal' = 1.7976931348623157e+308, stockRefPrice: 'float | Decimal' = 1.7976931348623157e+308, delta: 'float | Decimal' = 1.7976931348623157e+308, stockRangeLower: 'float | Decimal' = 1.7976931348623157e+308, stockRangeUpper: 'float | Decimal' = 1.7976931348623157e+308, randomizePrice: 'bool' = False, randomizeSize: 'bool' = False, volatility: 'float | Decimal' = 1.7976931348623157e+308, volatilityType: 'int' = 2147483647, deltaNeutralOrderType: 'str' = '', deltaNeutralAuxPrice: 'float | Decimal' = 1.7976931348623157e+308, deltaNeutralConId: 'int' = 0, deltaNeutralSettlingFirm: 'str' = '', deltaNeutralClearingAccount: 'str' = '', deltaNeutralClearingIntent: 'str' = '', deltaNeutralOpenClose: 'str' = '', deltaNeutralShortSale: 'bool' = False, deltaNeutralShortSaleSlot: 'int' = 0, deltaNeutralDesignatedLocation: 'str' = '', continuousUpdate: 'bool' = False, referencePriceType: 'int' = 2147483647, basisPoints: 'float | Decimal' = 1.7976931348623157e+308, basisPointsType: 'int' = 2147483647, scaleInitLevelSize: 'int' = 2147483647, scaleSubsLevelSize: 'int' = 2147483647, scalePriceIncrement: 'float | Decimal' = 1.7976931348623157e+308, scalePriceAdjustValue: 'float | Decimal' = 1.7976931348623157e+308, scalePriceAdjustInterval: 'int' = 2147483647, scaleProfitOffset: 'float | Decimal' = 1.7976931348623157e+308, scaleAutoReset: 'bool' = False, scaleInitPosition: 'int' = 2147483647, scaleInitFillQty: 'int' = 2147483647, scaleRandomPercent: 'bool' = False, scaleTable: 'str' = '', hedgeType: 'str' = '', hedgeParam: 'str' = '', account: 'str' = '', settlingFirm: 'str' = '', clearingAccount: 'str' = '', clearingIntent: 'str' = '', algoStrategy: 'str' = '', algoParams: 'list[TagValue]' = <factory>, smartComboRoutingParams: 'list[TagValue]' = <factory>, algoId: 'str' = '', whatIf: 'bool' = False, notHeld: 'bool' = False, solicited: 'bool' = False, modelCode: 'str' = '', orderComboLegs: 'list[OrderComboLeg]' = <factory>, orderMiscOptions: 'list[TagValue]' = <factory>, referenceContractId: 'int' = 0, peggedChangeAmount: 'float' = 0.0, isPeggedChangeAmountDecrease: 'bool' = False, referenceChangeAmount: 'float' = 0.0, referenceExchangeId: 'str' = '', adjustedOrderType: 'str' = '', triggerPrice: 'float | Decimal | None' = 1.7976931348623157e+308, adjustedStopPrice: 'float | Decimal' = 1.7976931348623157e+308, adjustedStopLimitPrice: 'float | Decimal' = 1.7976931348623157e+308, adjustedTrailingAmount: 'float | Decimal' = 1.7976931348623157e+308, adjustableTrailingUnit: 'int' = 0, lmtPriceOffset: 'float | Decimal' = 1.7976931348623157e+308, conditions: 'list[OrderCondition]' = <factory>, conditionsCancelOrder: 'bool' = False, conditionsIgnoreRth: 'bool' = False, extOperator: 'str' = '', softDollarTier: 'SoftDollarTier' = <factory>, cashQty: 'float | Decimal' = 1.7976931348623157e+308, mifid2DecisionMaker: 'str' = '', mifid2DecisionAlgo: 'str' = '', mifid2ExecutionTrader: 'str' = '', mifid2ExecutionAlgo: 'str' = '', dontUseAutoPriceForHedge: 'bool' = False, isOmsContainer: 'bool' = False, discretionaryUpToLimitPrice: 'bool' = False, autoCancelDate: 'str' = '', filledQuantity: 'float | Decimal' = 1.7976931348623157e+308, refFuturesConId: 'int' = 0, autoCancelParent: 'bool' = False, shareholder: 'str' = '', imbalanceOnly: 'bool' = False, routeMarketableToBbo: 'bool' = False, parentPermId: 'int' = 0, usePriceMgmtAlgo: 'bool' = False, duration: 'int' = 2147483647, postToAts: 'int' = 2147483647, advancedErrorOverride: 'str' = '', manualOrderTime: 'str' = '', minTradeQty: 'int' = 2147483647, minCompeteSize: 'int' = 2147483647, competeAgainstBestOffset: 'float | Decimal' = 1.7976931348623157e+308, midOffsetAtWhole: 'float | Decimal' = 1.7976931348623157e+308, midOffsetAtHalf: 'float | Decimal' = 1.7976931348623157e+308) -> None

Order for trading contracts.

https://interactivebrokers.github.io/tws-api/available_orders.html

Fields

NameTypeDefault
orderIdint0
clientIdint0
permIdint0
actionstr``
totalQuantityfloat0.0
orderTypestr``
lmtPricefloat | Decimal | None1.7976931348623157e+308
auxPricefloat | Decimal | None1.7976931348623157e+308
tifstr``
activeStartTimestr``
activeStopTimestr``
ocaGroupstr``
ocaTypeint0
orderRefstr``
transmitboolTrue
parentIdint0
blockOrderboolFalse
sweepToFillboolFalse
displaySizeint0
triggerMethodint0
outsideRthboolFalse
hiddenboolFalse
goodAfterTimestr``
goodTillDatestr``
rule80Astr``
allOrNoneboolFalse
minQtyint2147483647
percentOffsetfloat | Decimal1.7976931348623157e+308
overridePercentageConstraintsboolFalse
trailStopPricefloat | Decimal1.7976931348623157e+308
trailingPercentfloat | Decimal1.7976931348623157e+308
faGroupstr``
faProfilestr``
faMethodstr``
faPercentagestr``
designatedLocationstr``
openClosestrO
originint0
shortSaleSlotint0
exemptCodeint-1
discretionaryAmtfloat0.0
eTradeOnlyboolFalse
firmQuoteOnlyboolFalse
nbboPriceCapfloat | Decimal1.7976931348623157e+308
optOutSmartRoutingboolFalse
auctionStrategyint0
startingPricefloat | Decimal1.7976931348623157e+308
stockRefPricefloat | Decimal1.7976931348623157e+308
deltafloat | Decimal1.7976931348623157e+308
stockRangeLowerfloat | Decimal1.7976931348623157e+308
stockRangeUpperfloat | Decimal1.7976931348623157e+308
randomizePriceboolFalse
randomizeSizeboolFalse
volatilityfloat | Decimal1.7976931348623157e+308
volatilityTypeint2147483647
deltaNeutralOrderTypestr``
deltaNeutralAuxPricefloat | Decimal1.7976931348623157e+308
deltaNeutralConIdint0
deltaNeutralSettlingFirmstr``
deltaNeutralClearingAccountstr``
deltaNeutralClearingIntentstr``
deltaNeutralOpenClosestr``
deltaNeutralShortSaleboolFalse
deltaNeutralShortSaleSlotint0
deltaNeutralDesignatedLocationstr``
continuousUpdateboolFalse
referencePriceTypeint2147483647
basisPointsfloat | Decimal1.7976931348623157e+308
basisPointsTypeint2147483647
scaleInitLevelSizeint2147483647
scaleSubsLevelSizeint2147483647
scalePriceIncrementfloat | Decimal1.7976931348623157e+308
scalePriceAdjustValuefloat | Decimal1.7976931348623157e+308
scalePriceAdjustIntervalint2147483647
scaleProfitOffsetfloat | Decimal1.7976931348623157e+308
scaleAutoResetboolFalse
scaleInitPositionint2147483647
scaleInitFillQtyint2147483647
scaleRandomPercentboolFalse
scaleTablestr``
hedgeTypestr``
hedgeParamstr``
accountstr``
settlingFirmstr``
clearingAccountstr``
clearingIntentstr``
algoStrategystr``
algoParamslist[TagValue]factory: list
smartComboRoutingParamslist[TagValue]factory: list
algoIdstr``
whatIfboolFalse
notHeldboolFalse
solicitedboolFalse
modelCodestr``
orderComboLegslist[OrderComboLeg]factory: list
orderMiscOptionslist[TagValue]factory: list
referenceContractIdint0
peggedChangeAmountfloat0.0
isPeggedChangeAmountDecreaseboolFalse
referenceChangeAmountfloat0.0
referenceExchangeIdstr``
adjustedOrderTypestr``
triggerPricefloat | Decimal | None1.7976931348623157e+308
adjustedStopPricefloat | Decimal1.7976931348623157e+308
adjustedStopLimitPricefloat | Decimal1.7976931348623157e+308
adjustedTrailingAmountfloat | Decimal1.7976931348623157e+308
adjustableTrailingUnitint0
lmtPriceOffsetfloat | Decimal1.7976931348623157e+308
conditionslist[OrderCondition]factory: list
conditionsCancelOrderboolFalse
conditionsIgnoreRthboolFalse
extOperatorstr``
softDollarTierSoftDollarTierfactory: SoftDollarTier
cashQtyfloat | Decimal1.7976931348623157e+308
mifid2DecisionMakerstr``
mifid2DecisionAlgostr``
mifid2ExecutionTraderstr``
mifid2ExecutionAlgostr``
dontUseAutoPriceForHedgeboolFalse
isOmsContainerboolFalse
discretionaryUpToLimitPriceboolFalse
autoCancelDatestr``
filledQuantityfloat | Decimal1.7976931348623157e+308
refFuturesConIdint0
autoCancelParentboolFalse
shareholderstr``
imbalanceOnlyboolFalse
routeMarketableToBboboolFalse
parentPermIdint0
usePriceMgmtAlgoboolFalse
durationint2147483647
postToAtsint2147483647
advancedErrorOverridestr``
manualOrderTimestr``
minTradeQtyint2147483647
minCompeteSizeint2147483647
competeAgainstBestOffsetfloat | Decimal1.7976931348623157e+308
midOffsetAtWholefloat | Decimal1.7976931348623157e+308
midOffsetAtHalffloat | Decimal1.7976931348623157e+308

dict

dict(obj) -> dict

Return dataclass values as dict. This is a non-recursive variant of dataclasses.asdict.

nonDefaults

nonDefaults(obj) -> dict[str, typing.Any]

For a dataclass instance get the fields that are different from the default values and return as dict.

tuple

tuple(obj) -> tuple[typing.Any, ...]

Return dataclass values as tuple. This is a non-recursive variant of dataclasses.astuple.

update

update(obj, *srcObjs, **kwargs) -> object

Update fields of the given dataclass object from zero or more dataclass source objects and/or from keyword arguments.

OrderComboLeg

OrderComboLeg(price: 'float | Decimal' = 1.7976931348623157e+308) -> None

OrderComboLeg(price: 'float | Decimal' = 1.7976931348623157e+308)

Fields

NameTypeDefault
pricefloat | Decimal1.7976931348623157e+308

dict

dict(obj) -> dict

Return dataclass values as dict. This is a non-recursive variant of dataclasses.asdict.

nonDefaults

nonDefaults(obj) -> dict[str, typing.Any]

For a dataclass instance get the fields that are different from the default values and return as dict.

tuple

tuple(obj) -> tuple[typing.Any, ...]

Return dataclass values as tuple. This is a non-recursive variant of dataclasses.astuple.

update

update(obj, *srcObjs, **kwargs) -> object

Update fields of the given dataclass object from zero or more dataclass source objects and/or from keyword arguments.

OrderCondition

OrderCondition() -> None

OrderCondition()

Fields

NameTypeDefault

And

And(self)

No library docstring is provided; consult the signature, type fields, and operational guides.

Or

Or(self)

No library docstring is provided; consult the signature, type fields, and operational guides.

createClass

createClass(condType)

No library docstring is provided; consult the signature, type fields, and operational guides.

dict

dict(obj) -> dict

Return dataclass values as dict. This is a non-recursive variant of dataclasses.asdict.

nonDefaults

nonDefaults(obj) -> dict[str, typing.Any]

For a dataclass instance get the fields that are different from the default values and return as dict.

tuple

tuple(obj) -> tuple[typing.Any, ...]

Return dataclass values as tuple. This is a non-recursive variant of dataclasses.astuple.

update

update(obj, *srcObjs, **kwargs) -> object

Update fields of the given dataclass object from zero or more dataclass source objects and/or from keyword arguments.

OrderState

OrderState(status: 'str' = '', initMarginBefore: 'str' = '', maintMarginBefore: 'str' = '', equityWithLoanBefore: 'str' = '', initMarginChange: 'str' = '', maintMarginChange: 'str' = '', equityWithLoanChange: 'str' = '', initMarginAfter: 'str' = '', maintMarginAfter: 'str' = '', equityWithLoanAfter: 'str' = '', commission: 'float' = 1.7976931348623157e+308, minCommission: 'float' = 1.7976931348623157e+308, maxCommission: 'float' = 1.7976931348623157e+308, commissionCurrency: 'str' = '', warningText: 'str' = '', completedTime: 'str' = '', completedStatus: 'str' = '') -> None

OrderState(status: 'str' = '', initMarginBefore: 'str' = '', maintMarginBefore: 'str' = '', equityWithLoanBefore: 'str' = '', initMarginChange: 'str' = '', maintMarginChange: 'str' = '', equityWithLoanChange: 'str' = '', initMarginAfter: 'str' = '', maintMarginAfter: 'str' = '', equityWithLoanAfter: 'str' = '', commission: 'float' = 1.7976931348623157e+308, minCommission: 'float' = 1.7976931348623157e+308, maxCommission: 'float' = 1.7976931348623157e+308, commissionCurrency: 'str' = '', warningText: 'str' = '', completedTime: 'str' = '', completedStatus: 'str' = '')

Fields

NameTypeDefault
statusstr``
initMarginBeforestr``
maintMarginBeforestr``
equityWithLoanBeforestr``
initMarginChangestr``
maintMarginChangestr``
equityWithLoanChangestr``
initMarginAfterstr``
maintMarginAfterstr``
equityWithLoanAfterstr``
commissionfloat1.7976931348623157e+308
minCommissionfloat1.7976931348623157e+308
maxCommissionfloat1.7976931348623157e+308
commissionCurrencystr``
warningTextstr``
completedTimestr``
completedStatusstr``

dict

dict(obj) -> dict

Return dataclass values as dict. This is a non-recursive variant of dataclasses.asdict.

formatted

formatted(self, digits: 'int' = 2)

Return a new OrderState with the current values as formatted strings.

nonDefaults

nonDefaults(obj) -> dict[str, typing.Any]

For a dataclass instance get the fields that are different from the default values and return as dict.

numeric

numeric(self, digits: 'int' = 2) -> 'OrderStateNumeric'

Return a new OrderState with the current values values to floats instead of strings as returned from IBKR directly.

transform

transform(self, transformer)

Convert the numeric values of this OrderState into a new OrderState transformed by 'using'

tuple

tuple(obj) -> tuple[typing.Any, ...]

Return dataclass values as tuple. This is a non-recursive variant of dataclasses.astuple.

update

update(obj, *srcObjs, **kwargs) -> object

Update fields of the given dataclass object from zero or more dataclass source objects and/or from keyword arguments.

OrderStateNumeric

OrderStateNumeric(status: 'str' = '', initMarginBefore: 'float' = nan, maintMarginBefore: 'float' = nan, equityWithLoanBefore: 'float' = nan, initMarginChange: 'float' = nan, maintMarginChange: 'float' = nan, equityWithLoanChange: 'float' = nan, initMarginAfter: 'float' = nan, maintMarginAfter: 'float' = nan, equityWithLoanAfter: 'float' = nan, commission: 'float' = 1.7976931348623157e+308, minCommission: 'float' = 1.7976931348623157e+308, maxCommission: 'float' = 1.7976931348623157e+308, commissionCurrency: 'str' = '', warningText: 'str' = '', completedTime: 'str' = '', completedStatus: 'str' = '') -> None

Just a type helper for mypy to check against if you convert OrderState to .numeric().

Usage:

state_numeric: OrderStateNumeric = state.numeric(digits=2)

Fields

NameTypeDefault
statusstr``
initMarginBeforefloatnan
maintMarginBeforefloatnan
equityWithLoanBeforefloatnan
initMarginChangefloatnan
maintMarginChangefloatnan
equityWithLoanChangefloatnan
initMarginAfterfloatnan
maintMarginAfterfloatnan
equityWithLoanAfterfloatnan
commissionfloat1.7976931348623157e+308
minCommissionfloat1.7976931348623157e+308
maxCommissionfloat1.7976931348623157e+308
commissionCurrencystr``
warningTextstr``
completedTimestr``
completedStatusstr``

dict

dict(obj) -> dict

Return dataclass values as dict. This is a non-recursive variant of dataclasses.asdict.

nonDefaults

nonDefaults(obj) -> dict[str, typing.Any]

For a dataclass instance get the fields that are different from the default values and return as dict.

tuple

tuple(obj) -> tuple[typing.Any, ...]

Return dataclass values as tuple. This is a non-recursive variant of dataclasses.astuple.

update

update(obj, *srcObjs, **kwargs) -> object

Update fields of the given dataclass object from zero or more dataclass source objects and/or from keyword arguments.

OrderStatus

OrderStatus(orderId: 'int' = 0, status: 'str' = '', filled: 'float' = 0.0, remaining: 'float' = 0.0, avgFillPrice: 'float' = 0.0, permId: 'int' = 0, parentId: 'int' = 0, lastFillPrice: 'float' = 0.0, clientId: 'int' = 0, whyHeld: 'str' = '', mktCapPrice: 'float' = 0.0) -> None

OrderStatus(orderId: 'int' = 0, status: 'str' = '', filled: 'float' = 0.0, remaining: 'float' = 0.0, avgFillPrice: 'float' = 0.0, permId: 'int' = 0, parentId: 'int' = 0, lastFillPrice: 'float' = 0.0, clientId: 'int' = 0, whyHeld: 'str' = '', mktCapPrice: 'float' = 0.0)

Fields

NameTypeDefault
orderIdint0
statusstr``
filledfloat0.0
remainingfloat0.0
avgFillPricefloat0.0
permIdint0
parentIdint0
lastFillPricefloat0.0
clientIdint0
whyHeldstr``
mktCapPricefloat0.0

Properties

total

Helper property to return the total size of this requested order.

dict

dict(obj) -> dict

Return dataclass values as dict. This is a non-recursive variant of dataclasses.asdict.

nonDefaults

nonDefaults(obj) -> dict[str, typing.Any]

For a dataclass instance get the fields that are different from the default values and return as dict.

tuple

tuple(obj) -> tuple[typing.Any, ...]

Return dataclass values as tuple. This is a non-recursive variant of dataclasses.astuple.

update

update(obj, *srcObjs, **kwargs) -> object

Update fields of the given dataclass object from zero or more dataclass source objects and/or from keyword arguments.

PercentChangeCondition

PercentChangeCondition(condType: 'int' = 7, conjunction: 'str' = 'a', isMore: 'bool' = True, changePercent: 'float' = 0.0, conId: 'int' = 0, exch: 'str' = '') -> None

PercentChangeCondition(condType: 'int' = 7, conjunction: 'str' = 'a', isMore: 'bool' = True, changePercent: 'float' = 0.0, conId: 'int' = 0, exch: 'str' = '')

Fields

NameTypeDefault
condTypeint7
conjunctionstra
isMoreboolTrue
changePercentfloat0.0
conIdint0
exchstr``

dict

dict(obj) -> dict

Return dataclass values as dict. This is a non-recursive variant of dataclasses.asdict.

nonDefaults

nonDefaults(obj) -> dict[str, typing.Any]

For a dataclass instance get the fields that are different from the default values and return as dict.

tuple

tuple(obj) -> tuple[typing.Any, ...]

Return dataclass values as tuple. This is a non-recursive variant of dataclasses.astuple.

update

update(obj, *srcObjs, **kwargs) -> object

Update fields of the given dataclass object from zero or more dataclass source objects and/or from keyword arguments.

PriceCondition

PriceCondition(condType: 'int' = 1, conjunction: 'str' = 'a', isMore: 'bool' = True, price: 'float' = 0.0, conId: 'int' = 0, exch: 'str' = '', triggerMethod: 'int' = 0) -> None

PriceCondition(condType: 'int' = 1, conjunction: 'str' = 'a', isMore: 'bool' = True, price: 'float' = 0.0, conId: 'int' = 0, exch: 'str' = '', triggerMethod: 'int' = 0)

Fields

NameTypeDefault
condTypeint1
conjunctionstra
isMoreboolTrue
pricefloat0.0
conIdint0
exchstr``
triggerMethodint0

dict

dict(obj) -> dict

Return dataclass values as dict. This is a non-recursive variant of dataclasses.asdict.

nonDefaults

nonDefaults(obj) -> dict[str, typing.Any]

For a dataclass instance get the fields that are different from the default values and return as dict.

tuple

tuple(obj) -> tuple[typing.Any, ...]

Return dataclass values as tuple. This is a non-recursive variant of dataclasses.astuple.

update

update(obj, *srcObjs, **kwargs) -> object

Update fields of the given dataclass object from zero or more dataclass source objects and/or from keyword arguments.

StopLimitOrder

StopLimitOrder(action: 'str', totalQuantity: 'float', lmtPrice: 'float', stopPrice: 'float', **kwargs)

Order for trading contracts.

https://interactivebrokers.github.io/tws-api/available_orders.html

Fields

NameTypeDefault
orderIdint0
clientIdint0
permIdint0
actionstr``
totalQuantityfloat0.0
orderTypestr``
lmtPricefloat | Decimal | None1.7976931348623157e+308
auxPricefloat | Decimal | None1.7976931348623157e+308
tifstr``
activeStartTimestr``
activeStopTimestr``
ocaGroupstr``
ocaTypeint0
orderRefstr``
transmitboolTrue
parentIdint0
blockOrderboolFalse
sweepToFillboolFalse
displaySizeint0
triggerMethodint0
outsideRthboolFalse
hiddenboolFalse
goodAfterTimestr``
goodTillDatestr``
rule80Astr``
allOrNoneboolFalse
minQtyint2147483647
percentOffsetfloat | Decimal1.7976931348623157e+308
overridePercentageConstraintsboolFalse
trailStopPricefloat | Decimal1.7976931348623157e+308
trailingPercentfloat | Decimal1.7976931348623157e+308
faGroupstr``
faProfilestr``
faMethodstr``
faPercentagestr``
designatedLocationstr``
openClosestrO
originint0
shortSaleSlotint0
exemptCodeint-1
discretionaryAmtfloat0.0
eTradeOnlyboolFalse
firmQuoteOnlyboolFalse
nbboPriceCapfloat | Decimal1.7976931348623157e+308
optOutSmartRoutingboolFalse
auctionStrategyint0
startingPricefloat | Decimal1.7976931348623157e+308
stockRefPricefloat | Decimal1.7976931348623157e+308
deltafloat | Decimal1.7976931348623157e+308
stockRangeLowerfloat | Decimal1.7976931348623157e+308
stockRangeUpperfloat | Decimal1.7976931348623157e+308
randomizePriceboolFalse
randomizeSizeboolFalse
volatilityfloat | Decimal1.7976931348623157e+308
volatilityTypeint2147483647
deltaNeutralOrderTypestr``
deltaNeutralAuxPricefloat | Decimal1.7976931348623157e+308
deltaNeutralConIdint0
deltaNeutralSettlingFirmstr``
deltaNeutralClearingAccountstr``
deltaNeutralClearingIntentstr``
deltaNeutralOpenClosestr``
deltaNeutralShortSaleboolFalse
deltaNeutralShortSaleSlotint0
deltaNeutralDesignatedLocationstr``
continuousUpdateboolFalse
referencePriceTypeint2147483647
basisPointsfloat | Decimal1.7976931348623157e+308
basisPointsTypeint2147483647
scaleInitLevelSizeint2147483647
scaleSubsLevelSizeint2147483647
scalePriceIncrementfloat | Decimal1.7976931348623157e+308
scalePriceAdjustValuefloat | Decimal1.7976931348623157e+308
scalePriceAdjustIntervalint2147483647
scaleProfitOffsetfloat | Decimal1.7976931348623157e+308
scaleAutoResetboolFalse
scaleInitPositionint2147483647
scaleInitFillQtyint2147483647
scaleRandomPercentboolFalse
scaleTablestr``
hedgeTypestr``
hedgeParamstr``
accountstr``
settlingFirmstr``
clearingAccountstr``
clearingIntentstr``
algoStrategystr``
algoParamslist[TagValue]factory: list
smartComboRoutingParamslist[TagValue]factory: list
algoIdstr``
whatIfboolFalse
notHeldboolFalse
solicitedboolFalse
modelCodestr``
orderComboLegslist[OrderComboLeg]factory: list
orderMiscOptionslist[TagValue]factory: list
referenceContractIdint0
peggedChangeAmountfloat0.0
isPeggedChangeAmountDecreaseboolFalse
referenceChangeAmountfloat0.0
referenceExchangeIdstr``
adjustedOrderTypestr``
triggerPricefloat | Decimal | None1.7976931348623157e+308
adjustedStopPricefloat | Decimal1.7976931348623157e+308
adjustedStopLimitPricefloat | Decimal1.7976931348623157e+308
adjustedTrailingAmountfloat | Decimal1.7976931348623157e+308
adjustableTrailingUnitint0
lmtPriceOffsetfloat | Decimal1.7976931348623157e+308
conditionslist[OrderCondition]factory: list
conditionsCancelOrderboolFalse
conditionsIgnoreRthboolFalse
extOperatorstr``
softDollarTierSoftDollarTierfactory: SoftDollarTier
cashQtyfloat | Decimal1.7976931348623157e+308
mifid2DecisionMakerstr``
mifid2DecisionAlgostr``
mifid2ExecutionTraderstr``
mifid2ExecutionAlgostr``
dontUseAutoPriceForHedgeboolFalse
isOmsContainerboolFalse
discretionaryUpToLimitPriceboolFalse
autoCancelDatestr``
filledQuantityfloat | Decimal1.7976931348623157e+308
refFuturesConIdint0
autoCancelParentboolFalse
shareholderstr``
imbalanceOnlyboolFalse
routeMarketableToBboboolFalse
parentPermIdint0
usePriceMgmtAlgoboolFalse
durationint2147483647
postToAtsint2147483647
advancedErrorOverridestr``
manualOrderTimestr``
minTradeQtyint2147483647
minCompeteSizeint2147483647
competeAgainstBestOffsetfloat | Decimal1.7976931348623157e+308
midOffsetAtWholefloat | Decimal1.7976931348623157e+308
midOffsetAtHalffloat | Decimal1.7976931348623157e+308

dict

dict(obj) -> dict

Return dataclass values as dict. This is a non-recursive variant of dataclasses.asdict.

nonDefaults

nonDefaults(obj) -> dict[str, typing.Any]

For a dataclass instance get the fields that are different from the default values and return as dict.

tuple

tuple(obj) -> tuple[typing.Any, ...]

Return dataclass values as tuple. This is a non-recursive variant of dataclasses.astuple.

update

update(obj, *srcObjs, **kwargs) -> object

Update fields of the given dataclass object from zero or more dataclass source objects and/or from keyword arguments.

StopOrder

StopOrder(action: 'str', totalQuantity: 'float', stopPrice: 'float', **kwargs)

Order for trading contracts.

https://interactivebrokers.github.io/tws-api/available_orders.html

Fields

NameTypeDefault
orderIdint0
clientIdint0
permIdint0
actionstr``
totalQuantityfloat0.0
orderTypestr``
lmtPricefloat | Decimal | None1.7976931348623157e+308
auxPricefloat | Decimal | None1.7976931348623157e+308
tifstr``
activeStartTimestr``
activeStopTimestr``
ocaGroupstr``
ocaTypeint0
orderRefstr``
transmitboolTrue
parentIdint0
blockOrderboolFalse
sweepToFillboolFalse
displaySizeint0
triggerMethodint0
outsideRthboolFalse
hiddenboolFalse
goodAfterTimestr``
goodTillDatestr``
rule80Astr``
allOrNoneboolFalse
minQtyint2147483647
percentOffsetfloat | Decimal1.7976931348623157e+308
overridePercentageConstraintsboolFalse
trailStopPricefloat | Decimal1.7976931348623157e+308
trailingPercentfloat | Decimal1.7976931348623157e+308
faGroupstr``
faProfilestr``
faMethodstr``
faPercentagestr``
designatedLocationstr``
openClosestrO
originint0
shortSaleSlotint0
exemptCodeint-1
discretionaryAmtfloat0.0
eTradeOnlyboolFalse
firmQuoteOnlyboolFalse
nbboPriceCapfloat | Decimal1.7976931348623157e+308
optOutSmartRoutingboolFalse
auctionStrategyint0
startingPricefloat | Decimal1.7976931348623157e+308
stockRefPricefloat | Decimal1.7976931348623157e+308
deltafloat | Decimal1.7976931348623157e+308
stockRangeLowerfloat | Decimal1.7976931348623157e+308
stockRangeUpperfloat | Decimal1.7976931348623157e+308
randomizePriceboolFalse
randomizeSizeboolFalse
volatilityfloat | Decimal1.7976931348623157e+308
volatilityTypeint2147483647
deltaNeutralOrderTypestr``
deltaNeutralAuxPricefloat | Decimal1.7976931348623157e+308
deltaNeutralConIdint0
deltaNeutralSettlingFirmstr``
deltaNeutralClearingAccountstr``
deltaNeutralClearingIntentstr``
deltaNeutralOpenClosestr``
deltaNeutralShortSaleboolFalse
deltaNeutralShortSaleSlotint0
deltaNeutralDesignatedLocationstr``
continuousUpdateboolFalse
referencePriceTypeint2147483647
basisPointsfloat | Decimal1.7976931348623157e+308
basisPointsTypeint2147483647
scaleInitLevelSizeint2147483647
scaleSubsLevelSizeint2147483647
scalePriceIncrementfloat | Decimal1.7976931348623157e+308
scalePriceAdjustValuefloat | Decimal1.7976931348623157e+308
scalePriceAdjustIntervalint2147483647
scaleProfitOffsetfloat | Decimal1.7976931348623157e+308
scaleAutoResetboolFalse
scaleInitPositionint2147483647
scaleInitFillQtyint2147483647
scaleRandomPercentboolFalse
scaleTablestr``
hedgeTypestr``
hedgeParamstr``
accountstr``
settlingFirmstr``
clearingAccountstr``
clearingIntentstr``
algoStrategystr``
algoParamslist[TagValue]factory: list
smartComboRoutingParamslist[TagValue]factory: list
algoIdstr``
whatIfboolFalse
notHeldboolFalse
solicitedboolFalse
modelCodestr``
orderComboLegslist[OrderComboLeg]factory: list
orderMiscOptionslist[TagValue]factory: list
referenceContractIdint0
peggedChangeAmountfloat0.0
isPeggedChangeAmountDecreaseboolFalse
referenceChangeAmountfloat0.0
referenceExchangeIdstr``
adjustedOrderTypestr``
triggerPricefloat | Decimal | None1.7976931348623157e+308
adjustedStopPricefloat | Decimal1.7976931348623157e+308
adjustedStopLimitPricefloat | Decimal1.7976931348623157e+308
adjustedTrailingAmountfloat | Decimal1.7976931348623157e+308
adjustableTrailingUnitint0
lmtPriceOffsetfloat | Decimal1.7976931348623157e+308
conditionslist[OrderCondition]factory: list
conditionsCancelOrderboolFalse
conditionsIgnoreRthboolFalse
extOperatorstr``
softDollarTierSoftDollarTierfactory: SoftDollarTier
cashQtyfloat | Decimal1.7976931348623157e+308
mifid2DecisionMakerstr``
mifid2DecisionAlgostr``
mifid2ExecutionTraderstr``
mifid2ExecutionAlgostr``
dontUseAutoPriceForHedgeboolFalse
isOmsContainerboolFalse
discretionaryUpToLimitPriceboolFalse
autoCancelDatestr``
filledQuantityfloat | Decimal1.7976931348623157e+308
refFuturesConIdint0
autoCancelParentboolFalse
shareholderstr``
imbalanceOnlyboolFalse
routeMarketableToBboboolFalse
parentPermIdint0
usePriceMgmtAlgoboolFalse
durationint2147483647
postToAtsint2147483647
advancedErrorOverridestr``
manualOrderTimestr``
minTradeQtyint2147483647
minCompeteSizeint2147483647
competeAgainstBestOffsetfloat | Decimal1.7976931348623157e+308
midOffsetAtWholefloat | Decimal1.7976931348623157e+308
midOffsetAtHalffloat | Decimal1.7976931348623157e+308

dict

dict(obj) -> dict

Return dataclass values as dict. This is a non-recursive variant of dataclasses.asdict.

nonDefaults

nonDefaults(obj) -> dict[str, typing.Any]

For a dataclass instance get the fields that are different from the default values and return as dict.

tuple

tuple(obj) -> tuple[typing.Any, ...]

Return dataclass values as tuple. This is a non-recursive variant of dataclasses.astuple.

update

update(obj, *srcObjs, **kwargs) -> object

Update fields of the given dataclass object from zero or more dataclass source objects and/or from keyword arguments.

TimeCondition

TimeCondition(condType: 'int' = 3, conjunction: 'str' = 'a', isMore: 'bool' = True, time: 'str' = '') -> None

TimeCondition(condType: 'int' = 3, conjunction: 'str' = 'a', isMore: 'bool' = True, time: 'str' = '')

Fields

NameTypeDefault
condTypeint3
conjunctionstra
isMoreboolTrue
timestr``

dict

dict(obj) -> dict

Return dataclass values as dict. This is a non-recursive variant of dataclasses.asdict.

nonDefaults

nonDefaults(obj) -> dict[str, typing.Any]

For a dataclass instance get the fields that are different from the default values and return as dict.

tuple

tuple(obj) -> tuple[typing.Any, ...]

Return dataclass values as tuple. This is a non-recursive variant of dataclasses.astuple.

update

update(obj, *srcObjs, **kwargs) -> object

Update fields of the given dataclass object from zero or more dataclass source objects and/or from keyword arguments.

Trade

Trade(contract: 'Contract' = <factory>, order: 'Order' = <factory>, orderStatus: 'OrderStatus' = <factory>, fills: 'list[Fill]' = <factory>, log: 'list[TradeLogEntry]' = <factory>, advancedError: 'str' = '') -> None

Trade keeps track of an order, its status and all its fills.

Events:

  • statusEvent (trade: .Trade)
  • modifyEvent (trade: .Trade)
  • fillEvent (trade: .Trade, fill: .Fill)
  • commissionReportEvent (trade: .Trade, fill: .Fill, commissionReport: .CommissionReport)
  • filledEvent (trade: .Trade)
  • cancelEvent (trade: .Trade)
  • cancelledEvent (trade: .Trade)

Fields

NameTypeDefault
contractContractfactory: Contract
orderOrderfactory: Order
orderStatusOrderStatusfactory: OrderStatus
fillslist[Fill]factory: list
loglist[TradeLogEntry]factory: list
advancedErrorstr``

dict

dict(obj) -> dict

Return dataclass values as dict. This is a non-recursive variant of dataclasses.asdict.

filled

filled(self) -> 'float'

Number of shares filled.

isActive

isActive(self) -> 'bool'

True if eligible for execution, false otherwise.

isDone

isDone(self) -> 'bool'

True if completely filled or cancelled, false otherwise.

isWaiting

isWaiting(self) -> 'bool'

True if sent to IBKR but not "Submitted" for live execution yet.

isWorking

isWorking(self) -> 'bool'

True if sent to IBKR but not "Submitted" for live execution yet.

nonDefaults

nonDefaults(obj) -> dict[str, typing.Any]

For a dataclass instance get the fields that are different from the default values and return as dict.

remaining

remaining(self) -> 'float'

Number of shares remaining to be filled.

tuple

tuple(obj) -> tuple[typing.Any, ...]

Return dataclass values as tuple. This is a non-recursive variant of dataclasses.astuple.

update

update(obj, *srcObjs, **kwargs) -> object

Update fields of the given dataclass object from zero or more dataclass source objects and/or from keyword arguments.

VolumeCondition

VolumeCondition(condType: 'int' = 6, conjunction: 'str' = 'a', isMore: 'bool' = True, volume: 'int' = 0, conId: 'int' = 0, exch: 'str' = '') -> None

VolumeCondition(condType: 'int' = 6, conjunction: 'str' = 'a', isMore: 'bool' = True, volume: 'int' = 0, conId: 'int' = 0, exch: 'str' = '')

Fields

NameTypeDefault
condTypeint6
conjunctionstra
isMoreboolTrue
volumeint0
conIdint0
exchstr``

dict

dict(obj) -> dict

Return dataclass values as dict. This is a non-recursive variant of dataclasses.asdict.

nonDefaults

nonDefaults(obj) -> dict[str, typing.Any]

For a dataclass instance get the fields that are different from the default values and return as dict.

tuple

tuple(obj) -> tuple[typing.Any, ...]

Return dataclass values as tuple. This is a non-recursive variant of dataclasses.astuple.

update

update(obj, *srcObjs, **kwargs) -> object

Update fields of the given dataclass object from zero or more dataclass source objects and/or from keyword arguments.