agentsclimarketplace

Stocksight sentiment

Skill mahmoud20138/Tradecraft/plugins/tradecraft/skills/stocksight-sentiment

StockSight — open-source stock sentiment analysis using Twitter + news headlines. Elasticsearch storage, Kibana dashboards, NLTK/TextBlob/VADER NLP. Correlates social/news sentiment with price movements. Docker or local install. Asset-agnostic: worksFrom its SKILL.md

Install
npx -y skills add mahmoud20138/Tradecraft --skill stocksight-sentiment

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 18 stars18 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

7.6 KB, ~1.9k tokens by cl100k_base, as published. Nobody here has run it

stocksight-sentiment

USE FOR:

  • "Twitter sentiment analysis for stocks"
  • "news headline sentiment pipeline"
  • "Elasticsearch + Kibana sentiment dashboard"
  • "VADER / TextBlob sentiment scoring for trading"
  • "social media signal for trading"
  • "correlate sentiment with price" tags: [sentiment, Twitter, news, NLP, Elasticsearch, Kibana, VADER, TextBlob, NLTK, social-media, stocks] kind: tool category: market-intelligence

What Is StockSight?

Open-source sentiment analysis platform correlating Twitter + news sentiment with stock price.


Architecture

Twitter API       →  tweepy collector  ─┐
Financial News    →  newspaper3k/BS4  ──┤→ Sentiment Scoring → Elasticsearch → Kibana
Web pages (links) →  optional deep     ─┘   (NLTK/TextBlob/VADER)             Dashboards
                                                   ↕
                                           stockprice.py
                                        (price correlation)

Installation

Docker (Recommended)

git clone https://github.com/shirosaidev/stocksight
cd stocksight
docker-compose up -d    # Spins up ES + Kibana + stocksight

Local

pip install tweepy beautifulsoup4 newspaper3k nltk textblob elasticsearch
# Also requires: Elasticsearch 5.x + Kibana 5.x running locally

Configuration

# config/stocksight.cfg
[twitter]
keywords = TSLA, Tesla, Elon Musk
whitelist = buy, bullish, moon, long
blacklist = spam, follow, RT

[stocks]
symbol = TSLA

Usage

# Collect Twitter sentiment for TSLA
python stocksight.py -s TSLA -t "Tesla, TSLA" -l

# Track a specific Twitter user's feed
python stocksight.py -s TSLA -u elonmusk

# Collect with deep web page analysis
python stocksight.py -s TSLA -t "Tesla" --web

# Add price data
python stockprice.py -s TSLA

NLP Sentiment Pipeline

from textblob import TextBlob
from nltk.sentiment.vader import SentimentIntensityAnalyzer

# TextBlob polarity
blob = TextBlob(tweet_text)
polarity = blob.sentiment.polarity  # -1.0 to +1.0

# VADER compound score (better for social media)
vader = SentimentIntensityAnalyzer()
scores = vader.polarity_scores(tweet_text)
compound = scores["compound"]  # -1.0 to +1.0

# Classification
if compound >= 0.05:
    sentiment = "POSITIVE"
elif compound <= -0.05:
    sentiment = "NEGATIVE"
else:
    sentiment = "NEUTRAL"

Kibana Dashboard

After data collection, Kibana (localhost:5601) shows:

  • Sentiment trend over time (line chart)
  • Tweet volume by sentiment class
  • Sentiment vs. price overlay
  • Top keywords driving positive/negative sentiment
  • Hourly/daily sentiment distribution

Extending to Crypto / Other Assets

# Works for any keyword-based asset
python stocksight.py -s BTC -t "Bitcoin, BTC, crypto" -l
python stocksight.py -s ETH -t "Ethereum, ETH, DeFi" -l

Sentiment → Trading Signal Pattern

Compound Score  │  Signal
────────────────┼──────────────
> +0.3          │  Strong BUY signal
+0.05 to +0.3   │  Weak BUY
-0.05 to +0.05  │  NEUTRAL / hold
-0.05 to -0.3   │  Weak SELL
< -0.3          │  Strong SELL signal

Volume spike + strong sentiment → high-conviction signal

── KNOWLEDGE INJECTION: Stock Prediction (alisonmitchell) ──

Source: https://github.com/alisonmitchell/Stock-Prediction

Routed to: trading.md → ml-trading / statistics-timeseries

Date: 2026-03-17

── KNOWLEDGE INJECTION: ML Stock Prediction Reference ──

ML Model Reference for Stock Price Prediction

Research project on FTSE 100 top-6 stocks combining:

  • Time series forecasting
  • Deep learning sequence models
  • Classical ML classifiers
  • NLP sentiment features

Model Taxonomy

Time Series / Statistical

ModelUse CaseNotes
ARIMAShort-horizon price forecastNeeds stationarity (differencing)
SARIMAARIMA + seasonal componentGood for weekly/monthly patterns
Facebook ProphetTrend + seasonality decompositionHandles holidays, robust to missing data
Moving AveragesBaseline trendSMA, EMA — simple but interpretable

Deep Learning Sequence Models

ModelUse CaseNotes
LSTMLong-term temporal dependenciesStandard for price sequences
GRULSTM-lite, faster trainingSimilar performance, fewer params
Simple RNNBaseline seq modelVanishing gradient limits depth

Classical ML (Classification / Regression)

ModelUse CaseNotes
Gradient BoostingDirection predictionXGBoost/LightGBM variants preferred
Gaussian Naive BayesFast baseline classifierGood with sentiment features

NLP Sentiment Tools

ToolApproachBest For
VADERRule-based lexiconSocial media, short texts
TextBlobPattern-basedQuick polarity scoring
BERTContextual embeddingsFinancial news (FinBERT variant)
SpaCyNER + entity linkingExtract company/ticker mentions
GensimTopic modeling (LDA)News theme extraction

Feature Engineering Reference

import pandas as pd
import talib  # or pandas-ta

# Core price features
df["returns"] = df["Adj Close"].pct_change()
df["log_returns"] = np.log(df["Adj Close"] / df["Adj Close"].shift(1))

# Technical indicators
df["MACD"], df["MACD_signal"], _ = talib.MACD(df["Adj Close"])
df["RSI"] = talib.RSI(df["Adj Close"], timeperiod=14)
df["BB_upper"], df["BB_mid"], df["BB_lower"] = talib.BBANDS(df["Adj Close"])
df["STOCH_k"], df["STOCH_d"] = talib.STOCH(df["High"], df["Low"], df["Close"])
df["MFI"] = talib.MFI(df["High"], df["Low"], df["Close"], df["Volume"])
df["ROC"] = talib.ROC(df["Adj Close"], timeperiod=10)
df["OBV"] = talib.OBV(df["Close"], df["Volume"])

Critical ML Anti-Pattern: Data Leakage

# WRONG — random split causes look-ahead bias
from sklearn.model_selection import train_test_split
X_train, X_test = train_test_split(X, test_size=0.2, random_state=42)  # ❌

# CORRECT — time-based split
from sklearn.model_selection import TimeSeriesSplit
tscv = TimeSeriesSplit(n_splits=5)
for train_idx, test_idx in tscv.split(X):
    X_train, X_test = X[train_idx], X[test_idx]  # ✓

# BEST — walk-forward validation
# Each fold: train on past, predict next N days, advance window

Framing: Regression vs Classification

# Regression: predict price or return magnitude
y = df["Adj Close"].shift(-1)               # Next day price
y = df["returns"].shift(-1)                  # Next day return

# Classification: predict direction
y = (df["returns"].shift(-1) > 0).astype(int)  # 1=up, 0=down
# or 3-class: 1=up, 0=flat, -1=down
y = np.where(df["returns"].shift(-1) > threshold, 1,
    np.where(df["returns"].shift(-1) < -threshold, -1, 0))

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 610,677. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.