You are browsing as a guest. Sign up (or log in) to start making projects!

9h 59m 32s logged

MASSIVE CHANGES

Hours: 10

The list includes:
- User data pulled form database instead of fake values
- Live market overview
- Daily gainers and losers with live data
- Sparklines and growth charts for all stocks
- Watchlist dynamically rendered from user’s database
- Transactions rendered from database
- Portfolio progression chart created from users previous net worths

Disclaimer

These changes were meant to be distributed among two journals. But due to my absolutely amazing memory i forgot and created all these functions
Hence this devlong is gonna be a long one

Changes in depth

User data

  • Earlier, on logging in, the user visited a dashboard with palceholder name, portfolio, networth etc.
  • This has been updated via the dashboard_api function in views.py to dynamically fetch user data

Problems faced

  • Mismatch with the expected json data of the Backend meant that initially the data was not rendering properly, and just returning placeholder data

Current Bugs

  • The way the data is saved daily means that there is virtually zero change in the net worth of the indivisual, atleast as far as this section is concerned
    • This causes the change and change percent to always remain at 0

Market overview

  • Yahoo’s YFinance API endpoint has been used to get live market data of the S&P500, NASDAQ and Dow Jones ETFs.
  • This data is rendered through markets.py file inside services

Problems faced

  • Initially, I thought of using finnhub as the provider due to its generous free tier and live data.

    • This however did not work as the candles required to generate the sparkline of each graph were not included in the free tier of finnhub
  • Next, i consider Alpha Vantage as my data provider. This idea was quickly scrapped due to its sparing free tier of 25 requests/day which would be exhausted in mere minutes

    • I briefly considered a mix of Finnhub and Alpha Vantage to get the best of both worlds, but the lag between responses and the limit for alpha vantage were still limiting
  • So finally, i went with a mix of Finnhub and YFinance, and i thought it was the best combination. However, again, it lagged, it would not render properly. And besider, apart from the 15 mins delay, which, lets face it, is not game changing for a simulator, YFinance offered everything i needed, and also it had good documentation i could refer to

  • My final data feed comes from YFinance and yahooquery, which I am quite proud of

Current Bugs

  • Sometimes, there is still delay in the response, and im confused cause its very rare, and othertimes its not… Im still working on it

Trending

  • Trending API is still in progress, i havent been able to get it to work with the current data, but ill get it done by the next journal

Progression Chart

  • This is simply a chart that is dynamically created based on past portfolio worths of the user.
  • Not many problems were faced here, thank god. It was fairly strightforward

Market movers

  • The greatest gainers and losers, by day and percentage, are shown here. (Theyre the market movers after all 😅)
  • This part was a considerable pain to get to work properly, particularly when i was using Finnhub, becuase it was very hard to find the gainers and losers, atleast for me.

Problems I faced

  • Spellings mismatch with exact wording of the data the stock returned

  • Issues with perfectly parsing it in the exact format required by JavaScript [What can i say, my typing is just that good]

  • It was so bad that i did not even push my changes to github for this part

  • YFinance for me somehow made this quite simpler and i was able to get it running.

  • Thankfully, no errors presently

0
1

Comments 0

No comments yet. Be the first!