Beispiel #1
0
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")
Beispiel #2
0
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()
Beispiel #3
0
class TradeTransfer(Schema, TradeMixin):
    """ Wrapped in <TradeTransfers> """
    # Oddly, TradeTransfer uses YYYYMMDD format for origTradeDate
    # instead of ISO format like Trade
    origTradeDate = Date()
    brokerName = String()
    brokerAccount = String()
    awayBrokerCommission = Decimal()
    regulatoryFee = Decimal()
    direction = OneOf("To", "From")
    deliveredReceived = OneOf("Delivered", "Received")
    netTradeMoney = Decimal()
    netTradeMoneyInBase = Decimal()
    netTradePrice = Decimal()
Beispiel #4
0
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')
Beispiel #5
0
class Trade(Schema, TradeMixin):
    """ Wrapped in <Trades> """
    buySell = OneOf("BUY", "BUY (Ca.)", "SELL", "SELL (Ca.)")
    ibOrderID = String()
    ibExecID = 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")
    traderID = String()
    isAPIOrder = Boolean()
Beispiel #6
0
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()
Beispiel #7
0
class InterestAccrualsCurrency(Schema, AccountMixin):
    """ Wrapped in <InterestAccruals> """
    currency = OneOf(*CURRENCY_CODES)
    fromDate = Date()
    toDate = Date()
    startingAccrualBalance = Decimal()
    interestAccrued = Decimal()
    accrualReversal = Decimal()
    fxTranslation = Decimal()
    endingAccrualBalance = Decimal()
Beispiel #8
0
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()
Beispiel #9
0
class StatementOfFundsLine(Schema, AccountMixin, SecurityMixin):
    """ Wrapped in <StmtFunds> """
    currency = OneOf(*CURRENCY_CODES)
    reportDate = Date()
    date = Date()
    activityDescription = String()
    tradeID = String()
    debit = Decimal()
    credit = Decimal()
    amount = Decimal()
    balance = Decimal()
    buySell = String()
Beispiel #10
0
class SLBActivity(Schema, AccountMixin, CurrencyMixin, SecurityMixin):
    """ Wrapped in <SLBActivities> """
    date = Date()
    slbTransactionId = String()
    activityDescription = String()
    type = OneOf("DirectBorrow", "DirectLoan", "ManagedLoan")
    exchange = String()
    quantity = Decimal()
    feeRate = Decimal()
    collateralAmount = Decimal()
    markQuantity = Decimal()
    markPriorPrice = Decimal()
    markCurrentPrice = Decimal()
Beispiel #11
0
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()
Beispiel #12
0
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")
Beispiel #13
0
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")
Beispiel #14
0
class ChangeInPositionValue(Schema, AccountMixin):
    """ Wrapped in <ChangeInPositionValues> """
    currency = OneOf(*CURRENCY_CODES)
    assetCategory = String()
    priorPeriodValue = Decimal()
    transactions = Decimal()
    mtmPriorPeriodPositions = Decimal()
    mtmTransactions = Decimal()
    corporateActions = Decimal()
    other = Decimal()
    accountTransfers = Decimal()
    linkingAdjustments = Decimal()
    fxTranslationPnl = Decimal()
    futurePriceAdjustments = Decimal()
    settledCash = Decimal()
    endOfPeriodValue = Decimal()
Beispiel #15
0
class OptionEAE(Schema, AccountMixin, CurrencyMixin, SecurityMixin):
    """
    Option Exercise, Assignment, or Expiration

    Wrapped in (identically-named) <OptionEAE>
    """
    date = Date()
    transactionType = OneOf("Assignment", "Exercise", "Expiration", "Sell")
    quantity = Decimal()
    tradePrice = Decimal()
    markPrice = Decimal()
    proceeds = Decimal()
    commisionsAndTax = Decimal()
    costBasis = Decimal()
    realizedPnl = Decimal()
    fxPnl = Decimal()
    mtmPnl = Decimal()
    tradeID = String()
Beispiel #16
0
class ConversionRate(Schema):
    """ Wrapped in <ConversionRates> """
    reportDate = Date()
    fromCurrency = OneOf(*CURRENCY_CODES)
    toCurrency = OneOf(*CURRENCY_CODES)
    rate = Decimal()
Beispiel #17
0
class CurrencyMixin(object):
    currency = OneOf(*CURRENCY_CODES)
    fxRateToBase = Decimal()
Beispiel #18
0
class CashReportCurrency(Schema, AccountMixin):
    """ Wrapped in <CashReport> """
    currency = OneOf(*CURRENCY_CODES)
    fromDate = Date()
    toDate = Date()
    startingCash = Decimal()
    startingCashSec = Decimal()
    startingCashCom = Decimal()
    clientFees = Decimal()
    clientFeesSec = Decimal()
    clientFeesCom = Decimal()
    clientFeesMTD = Decimal()
    clientFeesYTD = Decimal()
    commissions = Decimal()
    commissionsSec = Decimal()
    commissionsCom = Decimal()
    commissionsMTD = Decimal()
    commissionsYTD = Decimal()
    billableCommissions = Decimal()
    billableCommissionsSec = Decimal()
    billableCommissionsCom = Decimal()
    billableCommissionsMTD = Decimal()
    billableCommissionsYTD = Decimal()
    depositWithdrawals = Decimal()
    depositWithdrawalsSec = Decimal()
    depositWithdrawalsCom = Decimal()
    depositWithdrawalsMTD = Decimal()
    depositWithdrawalsYTD = Decimal()
    deposits = Decimal()
    depositsSec = Decimal()
    depositsCom = Decimal()
    depositsMTD = Decimal()
    depositsYTD = Decimal()
    withdrawals = Decimal()
    withdrawalsSec = Decimal()
    withdrawalsCom = Decimal()
    withdrawalsMTD = Decimal()
    withdrawalsYTD = Decimal()
    accountTransfers = Decimal()
    accountTransfersSec = Decimal()
    accountTransfersCom = Decimal()
    accountTransfersMTD = Decimal()
    accountTransfersYTD = Decimal()
    linkingAdjustments = Decimal()
    linkingAdjustmentsSec = Decimal()
    linkingAdjustmentsCom = Decimal()
    internalTransfers = Decimal()
    internalTransfersSec = Decimal()
    internalTransfersCom = Decimal()
    internalTransfersMTD = Decimal()
    internalTransfersYTD = Decimal()
    dividends = Decimal()
    dividendsSec = Decimal()
    dividendsCom = Decimal()
    dividendsMTD = Decimal()
    dividendsYTD = Decimal()
    insuredDepositInterest = Decimal()
    insuredDepositInterestSec = Decimal()
    insuredDepositInterestCom = Decimal()
    insuredDepositInterestMTD = Decimal()
    insuredDepositInterestYTD = Decimal()
    brokerInterest = Decimal()
    brokerInterestSec = Decimal()
    brokerInterestCom = Decimal()
    brokerInterestMTD = Decimal()
    brokerInterestYTD = Decimal()
    bondInterest = Decimal()
    bondInterestSec = Decimal()
    bondInterestCom = Decimal()
    bondInterestMTD = Decimal()
    bondInterestYTD = Decimal()
    cashSettlingMtm = Decimal()
    cashSettlingMtmSec = Decimal()
    cashSettlingMtmCom = Decimal()
    cashSettlingMtmMTD = Decimal()
    cashSettlingMtmYTD = Decimal()
    realizedVm = Decimal()
    realizedVmSec = Decimal()
    realizedVmCom = Decimal()
    realizedVmMTD = Decimal()
    realizedVmYTD = Decimal()
    cfdCharges = Decimal()
    cfdChargesSec = Decimal()
    cfdChargesCom = Decimal()
    cfdChargesMTD = Decimal()
    cfdChargesYTD = Decimal()
    netTradesSales = Decimal()
    netTradesSalesSec = Decimal()
    netTradesSalesCom = Decimal()
    netTradesSalesMTD = Decimal()
    netTradesSalesYTD = Decimal()
    netTradesPurchases = Decimal()
    netTradesPurchasesSec = Decimal()
    netTradesPurchasesCom = Decimal()
    netTradesPurchasesMTD = Decimal()
    netTradesPurchasesYTD = Decimal()
    advisorFees = Decimal()
    advisorFeesSec = Decimal()
    advisorFeesCom = Decimal()
    advisorFeesMTD = Decimal()
    advisorFeesYTD = Decimal()
    feesReceivables = Decimal()
    feesReceivablesSec = Decimal()
    feesReceivablesCom = Decimal()
    feesReceivablesMTD = Decimal()
    feesReceivablesYTD = Decimal()
    paymentInLieu = Decimal()
    paymentInLieuSec = Decimal()
    paymentInLieuCom = Decimal()
    paymentInLieuMTD = Decimal()
    paymentInLieuYTD = Decimal()
    transactionTax = Decimal()
    transactionTaxSec = Decimal()
    transactionTaxCom = Decimal()
    transactionTaxMTD = Decimal()
    transactionTaxYTD = Decimal()
    taxReceivables = Decimal()
    taxReceivablesSec = Decimal()
    taxReceivablesCom = Decimal()
    taxReceivablesMTD = Decimal()
    taxReceivablesYTD = Decimal()
    withholdingTax = Decimal()
    withholdingTaxSec = Decimal()
    withholdingTaxCom = Decimal()
    withholdingTaxMTD = Decimal()
    withholdingTaxYTD = Decimal()
    withholding871m = Decimal()
    withholding871mSec = Decimal()
    withholding871mCom = Decimal()
    withholding871mMTD = Decimal()
    withholding871mYTD = Decimal()
    withholdingCollectedTax = Decimal()
    withholdingCollectedTaxSec = Decimal()
    withholdingCollectedTaxCom = Decimal()
    withholdingCollectedTaxMTD = Decimal()
    withholdingCollectedTaxYTD = Decimal()
    salesTax = Decimal()
    salesTaxSec = Decimal()
    salesTaxCom = Decimal()
    salesTaxMTD = Decimal()
    salesTaxYTD = Decimal()
    fxTranslationGainLoss = Decimal()
    fxTranslationGainLossSec = Decimal()
    fxTranslationGainLossCom = Decimal()
    otherFees = Decimal()
    otherFeesSec = Decimal()
    otherFeesCom = Decimal()
    otherFeesMTD = Decimal()
    otherFeesYTD = Decimal()
    other = Decimal()
    otherSec = Decimal()
    otherCom = Decimal()
    endingCash = Decimal()
    endingCashSec = Decimal()
    endingCashCom = Decimal()
    endingSettledCash = Decimal()
    endingSettledCashSec = Decimal()
    endingSettledCashCom = Decimal()