Skip to navigation

Account Summary

View as MarkdownOpen in Claude

Introduction

The initial invocation of reqAccountSummary will result in a list of all requested values being returned, and then every three minutes those values which have changed will be returned. The update frequency of 3 minutes is the same as the TWS Account Window and cannot be changed.


Requesting Account Summary

EClient.reqAccountSummary(reqId, group, tags)

Requests a specific account’s summary. This method will subscribe to the account summary as presented in the TWS’ Account Summary tab. Customers can specify the data received by using a specific tags value. See the Account Summary Tags section for available options.

Alternatively, many languages offer the import of AccountSummaryTags with a method to retrieve all tag values.

Only two active summary subscriptions are allowed at a time.
reqId
int

The unique request identifier.

group
string

Set to "All" to return account summary data for all accounts, or set to a specific Advisor Account Group name that has already been created in TWS Global Configuration.

tags
string

A comma separated list with the desired tags.


self.reqAccountSummary(9001, "All", AccountSummaryTags.AllTags)

Account Summary Tags

TagDescription
AccountTypeIdentifies the IB account structure
NetLiquidationThe basis for determining the price of the assets in your account. Total cash value + stock value + options value + bond value
TotalCashValueTotal cash balance recognized at the time of trade + futures PNL
SettledCashCash recognized at the time of settlement – purchases at the time of trade – commissions – taxes – fees
AccruedCashTotal accrued cash value of stock, commodities and securities
BuyingPowerBuying power serves as a measurement of the dollar value of securities that one may purchase in a securities account without depositing additional funds
EquityWithLoanValueForms the basis for determining whether a client has the necessary assets to either initiate or maintain security positions. Cash + stocks + bonds + mutual funds
PreviousEquityWithLoanValueMarginable Equity with Loan value as of 16:00 ET the previous day
GrossPositionValueThe sum of the absolute value of all stock and equity option positions
RegTEquityRegulation T equity for universal account
RegTMarginRegulation T margin for universal account
SMASpecial Memorandum Account: Line of credit created when the market value of securities in a Regulation T account increase in value
InitMarginReqInitial Margin requirement of whole portfolio
MaintMarginReqMaintenance Margin requirement of whole portfolio
AvailableFundsThis value tells what you have available for trading
ExcessLiquidityThis value shows your margin cushion, before liquidation
CushionExcess liquidity as a percentage of net liquidation value
FullInitMarginReqInitial Margin of whole portfolio with no discounts or intraday credits
FullMaintMarginReqMaintenance Margin of whole portfolio with no discounts or intraday credits
FullAvailableFundsAvailable funds of whole portfolio with no discounts or intraday credits
FullExcessLiquidityExcess liquidity of whole portfolio with no discounts or intraday credits
LookAheadNextChangeTime when look-ahead values take effect
LookAheadInitMarginReqInitial Margin requirement of whole portfolio as of next period’s margin change
LookAheadMaintMarginReqMaintenance Margin requirement of whole portfolio as of next period’s margin change
LookAheadAvailableFundsThis value reflects your available funds at the next margin change
LookAheadExcessLiquidityThis value reflects your excess liquidity at the next margin change
HighestSeverityA measure of how close the account is to liquidation
DayTradesRemainingThe Number of Open/Close trades a user could put on before Pattern Day Trading is detected. A value of “-1” means that the user can put on unlimited day trades.
LeverageGrossPositionValue / NetLiquidation
$LEDGERSingle flag to relay all cash balance tags*, only in base currency.
$LEDGER:CURRENCYSingle flag to relay all cash balance tags*, only in the specified currency.
$LEDGER:ALLSingle flag to relay all cash balance tags* in all currencies.

Receiving Account Summary

EWrapper.accountSummary

EWrapper.accountSummary(reqId, account, tag, value, currency)

Receives the account information. This method will receive the account information just as it appears in the TWS’ Account Summary Window.

reqId
int

The request’s unique identifier.

account
string

The account id.

tag
string

The account’s attribute being received.

value
string

The account’s attribute’s value.

currency
string

The currency on which the value is expressed.


def accountSummary(self, reqId: int, account: str, tag: str, value: str,currency: str):
print("AccountSummary. ReqId:", reqId, "Account:", account,"Tag: ", tag, "Value:", value, "Currency:", currency)

EWrapper.accountSummaryEnd

EWrapper.accountSummaryEnd(reqId)

Notifies when all the accounts’ information has been received.

reqId
string

The request’s identifier.


def accountSummaryEnd(self, reqId: int):
print("AccountSummaryEnd. ReqId:", reqId)

Cancel Account Summary

EClient.cancelAccountSummary(reqId)

Once the subscription to account summary is no longer needed, it can be cancelled via the EClient.cancelAccountSummary method.

reqId
int

The identifier of the previously performed account request.


self.cancelAccountSummary(9001)