Closed Mappazzone closed 3 years ago
Could be, depends on where you got the CSV from. Did you follow the instructions on the readme to obtain it? There are multiple different CSVs tastyworks will generate.
If so, sounds like something that needs to be addressed. Looks like one of the quantity fields is being typed wrong. Any chance you could figure out what line it is? If you're willing to share your CSV (you can anonymize it if you want) I can solve this quicker.
I found the problem. This is already fixed on the main branch. I just published a new version for you. Can you verify it works with the newest version?
pip install --upgrade tastyworks-cli
Thanks for the fix, that error is solved! But when I run it again it finds another conversion error .
/usr/local/lib/python3.9/site-packages/src/plot/commands.py", line 22, in plot pf = Portfolio(df, net_liq=netliq) File "/usr/local/lib/python3.9/site-packages/src/plot/csv.py", line 55, in __init__ self._calculate() File "/usr/local/lib/python3.9/site-packages/src/plot/csv.py", line 185, in _calculate t = Trade(trade) File "/usr/local/lib/python3.9/site-packages/src/plot/csv.py", line 28, in __init__ self.quantity = float(trade['Quantity']) ValueError: could not convert string to float: '1,000'
I couldn't find something that in the "quantity" column had some strange numbers, I got some 0 but in the "Regulatory fee adjustment" type.
I don't know how to debug it and put a breakpoint on it, but could you add some error message that says at what row of the csv the error occurs? Maybe that could help.
Thanks anyway!
Ah good catch! Glad the other error is fixed. I had never found this because I don't think I've ever traded that large of a quantity of something. Will address this when I can.
If this didn't fix the issue, please reopen. Hope you don't run into anything else and thanks for filing the bugs!
Hi, I'm getting this error when launching tw plot on my csv file.
Any idea if it's my problem?