This script aims to send a daily update of an investment portfolio containing a table with :
- The daily variation in % (from yesterday open and closure prices)
- PER (for stocks)
- Most Recent Earning (for stocks)
- Next Future Earning (for stocks)
- A chart of past 30 days performance
- Some related news from the NewsAPI services (https://newsapi.org/)
It heavily relies on the libraries Yfinance (https://github.com/ranaroussi/yfinance) and Yagmail (https://github.com/kootenpv/yagmail) to gather the tickers data and send the mail in an HTML format.
The project is heavily inspired by Sven-Bo's python morning mailer bot (https://github.com/Sven-Bo/python-morning-mailer-bot). Shout-out to him ! 🙌
In order to send the mail, PythonAnywhere scheduled tasks perfectly do the job (https://www.pythonanywhere.com/)
Don't forget to create a .env file with the following information :
EMAIL_SENDER=YourGmailAdress
EMAIL_PASSWORD=YourGmailPassword
EMAIL_RECEIVER=YourEmailAdress
NEWS_API_ORG_KEY=YourNewsAPIKey
Here is an example of the result (22/05/24) :
Ticker | Variation (%) | PER | Most Recent Earning | Next Future Earning | Chart (30 days period) |
---|---|---|---|---|---|
Stocks - Unweighted Average Variation: 0.59% | |||||
Apple | 0.66 | 29.935032 | Date: 2024-05-02 EPS Estimate: 1.5 Reported EPS: 1.53 |
Date: 2024-08-01 EPS Estimate: 1.32 Reported EPS: nan |
|
News: Samsung Disses Apple Over iPad Commercial Fiasco Every now and then a corporation is at least a bit funny when going about their late-stage capitalism. For instance, Samsung has released an absolutely perfect diss-ad response to Apple’s recent crushing PR disaster.Read more... | |||||
Microsoft | 0.52 | 37.364384 | Date: 2024-05-21 EPS Estimate: 2.82 Reported EPS: 2.94 |
Date: 2024-05-29 EPS Estimate: nan Reported EPS: nan |
|
News: What to expect from Microsoft’s Surface event today Microsoft is holding a press-only event to discuss its AI and Surface device plans on May 20th, ahead of its Microsoft Build 2024 conference. | |||||
ETFs - Unweighted Average Variation: 0.08% | |||||
MSCI World | 0.06 | N/A | N/A | N/A | |
News: MicroStrategy Secures Spot on Prestigious MSCI World Stock Index MicroStrategy, the business intelligence and software firm well known for its substantial bitcoin holdings, has achieved a significant milestone by being added to the prestigious MSCI World Stock Index. The MSCI World Stock Index is a widely recognized benchm… | |||||
S&P 500 | 0.10 | N/A | N/A | N/A | |
News: These catalysts could push the S&P 500 to 5,600: BMO's Belski BMO Capital Markets recently increased its target for the S&P 500 (^GSPC) to 5600, the highest forecast on Wall Street. The Dow Jones Industrial (^DJI... | |||||
Currencies - Unweighted Average Variation: 0.00% | |||||
EUR/USD | 0.00 | N/A | N/A | N/A | |
News: EUR-USD Forecast: A Potential Long-Term Headache The EUR-USD pair, trading at $1.0872, is like a bad relationship – it’s complicated. Depending on your time frame, it’s either a promising fling or... #eurusd | |||||
Commodities - Unweighted Average Variation: -0.32% | |||||
Gold | -0.32 | N/A | N/A | N/A | |
News: Michael Burry and John Paulson hit the jackpot when they called the housing crash. Now they're betting on gold. Michael Burry bought about $8 million worth of a trust that owns physical gold bullion. John Paulson has been betting big on gold for years. | |||||
Crypto - Unweighted Average Variation: -1.83% | |||||
BitCoin | -1.83 | N/A | N/A | N/A | |
News: Everything to Know About Bitcoin Pizza Day On May 22, 2010, a man in Florida paid 10,000 Bitcoin for pizza.Read more... | |||||
Total Unweighted Average Variation: -0.12% |