Skip to content

Commit

Permalink
Interactive Brokers statement import: import of T-Bills securities.
Browse files Browse the repository at this point in the history
  • Loading branch information
titov-vv committed Apr 8, 2024
1 parent b608735 commit 8c55f46
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions jal/data_import/broker_statements/ibkr.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class IBKR_AssetType:
'ETF': FOF.ASSET_ETF,
'ADR': FOF.ASSET_ADR,
'BOND': FOF.ASSET_BOND,
'BILL': FOF.ASSET_BOND,
'OPT': FOF.ASSET_OPTION,
'FUT': FOF.ASSET_FUTURES,
'WAR': FOF.ASSET_WARRANT,
Expand Down
9 changes: 6 additions & 3 deletions tests/test_data/ibkr_corp_actions.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,19 @@
"assets": [
{"id": 1, "type": "money", "name": ""},
{"id": 2, "type": "stock", "name": "TWO HANDS CORP", "isin": "US90187E5015"},
{"id": 3, "type": "stock", "name": "TWO HANDS CORP", "isin": "US90187E4026"}
{"id": 3, "type": "stock", "name": "TWO HANDS CORP", "isin": "US90187E4026"},
{"id": 4, "type": "bond", "name": "B 01/25/24", "isin": "US912796ZY88"}
],
"symbols": [
{"id": 1, "asset": 1, "symbol": "USD"},
{"id": 2, "asset": 2, "symbol": "TWOHD", "currency": 1, "note": "PINK"},
{"id": 3, "asset": 3, "symbol": "TWOHD", "currency": 1, "note": "PINK"}
{"id": 3, "asset": 3, "symbol": "TWOHD", "currency": 1, "note": "PINK"},
{"id": 4, "asset": 4, "symbol": "912796ZY8", "currency": 1}
],
"assets_data": [
{"id": 1, "asset": 2, "reg_number": "90187E501"},
{"id": 2, "asset": 3, "reg_number": "90187E402"}
{"id": 2, "asset": 3, "reg_number": "90187E402"},
{"id": 3, "asset": 4, "expiry": 1706140800, "reg_number": "912796ZY8"}
],
"asset_payments": [],
"corporate_actions": [
Expand Down
2 changes: 2 additions & 0 deletions tests/test_data/ibkr_corp_actions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@
<SecuritiesInfo>
<SecurityInfo currency="USD" assetCategory="STK" symbol="TWOHD" description="TWO HANDS CORP" conid="657142858" securityID="US90187E5015" securityIDType="ISIN" cusip="90187E501" isin="US90187E5015" listingExchange="PINK" underlyingConid="" underlyingSymbol="" underlyingSecurityID="" underlyingListingExchange="" issuer="" multiplier="1" strike="" expiry="" putCall="" principalAdjustFactor="" maturity="" issueDate="" underlyingCategory="" subCategory="COMMON" settlementPolicyMethod="" code="" />
<SecurityInfo currency="USD" assetCategory="STK" symbol="TWOHD.OLD" description="TWO HANDS CORP" conid="558667700" securityID="US90187E4026" securityIDType="ISIN" cusip="90187E402" isin="US90187E4026" listingExchange="PINK" underlyingConid="" underlyingSymbol="" underlyingSecurityID="" underlyingListingExchange="" issuer="" multiplier="1" strike="" expiry="" putCall="" principalAdjustFactor="" maturity="" issueDate="" underlyingCategory="" subCategory="COMMON" settlementPolicyMethod="" code="" />
<SecurityInfo currency="USD" assetCategory="BILL" subCategory="" symbol="912796ZY8" description="B 01/25/24" conid="610571310" securityID="US912796ZY88" securityIDType="ISIN" cusip="912796ZY8" isin="US912796ZY88" figi="" listingExchange="" underlyingConid="" underlyingSymbol="" underlyingSecurityID="" underlyingListingExchange="" issuer="" issuerCountryCode="US" multiplier="1" strike="" expiry="" putCall="" principalAdjustFactor="" maturity="20240125" issueDate="" underlyingCategory="" settlementPolicyMethod="" code="" serialNumber="" deliveryType="" commodityType="" fineness="0.0" weight="0.0" />
</SecuritiesInfo>
<CorporateActions>
<!-- Split with ISIN change -->
<CorporateAction accountId="U7654321" acctAlias="" model="" currency="USD" fxRateToBase="1" assetCategory="STK" symbol="TWOHD" description="TWOH(US90187E4026) SPLIT 1 FOR 1000 (TWOHD, TWO HANDS CORP, US90187E5015)" conid="657142858" securityID="US90187E5015" securityIDType="ISIN" cusip="90187E501" isin="US90187E5015" listingExchange="PINK" underlyingConid="" underlyingSymbol="" underlyingSecurityID="" underlyingListingExchange="" issuer="" multiplier="1" strike="" expiry="" putCall="" principalAdjustFactor="" reportDate="20230929" dateTime="20230928;202500" actionDescription="TWOH(US90187E4026) SPLIT 1 FOR 1000 (TWOHD, TWO HANDS CORP, US90187E5015)" amount="0" proceeds="0" value="0" quantity="0.035" fifoPnlRealized="0" mtmPnl="0" code="" type="RS" transactionID="25164201871" levelOfDetail="DETAIL" />
<CorporateAction accountId="U7654321" acctAlias="" model="" currency="USD" fxRateToBase="1" assetCategory="STK" symbol="TWOHD.OLD" description="TWOH(US90187E4026) SPLIT 1 FOR 1000 (TWOHD.OLD, TWO HANDS CORP, US90187E4026)" conid="558667700" securityID="US90187E4026" securityIDType="ISIN" cusip="90187E402" isin="US90187E4026" listingExchange="PINK" underlyingConid="" underlyingSymbol="" underlyingSecurityID="" underlyingListingExchange="" issuer="" multiplier="1" strike="" expiry="" putCall="" principalAdjustFactor="" reportDate="20230929" dateTime="20230928;202500" actionDescription="TWOH(US90187E4026) SPLIT 1 FOR 1000 (TWOHD.OLD, TWO HANDS CORP, US90187E4026)" amount="0" proceeds="0" value="0" quantity="-35" fifoPnlRealized="0" mtmPnl="0" code="" type="RS" transactionID="25164201877" levelOfDetail="DETAIL" />
<!-- T-Bill maturity -->
</CorporateActions>
</FlexStatement>
</FlexStatements>
Expand Down

0 comments on commit 8c55f46

Please sign in to comment.