erdewit / ib_insync

Python sync/async framework for Interactive Brokers API
BSD 2-Clause "Simplified" License
2.8k stars 744 forks source link

incorrect tags in account summary: 'reqTEquity' & 'reqTMargin' should be 'regTEquity' & 'regTMargin' #589

Closed bayareacoder closed 1 year ago

bayareacoder commented 1 year ago

in ib.py:

def reqAccountSummaryAsync(self) -> Awaitable[None]: reqId = self.client.getReqId() future = self.wrapper.startReq(reqId) tags = ( 'AccountType,NetLiquidation,TotalCashValue,SettledCash,' 'AccruedCash,BuyingPower,EquityWithLoanValue,' 'PreviousEquityWithLoanValue,GrossPositionValue,ReqTEquity,' 'ReqTMargin,SMA,InitMarginReq,MaintMarginReq,AvailableFunds,' 'ExcessLiquidity,Cushion,FullInitMarginReq,FullMaintMarginReq,' 'FullAvailableFunds,FullExcessLiquidity,LookAheadNextChange,' 'LookAheadInitMarginReq,LookAheadMaintMarginReq,' 'LookAheadAvailableFunds,LookAheadExcessLiquidity,' 'HighestSeverity,DayTradesRemaining,DayTradesRemainingT+1,' 'DayTradesRemainingT+2,DayTradesRemainingT+3,' 'DayTradesRemainingT+4,Leverage,$LEDGER:ALL') self.client.reqAccountSummary(reqId, 'All', tags) return future No 'ReqTMargin' and 'ReqTEquity' account summary tags exist and no events occur on that.

It is actually wrong in the IBKR doc at https://interactivebrokers.github.io/tws-api/classIBApi_1_1AccountSummaryTags.html which is probably why it's in the code. It comes from 'regulation T'

Tags should be: 'regTEquity' and 'regTMargin'

I have tested this to work then as expected.

erdewit commented 1 year ago

Thanks, this is fixed now.