Feature/improve activities import for csv files of ibkr (#1824)
* Improve import for csv files by Interactive Brokers * Update changelog
This commit is contained in:
parent
b74a042da8
commit
732b14c6ab
@ -9,10 +9,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
### Changed
|
||||
|
||||
- Changed the `auth` endpoint of the login with _Security Token_ from `GET` to `POST`
|
||||
- Changed the `auth` endpoint of the _Internet Identity_ login provider from `GET` to `POST`
|
||||
- Improved the activities import for `csv` files exported by _Interactive Brokers_
|
||||
- Improved the content of the Frequently Asked Questions (FAQ) page
|
||||
- Improved the content of the pricing page
|
||||
- Changed the `auth` endpoint of the login with _Security Token_ from `GET` to `POST`
|
||||
- Changed the `auth` endpoint of the _Internet Identity_ login provider from `GET` to `POST`
|
||||
|
||||
## 1.250.0 - 2023-04-02
|
||||
|
||||
|
@ -15,14 +15,19 @@ import { catchError } from 'rxjs/operators';
|
||||
})
|
||||
export class ImportActivitiesService {
|
||||
private static ACCOUNT_KEYS = ['account', 'accountid'];
|
||||
private static CURRENCY_KEYS = ['ccy', 'currency'];
|
||||
private static CURRENCY_KEYS = ['ccy', 'currency', 'currencyprimary'];
|
||||
private static DATA_SOURCE_KEYS = ['datasource'];
|
||||
private static DATE_KEYS = ['date'];
|
||||
private static FEE_KEYS = ['commission', 'fee'];
|
||||
private static DATE_KEYS = ['date', 'tradedate'];
|
||||
private static FEE_KEYS = ['commission', 'fee', 'ibcommission'];
|
||||
private static QUANTITY_KEYS = ['qty', 'quantity', 'shares', 'units'];
|
||||
private static SYMBOL_KEYS = ['code', 'symbol', 'ticker'];
|
||||
private static TYPE_KEYS = ['action', 'type'];
|
||||
private static UNIT_PRICE_KEYS = ['price', 'unitprice', 'value'];
|
||||
private static TYPE_KEYS = ['action', 'buy/sell', 'type'];
|
||||
private static UNIT_PRICE_KEYS = [
|
||||
'price',
|
||||
'tradeprice',
|
||||
'unitprice',
|
||||
'value'
|
||||
];
|
||||
|
||||
public constructor(private http: HttpClient) {}
|
||||
|
||||
@ -218,6 +223,8 @@ export class ImportActivitiesService {
|
||||
date = parse(item[key], 'dd-MM-yyyy', new Date()).toISOString();
|
||||
} else if (isMatch(item[key], 'dd/MM/yyyy')) {
|
||||
date = parse(item[key], 'dd/MM/yyyy', new Date()).toISOString();
|
||||
} else if (isMatch(item[key], 'yyyyMMdd')) {
|
||||
date = parse(item[key], 'yyyyMMdd', new Date()).toISOString();
|
||||
} else {
|
||||
try {
|
||||
date = parseISO(item[key]).toISOString();
|
||||
@ -249,7 +256,7 @@ export class ImportActivitiesService {
|
||||
|
||||
for (const key of ImportActivitiesService.FEE_KEYS) {
|
||||
if (isFinite(item[key])) {
|
||||
return item[key];
|
||||
return Math.abs(item[key]);
|
||||
}
|
||||
}
|
||||
|
||||
|
2
test/import/ok-vti-buy-on-ibkr.csv
Normal file
2
test/import/ok-vti-buy-on-ibkr.csv
Normal file
@ -0,0 +1,2 @@
|
||||
"CurrencyPrimary","Symbol","DateTime","TradeDate","TransactionType","Quantity","TradePrice","Buy/Sell","ClientAccountID","AccountAlias","Model","FXRateToBase","AssetClass","SubCategory","Description","Conid","SecurityID","SecurityIDType","CUSIP","ISIN","ListingExchange","UnderlyingConid","UnderlyingSymbol","UnderlyingSecurityID","UnderlyingListingExchange","Issuer","Multiplier","Strike","TradeID","Expiry","RelatedTradeID","Put/Call","ReportDate","PrincipalAdjustFactor","SettleDateTarget","Exchange","TradeMoney","Proceeds","Taxes","IBCommission","IBCommissionCurrency","NetCash","ClosePrice","Open/CloseIndicator","Notes/Codes","CostBasis","FifoPnlRealized","FxPnl","MtmPnl","OrigTradePrice","OrigTradeDate","OrigTradeID","OrigOrderID","OrigTransactionID","ClearingFirmID","IBOrderID","TransactionID","IBExecID","RelatedTransactionID","BrokerageOrderID","OrderReference","VolatilityOrderLink","ExchOrderID","ExtExecID","OrderTime","OpenDateTime","HoldingPeriodDateTime","WhenRealized","WhenReopened","LevelOfDetail","ChangeInPrice","ChangeInQuantity","OrderType","TraderID","IsAPIOrder","AccruedInterest","SerialNumber","DeliveryType","CommodityType","Fineness","Weight"
|
||||
"USD","VTI","20230403;095853","20230403","ExchTrade","17","204.3473","BUY","U1234567","","","0.9127","STK","ETF","VANGUARD TOTAL STOCK MKT ETF","12340041","US9229087690","ISIN","922908769","US9229087690","ARCA","","","","","","1","","1234567890","","","","20230403","","20230405","DARK","3473.9041","-3473.9041","0","-1","USD","-3474.9041","204.64","O","","3474.9041","0","0","4.9759","0","","","0","0","","1234567890","1234567890","0000a123.123abcde.01.01","","00cb7412.0001b9c2.642a55d0.0001","","","N/A","2304030003120950675","20230403;095853","","","","","EXECUTION","0","0","LMT","","N","0","","","","0.0","0.0 ()"
|
|
Loading…
x
Reference in New Issue
Block a user