jamsix / ib-edavki

Skripta, ki prevede XML poročilo trgovalnih poslov v platformi InteractiveBrokers v XML format primeren za uvoz v obrazce Doh-KDVP, D-IFI, Doh-Div in Doh-Obr v eDavkih Finančne uprave.
MIT License
173 stars 57 forks source link

Crash with t-bills #120

Closed pronebird closed 4 months ago

pronebird commented 4 months ago

Well hello old friend...

unknown asset type: BILL

I knew this was coming. Now I have to dig around how to report profits from T-bills. Anyone is doing anything in this direction?

Let's dig into it, this is the output for connected trades that includes: entry trade, corporate action (maturity) and security info, holding till maturity so no closing trade that I can show but I assume it's not any different than a normal trade.

<Trade accountId="UXXXXXXX" acctAlias="" model="" currency="USD" fxRateToBase="1" assetCategory="BILL" symbol="912797FL6" description="B 11/24/23" conid="632985602" securityID="US912797FL60" securityIDType="ISIN" cusip="912797FL6" isin="US912797FL60" listingExchange="" underlyingConid="" underlyingSymbol="" underlyingSecurityID="" underlyingListingExchange="" issuer="" multiplier="1" strike="" expiry="" tradeID="145362313" putCall="" reportDate="20230824" principalAdjustFactor="" dateTime="20230824;142834" tradeDate="20230824" settleDateTarget="20230825" transactionType="ExchTrade" exchange="TRADEWEBG" quantity="18000" tradePrice="98.6583819" tradeMoney="17758.51" proceeds="-17758.51" taxes="0" ibCommission="-5" ibCommissionCurrency="USD" netCash="-17763.51" closePrice="98.643" openCloseIndicator="O" notes="" cost="17763.51" fifoPnlRealized="0" fxPnl="0" mtmPnl="-2.77" origTradePrice="0" origTradeDate="" origTradeID="" origOrderID="0" clearingFirmID="" transactionID="565197184" buySell="BUY" ibOrderID="119296099" ibExecID="0000f60a.64e7444f.01.01" brokerageOrderID="00440da5.00011238.64e6e038.0001" orderReference="" volatilityOrderLink="" exchOrderId="N/A" extExecID="N824BMOXTR168231" orderTime="20230824;142834" openDateTime="" holdingPeriodDateTime="" whenRealized="" whenReopened="" levelOfDetail="EXECUTION" changeInPrice="0" changeInQuantity="0" orderType="LMT" traderID="" isAPIOrder="N" accruedInt="0" serialNumber="" deliveryType="" commodityType="" fineness="0.0" weight="0.0" />

<CorporateAction accountId="UXXXXXXX" acctAlias="" model="" currency="USD" fxRateToBase="1" assetCategory="BILL" symbol="912797FL6" description="(US912797FL60) TBILL MATURITY (912797FL6, B 11/24/23, US912797FL60)" conid="632985602" securityID="US912797FL60" securityIDType="ISIN" cusip="912797FL6" isin="US912797FL60" listingExchange="" underlyingConid="" underlyingSymbol="" underlyingSecurityID="" underlyingListingExchange="" issuer="" multiplier="1" strike="" expiry="" putCall="" principalAdjustFactor="" reportDate="20231124" dateTime="20231123;202500" actionDescription="(US912797FL60) TBILL MATURITY (912797FL6, B 11/24/23, US912797FL60)" amount="-18000" proceeds="18000" value="0" quantity="-18000" fifoPnlRealized="236.49" mtmPnl="5.305" code="" type="TM" transactionID="622278323" levelOfDetail="DETAIL" serialNumber="" deliveryType="" commodityType="" fineness="0.0" weight="0.0" />

<SecurityInfo currency="USD" assetCategory="BILL" symbol="912797FL6" description="B 11/24/23" conid="632985602" securityID="US912797FL60" securityIDType="ISIN" cusip="912797FL6" isin="US912797FL60" listingExchange="" underlyingConid="" underlyingSymbol="" underlyingSecurityID="" underlyingListingExchange="" issuer="" multiplier="1" strike="" expiry="" putCall="" principalAdjustFactor="" maturity="20231124" issueDate="" underlyingCategory="" subCategory="" settlementPolicyMethod="" code="" serialNumber="" deliveryType="" commodityType="" fineness="0.0" weight="0.0" />
jamsix commented 4 months ago

Probably relevant debate in https://github.com/jamsix/ib-edavki/issues/98

ZigaSajovic commented 4 months ago

I think this can be closed, as the subject of the issue is the crash, which is fixed by https://github.com/jamsix/ib-edavki/pull/125.

pronebird commented 4 months ago

Closing in favor of #98 which is about adding support for bonds.