class AccountInformation(Schema): accountId = String() acctAlias = String() currency = OneOf(*CURRENCY_CODES) name = String() accountType = OneOf("Individual", "Institution Master", "Institution Client", "Advisor Master", "Advisor Master Consolidated", "Advisor Client", "Broker Master", "Broker Master Consolidated", "Broker Client", "Fund Advisor") customerType = OneOf("Individual", "Joint", "Trust", "IRA", "Corporate", "Partnership", "Limited Liability Corporation", "Unincorporated Business", "IRA Traditional Rollover", "IRA Traditional New", "IRA Traditional Inherited", "IRA Roth New", "IRA Roth Inherited", "IRA SEP New", "IRA SEP Inherited") accountCapabilities = List( valid=["Cash", "Margin", "Portfolio Margin", "IBPrime"]) tradingPermissions = List(valid=[ "Stocks", "Options", "Mutual Funds", "Futures", "Forex", "Bonds", "CFDs", "IBG Notes", "Warrants", "US Treasury Bills", "Futures Options", "SSF", "Stock Loan", "Stock Borrow" ]) dateOpened = Date() dateFunded = Date() dateClosed = Date() masterName = String() ibEntity = OneOf("IBLLC-US", "IB-UK", "IB-UKL", "IB-CAN", "IB-JP", "IB-IN")
class DividendAccrualMixin(AccountMixin, CurrencyMixin, SecurityMixin): exDate = Date() payDate = Date() quantity = Decimal() tax = Decimal() fee = Decimal() grossRate = Decimal() grossAmount = Decimal() netAmount = Decimal() code = List() fromAcct = String() toAcct = String()
class CashTransaction(Schema, AccountMixin, CurrencyMixin, SecurityMixin): """ Wrapped in <CashTransactions> """ # Despite the name, dateTime actually contains only the date. dateTime = Date() amount = Decimal() type = OneOf("Deposits/Withdrawals", "Broker Interest Paid", "Broker Interest Received", "Withholding Tax", "Bond Interest Received", "Bond Interest Paid", "Other Fees", "Dividends", "Payment In Lieu Of Dividends") tradeID = String() code = List() transactionID = String() reportDate = Date() clientReference = String()
class CorporateAction(Schema, AccountMixin, CurrencyMixin, SecurityMixin): """ Wrapped in <CorporateActions> """ reportDate = Date() dateTime = DateTime() amount = Decimal() proceeds = Decimal() value = Decimal() quantity = Decimal() fifoPnlRealized = Decimal() mtmPnl = Decimal() code = List() type = OneOf("BC", "BM", "CA", "CC", "CD", "CH", "CI", "CO", "CP", "CS", "CT", "DI", "DW", "ED", "FA", "FI", "FS", "GV", "HD", "HI", "IC", "OR", "PI", "PV", "RI", "RS", "SD", "SO", "SR", "TC", "TI", "TO")
class FxLot(Schema, AccountMixin): """ Wrapped in <FxLots> """ assetCategory = String() reportDate = Date() functionalCurrency = OneOf(*CURRENCY_CODES) fxCurrency = OneOf(*CURRENCY_CODES) quantity = Decimal() costPrice = Decimal() costBasis = Decimal() closePrice = Decimal() value = Decimal() unrealizedPL = Decimal() code = List() lotDescription = String() lotOpenDateTime = DateTime() levelOfDetail = OneOf('LOT', 'SUMMARY')
class MTMPerformanceSummaryUnderlying(Schema, AccountMixin, SecurityMixin): """ Wrapped in <MTMPerformanceSummaryInBase> """ listingExchange = String() underlyingSecurityID = String() underlyingListingExchange = String() reportDate = Date() prevCloseQuantity = Decimal() prevClosePrice = Decimal() closeQuantity = Decimal() closePrice = Decimal() transactionMtm = Decimal() priorOpenMtm = Decimal() commissions = Decimal() other = Decimal() total = Decimal() code = List()
class Transfer(Schema, AccountMixin, CurrencyMixin, SecurityMixin): """ Wrapped in <Transfers> """ date = Date() type = OneOf("INTERNAL", "ACATS") direction = OneOf("IN", "OUT") company = String() account = String() accountName = String() quantity = Decimal() transferPrice = Decimal() positionAmount = Decimal() positionAmountInBase = Decimal() pnlAmount = Decimal() pnlAmountInBase = Decimal() fxPnl = Decimal() cashTransfer = Decimal() code = List() clientReference = String()
class OpenPosition(Schema, AccountMixin, CurrencyMixin, SecurityMixin): """ Wrapped in <OpenPositions> """ reportDate = Date() position = Decimal() markPrice = Decimal() positionValue = Decimal() openPrice = Decimal() costBasisPrice = Decimal() costBasisMoney = Decimal() percentOfNAV = Decimal() fifoPnlUnrealized = Decimal() side = OneOf('Long', 'Short') levelOfDetail = OneOf('LOT', 'SUMMARY') openDateTime = DateTime() holdingPeriodDateTime = DateTime() code = List() originatingOrderID = String() originatingTransactionID = String() accruedInt = String()
class TradeConfirmation(Schema, TradeMixin): """ Wrapped in <TradeConfirms> """ buySell = OneOf("BUY", "BUY (Ca.)", "SELL", "SELL (Ca.)") levelOfDetail = OneOf("SYMBOL_SUMMARY", "ORDER", "EXECUTION") commissionCurrency = OneOf(*CURRENCY_CODES) price = Decimal() thirdPartyClearingCommission = Decimal() orderID = Decimal() allocatedTo = String() thirdPartyRegulatoryCommission = Decimal() dateTime = DateTime() brokerExecutionCommission = Decimal() thirdPartyExecutionCommission = Decimal() amount = Decimal() otherCommission = Decimal() commission = Decimal() brokerClearingCommission = Decimal() ibOrderID = String() ibExecID = String() execID = String() brokerageOrderID = String() orderReference = String() volatilityOrderLink = String() exchOrderId = String() extExecID = String() # Despite the name, orderTime actually contains both date & time data. orderTime = DateTime() changeInPrice = Decimal() changeInQuantity = Decimal() orderType = OneOf("LMT", "MKT", "MOC") traderID = String() isAPIOrder = Boolean() code = List() tax = Decimal() listingExchange = String() underlyingListingExchange = String() settleDate = String() underlyingSecurityID = String()
class TradeMixin(AccountMixin, CurrencyMixin, SecurityMixin): tradeID = String() reportDate = Date() tradeDate = Date() tradeTime = Time() settleDateTarget = Date() transactionType = OneOf("ExchTrade", "TradeCancel", "FracShare", "FracShareCancel", "TradeCorrect", "BookTrade", "DvpTrade") exchange = String() quantity = Decimal() tradePrice = Decimal() tradeMoney = Decimal() proceeds = Decimal() taxes = Decimal() ibCommission = Decimal() ibCommissionCurrency = OneOf(*CURRENCY_CODES) netCash = Decimal() closePrice = Decimal() openCloseIndicator = OneOf("O", "C", "C;O") notes = List(separator=';') cost = Decimal() fifoPnlRealized = Decimal() fxPnl = Decimal() mtmPnl = Decimal() origTradePrice = Decimal() origTradeDate = Date() origTradeID = String() origOrderID = String() clearingFirmID = String() transactionID = String() openDateTime = DateTime() holdingPeriodDateTime = DateTime() whenRealized = DateTime() whenReopened = DateTime() levelOfDetail = OneOf("EXECUTION", "ORDER", "CLOSED_LOT", "TRADE_TRANSFERS")
class SecurityInfo(Schema, SecurityMixin): """ Wrapped in <SecuritiesInfo> """ maturity = String() issueDate = Date() code = List() type = String()