Skip to content

Sends top news on a company when their ticker's previous day closing price exceeds a certain percentage constraint

License

Notifications You must be signed in to change notification settings

cjl12377/stock-news-helper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 

Repository files navigation

stock-news-helper

When a chosen ticker's previous day closing price exceeds 5% (percentage constraint) of the opening price, the title of news are searched for the company name and 3 (pageSzize) articles are returned and parsed, then sent to a chat via Telegram. (Previous commits used SMS via Twilio)

Where I hosted:

pythonanywhere - it's limited in its features for the free tier but its simple and works

API endpoints used:

  1. Get stock data - https://www.alphavantage.co/query
  2. Get news stories - https://newsapi.org/v2/everything
  3. Send SMS - Twilio (careful not to burst your free credits)
  4. Telegram API - https://core.telegram.org/bots/api

Variables to edit:

To change number of articles retrieved:

  • Change pageSize in NEWS_PARAMS (e.g. 3)

To change Percentage constraints of price fluctuations: e.g. 5% under get_stock_alert() --> if (abs(day_changes)/opening_price)*100 > 5: get_news(day_changes, up_down)

Example:

image

About

Sends top news on a company when their ticker's previous day closing price exceeds a certain percentage constraint

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages