You can view my entire project in my github repository:
Trading212DesktopApp
Description
This is my attempt to create a desktop application to see how my investments are doing. I started this project because I didnât like that whenever I logged in from the desktop the app on my phone would kick me out.
This is a more interactive version of Python Portfolio Tracker which can also be found in my github: Trading212Portfolio.
How it works
You provide the program with your orders csv (instructions on how to download the orders csv) and it gets the current stock prices, calculates your returns and shows everything clearly without having to log in to the Trading 212 website.
Image example of program output
When you hover over a slice of the donut chart it shows you the stock ticker, the current value of this investment and the percentage of your portfolio it occupies. Click on any any ticker in the legend under the chart to remove it or add it back in the chart.
7 Likes
This is really cool, thanks for sharing
3 Likes
Code doesnât run on my machine unfortunately but nice idea and I agree, the desktop/mobile app inability to be open at the same time is highly frustrating.
3 Likes
You need to follow the installation instructions to the letter. Thatâs because there is a folder called node_modules which is created by the command npx create-electron-app trading212_desktop_app
This folder contains the newest node modules (which arenât updated by me) and it isnât a good practice to include them when uploading the code. If that isnât the problem and you have all the neccessary dependencies then I donât know how to help you
Yeah I installed all the node modules. Iâll take a look again later with fresh eyes.
Nice idea though, well done.
2 Likes
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File â/Users/user/Desktop/trading212_desktop_app/src/python/stockAndCurrencyData.pyâ, line 147, in makeStats
si.get_live_price(stocks[i])
File â/usr/local/lib/python3.7/site-packages/yahoo_fin/stock_info.pyâ, line 566, in get_live_price
df = get_data(ticker, end_date = pd.Timestamp.today() + pd.DateOffset(10))
File â/usr/local/lib/python3.7/site-packages/yahoo_fin/stock_info.pyâ, line 90, in get_data
raise AssertionError(resp.json())
AssertionError: {âchartâ: {âresultâ: None, âerrorâ: {âcodeâ: âNot Foundâ, âdescriptionâ: âNo data found, symbol may be delistedâ}}}
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File ââ, line 11, in
dfFormattedPortfolio = stockAndCurrencyData.makeStats()
File â/Users/user/Desktop/trading212_desktop_app/src/python/stockAndCurrencyData.pyâ, line 157, in makeStats
symbol = data[âquotesâ][0][âsymbolâ]
IndexError: list index out of range
Here is the error Python gives me after I run
npm start
I get as far as here!
1 Like
Yes, I am sorry this is my fault. It appears my code didinât know what to do when all methods to get the stock ticker failed. I have made a fix which will prevent the program from crashing but wonât take into account the ticker that caused the crash. My guess is that you have a stock that isnât found in convetional stock exchanges, probably a penny stock. Do you mind sharing your stocks and their isin to see if that is indeed the problem? Also, try running the updated code again to see if the problem is indeed resolved
Thank you for bringing this to me
Yeah no problem, I shared the list of 138 stocks to you in a private message.