iam-abbas / Reddit-Stock-Trends

Fetch currently trending stocks on Reddit
MIT License
1.53k stars 200 forks source link

Create Portfolio data structure and add basic comparison logic #56

Open boboman-1 opened 3 years ago

boboman-1 commented 3 years ago

Portfolio Support

Users may want to do some due diligence and select a symbols to research. Give user a convenient way to incorporate and track tickers they are interested in within stocktrend utility. Tell the user when tickers they are tracking are added or removed from scrape_latest.

Implementation

In progress

Utilizing similar config pattern as main_utils, allow users to track specific tickers in groupings called portfolios. Persist in an .ini file. Use latest scraper data to update a system-level Portfolio.

note Try to make Portfolios optional, do not couple with current scraping if possible.

Minimum-Viable-Product Acceptance Criteria:

boboman-1 commented 3 years ago

Started some work on this at https://github.com/boboman-1/Reddit-Stock-Trends/pull/1/

boboman-1 commented 3 years ago

Generate nice markdown output based on portfolios and yfinance data?

Pandas to the rescue

https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.to_markdown.html

I rolled these handmade for github but you get idea

Scraper Latest

_ _ _
- - -

MyPennies

_ _ _
- - -

InterestingKeepWatch

_ _ _
- - -

Top3

Ticker # Mentions Full Name Industry Previous Close 5d Low 5d High 1d Change (%) 5d Change (%) 1mo Change (%)
1 ARBKF 2 Argo Blockchain plc Capital Markets 2.720000 1.490000 2.740000 36.68 61.90 70.00
2 TAKOF 2 Drone Delivery Canada Corp. Computer Hardware 1.650000 1.380000 2.010000 -2.08 13.79 133.71
3 GTLL 1 Global Technologies, Ltd. Conglomerates 0.022950 0.012500 0.035900 -12.07 20.79 2450.00
JakeCirino commented 3 years ago

Portfolio Support

Users may want to do some due diligence and select a symbols to research. Give user a convenient way to incorporate and track tickers they are interested in within stocktrend utility. Tell the user when tickers they are tracking are added or removed from scrape_latest.

Implementation

In progress

Utilizing similar config pattern as main_utils, allow users to track specific tickers in groupings called portfolios. Persist in an .ini file. Use latest scraper data to update a system-level Portfolio.

note Try to make Portfolios optional, do not couple with current scraping if possible.

Minimum-Viable-Product Acceptance Criteria:

  • [ ] Able to CRUD Portfolios
  • [ ] Portfolio comparison logic ("diffs"/"deltas")
  • ~Print to Console when scrape_latest adds or removes tickers that were previously in the scrape_latest portfolio~
  • [ ] Print to Console when scrape_latest adds or removes tickers that existed in user's portfolios, including scrape_latest

Any specific reason for an INI? Something like YAML or JSON might be more applicable to this data type.