Comments (6)
For me it looks like IB reporting problem rather than ibflex issue. From what I see this '20200406;214347' value should be inside 'dateTime' field, not 'date'...
from ibflex.
Well, it's trying to convert a date/time into a date. Of course it's failing; the semicolon and everything after it isn't supposed to be there.
This means your data doesn't match the ibflex data model. What field is it, exactly, that has '20200406;214347' where my code is expecting a date type?
from ibflex.
I think it is in the TransactionTax.date
part.
<TransactionTax accountId="XXXXXXXX acctAlias="" model="" currency="HKD" fxRateToBase="0.12899" assetCategory="STK" symbol="2801" description="ISHARES CORE MSCI CH IND ETF" conid="47028221" securityID="HK2801040828" securityIDType="ISIN" cusip="" isin="HK2801040828" listingExchange="SEHK" underlyingConid="" underlyingSymbol="" underlyingSecurityID="" underlyingListingExchange="" issuer="" multiplier="1" strike="" expiry="" putCall="" principalAdjustFactor="" date="20200406;214347" taxDescription="SFC Transaction Levy" quantity="600" reportDate="20200407" taxAmount="-0.39771" tradeId="141292481" tradePrice="24.5500" source="TRADE" code="" levelOfDetail="SUMMARY" />
<TransactionTaxDetail accountId="XXXXXXXXX" acctAlias="" model="" currency="HKD" fxRateToBase="0.12899" assetCategory="STK" symbol="2801" description="ISHARES CORE MSCI CH IND ETF" conid="47028221" securityID="HK2801040828" securityIDType="ISIN" cusip="" isin="HK2801040828" listingExchange="SEHK" underlyingConid="" underlyingSymbol="" underlyingSecurityID="" underlyingListingExchange="" issuer="" multiplier="1" strike="" expiry="" putCall="" principalAdjustFactor="" date="20200406;214347" taxDescription="SFC Transaction Levy" quantity="600" reportDate="20200407" taxAmount="-0.39771" tradeId="141292481" tradePrice="24.5500" source="TRADE" code="" levelOfDetail="DETAIL" />
</TransactionTaxes>
The problem happened after I brought some shares in HK stock exchange. There is no problem in US stocks.
I have looked at the data model. The date in TransactionTax Class is datetime.date
. Not sure whether this is exchange specific.
from ibflex.
Do we have a reference for the TransactionTax element?
IB is not completely consistent in their reporting formats. ibflex.Types.StatementOfFundsLine.date
is also of type datetime.datetime
, despite the name.
IIRC, I allowed datetime.datetime
converters to also accept a 'naked' date without time... see lines 215-220 in ibflex.parser
.
Try changing the data type of ibflex.Types.TransactionTax.date
from Optional[datetime.date]
to Optional[datetime.datetime]
. Does that solve your problem?
from ibflex.
Solved by changing datetime.date
to datetime.datetime
.
But I also need to add a new class TransactionTaxDetail
which is the same as TransactionTax
from ibflex.
Please submit a PR once you've tested the changes. I don't have any data for TransactionTax etc. Thanks.
from ibflex.
Related Issues (20)
- 'Commission Adjustments' is not a valid CashAction
- `BadResponseError(response)` if flex query result is csv HOT 2
- Issues with parsing notes and serialNumber HOT 3
- FlexParserError: OpenPosition has no attribute 'serialNumber' HOT 1
- Struggling HOT 5
- ConnectionError when trying to fetch data from https://gdcdyn.interactivebrokers.com/ HOT 1
- Is it supported to specify custom start and end date to download flex query reports? HOT 1
- [feature request] Support CSV output format HOT 1
- Problem Parsing IBFlex statement HOT 2
- ibflex.parser.FlexParserError: CashReportCurrency has no attribute 'endingCashIBUKL' HOT 1
- Handling of unsupported types HOT 6
- Serial Number HOT 1
- Determine the period of the flex query HOT 1
- Reimbursement Enum HOT 1
- ibflex.parser.FlexParserError: OpenPosition has no attribute 'figi' HOT 2
- AttributeError: 'bytes' object has no attribute 'FlexStatements' HOT 2
- Update version in pypi HOT 7
- FIFOPerformanceSummaryUnderlying has no attribute 'subCategory' HOT 6
- Directly parse from client HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ibflex.