StephanAkkerman / fintwit-bot

FinTwit-Bot is a Discord bot designed to track and analyze financial markets by pulling data from platforms like Twitter, Reddit, and Binance. It features customizable tools for sentiment analysis, market trends, and portfolio tracking to help traders stay informed and make data-driven decisions.
http://akkerman.ai/fintwit-bot/
MIT License
54 stars 11 forks source link

Add daily sector snapshot #485

Closed StephanAkkerman closed 1 week ago

StephanAkkerman commented 6 months ago

image

From this tweet https://x.com/bespokeinvest/status/1747378516784447520?s=46&t=kVjHUwwWD5s9buPqlc0doQ

StephanAkkerman commented 6 months ago

Maybe scrape sector information from: https://www.tradingview.com/markets/stocks-usa/sectorandindustry-sector/consumer-services/

StephanAkkerman commented 6 months ago

https://trendlyne.com/equity/sector-industry-analysis/sector/day/ also has interesting sector info

StephanAkkerman commented 5 months ago

https://www.barchart.com/stocks/market-performance seems to have the data necessary for making the plot image

Can scrape from the raw HTML, probably easy to do

StephanAkkerman commented 2 weeks ago
import pandas as pd
import requests

headers = {
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3"
}
r = requests.get("https://www.barchart.com/stocks/market-performance", headers=headers)
df = pd.read_html(r.text)
print(df)