Closed zynmuse closed 6 months ago
Further observation. Could be because my P/L is negative?
Commenting out lines dashboard.py lines 106,107 and 108 and it sort of works.
Observation. Doesn't treat UK stocks the same as US stocks?
Thanks for the comments! The plot should work for negative P/L now (doesn't display it).
The API returns the ticker symbols in a somewhat weird way. I can only resolve the issue of the different treatment for UK stocks if I buy one myself too see how the API returns the ticker. I will do this next week when the markets are open!
Thanks for getting back to me. I am happy to test the UK stocks if you suggest a fix. Kind Regards John
I'm running this on Manjaru Linux. It appeared to install correctly. I got some of the data at the top of the browser screen - account value, portfolio value etc... But followed by some errors - see below. Any ideas? John
ValueError: Wedge sizes 'x' must be non negative values Traceback:
File "/home/john/.local/lib/python3.10/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 535, in _run_script exec(code, module.dict) File "/JohnsMounts/PDevelopmentB/Trading212API/trading212-portfolio-dashboard/src/dashboard.py", line 107, in
all_pie = pplts.fig_all_pie(positions_df, balances['cash'], balances['current_p_and_l'])
File "/JohnsMounts/PDevelopmentB/Trading212API/trading212-portfolio-dashboard/src/plots/position_plots.py", line 52, in fig_allpie
, _, autotexts = plt.pie(final_df['amount_invested'],
File "/home/john/.local/lib/python3.10/site-packages/matplotlib/pyplot.py", line 3543, in pie
return gca().pie(
File "/home/john/.local/lib/python3.10/site-packages/matplotlib/init.py", line 1465, in inner
return func(ax, *map(sanitize_sequence, args), **kwargs)
File "/home/john/.local/lib/python3.10/site-packages/matplotlib/axes/_axes.py", line 3224, in pie
raise ValueError("Wedge sizes 'x' must be non negative values")