Agent skill

Event-Driven Sentiment Signals

by HKUDS in HKUDS/Vibe-Trading

Scores news, announcements and macro events with the LLM, stores them in an event CSV and blends the decaying event signal with technical signals in signal_engine.py.

MITAuto-check passedBusiness, Finance & HR

Install Event-Driven Sentiment Signals

skills CLI
$ npx skills add HKUDS/Vibe-Trading --skill event-driven -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install HKUDS/Vibe-Trading event-driven --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/HKUDS/Vibe-Trading.git skills-src && mkdir -p .claude/skills && cp -r skills-src/agent/src/skills/event-driven .claude/skills/event-driven && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
event-driven
GitHub stars
35k
Token cost
~2.1k tokens
SKILL.md length
639 words
Files
2
Skills in repo
89
Repo updated
First seen
Licence
MIT

At a glance

Scores news, announcements and macro events with the LLM, stores them in an event CSV and blends the decaying event signal with technical signals in signal_engine.py.

  • Works in 4 steps: Data collection: use the read_url tool… → LLM analysis: the LLM reads the news and… → Generate the event CSV: write data in… → …
  • Turning news and announcements into dated sentiment scores for a backtest
  • SKILL.md covers Purpose, Workflow, Event CSV Schema and Event Type Details, plus 6 more sections
  • Runs Python scripts from its folder; calls pip

What it does

The agent collects news and announcements with the read_url tool, reads each one and gives it a sentiment score from -1.0 to 1.0, then writes the scores into an event CSV with the columns date, event_type, score, source and summary. The date must be when the event became knowable, so an after-close release moves to the next trading day. The CSV is the data layer and signal_engine.py is the logic layer, and the two are kept separate.

Six event types are defined: earnings, macro, policy, sentiment, insider and technical_break, each with a typical impact and duration of a few days to several weeks. In signal_engine.py the event scores decay exponentially over time and are combined by weighted aggregation with the technical signal to give the final trading decision. An example_signal_engine.py file shows the pattern.

When your agent uses it

  • Turning news and announcements into dated sentiment scores for a backtest
  • Combining event signals with technical signals through weights
  • Setting the time decay for earnings, macro or policy events
  • Structuring event data as a CSV that signal_engine.py reads

Example prompts

  • “Read these three news articles and score each from -1.0 to 1.0 for the event CSV.”
  • “Add an earnings event dated 2024-01-15 with a score of 0.8 to the event CSV.”
  • “Write signal_engine.py that blends the event CSV with a moving-average signal and decays event impact over time.”
  • “Why should an after-close announcement use the next trading day's date?”

Requirements

  • The read_url tool for fetching articles
  • Python with pandas and numpy

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Data collection: use the read_url tool to fetch the full text of news and announcements
  2. LLM analysis: the LLM reads the news and scores it from -1.0 to 1.0 with a standardized prompt (extremely bearish to extremely bullish)
  3. Generate the event CSV: write data in the date,event_type,score,source,summary schema
  4. Signal aggregation: signal_engine.py reads the event CSV, applies time decay, and combines it with the technical signal

What it can do on your machine

Read from SKILL.md and the folder at commit 14cabaf. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships script files (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • pip

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use pip, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Event-Driven Sentiment Signals loads about 2.1k tokens when it runs. Until then it costs about 45 tokens; SKILL.md has 639 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~45
When it runs · the whole SKILL.md, loaded when a task matches
~2.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from HKUDS/Vibe-Trading at commit 14cabaf, republished under its MIT licence (© HKUDS). 639 words, ~2,125 tokens.

Download SKILL.mdSave it as .claude/skills/event-driven/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
event-driven
description
Event-driven strategy based on sentiment-scored signals from news, announcements, and macro events. The LLM acts as the NLP engine, and event data follows a CSV schema.
category
strategy

Event-Driven Strategy

Purpose

Uses event information such as news, announcements, and macro policy updates. The LLM analyzes sentiment and impact magnitude to generate event-driven trading signals. Event data is managed in CSV format, and technical signals are combined with event signals through weighted aggregation to form the final trading decision.

Workflow

  1. Data collection: use the read_url tool to fetch the full text of news and announcements
  2. LLM analysis: the LLM reads the news and scores it from -1.0 to 1.0 with a standardized prompt (extremely bearish to extremely bullish)
  3. Generate the event CSV: write data in the date,event_type,score,source,summary schema
  4. Signal aggregation: signal_engine.py reads the event CSV, applies time decay, and combines it with the technical signal

Key principle: the event CSV is the data layer, and signal_engine.py is the logic layer. Keep them decoupled.

Event CSV Schema

csv
date,event_type,score,source,summary
2024-01-15,earnings,0.8,read_url,Q4 revenue beat expectations by 30%
2024-01-20,macro,-0.5,read_url,Central bank raised rates by 25bp
2024-02-01,policy,0.3,read_url,New-energy subsidies extended
2024-02-10,sentiment,-0.7,read_url,Bearish sentiment surged on social media
2024-03-05,insider,0.4,read_url,CEO bought 5 million shares

Field descriptions:

FieldTypeDescription
datestr (YYYY-MM-DD)Date when the event became knowable (publication date, not occurrence date. If released after market close → use the next trading day)
event_typestrearnings / macro / policy / sentiment / insider / technical_break
scorefloat-1.0 ~ 1.0 (standardized LLM score)
sourcestrData-source tag (such as read_url)
summarystrEvent summary (one sentence, no commas)

Event Type Details

TypeMeaningTypical ImpactDuration
earningsEarnings releaseShort-term shock1-5 days
macroMacro data / central-bank policyMedium-term impact5-20 days
policyIndustry policy / regulatory changeLong-term impact20-60 days
sentimentMarket sentiment / public opinionShort-term shock1-3 days
insiderInsider trading / block tradeMedium-term signal5-10 days
technical_breakBreak of a key technical levelShort-term catalyst1-5 days

Signal Aggregation

Time Decay of Event Signals

Event impact decays exponentially over time:

python
import numpy as np
import pandas as pd


def compute_event_signal(event_df: pd.DataFrame, dates: pd.DatetimeIndex,
                         decay_lambda: float = 0.1,
                         min_score_threshold: float = 0.2,
                         event_lookback: int = 30) -> pd.Series:
    """Compute an event-driven signal with time decay.

    Args:
        event_df: DataFrame loaded from the event CSV, with date/event_type/score/source/summary columns.
        dates: Backtest date sequence (DatetimeIndex).
        decay_lambda: Decay coefficient. Higher values decay faster. Default 0.1 (decays to ~37% in about 10 days).
        min_score_threshold: Minimum score threshold. Events with |score| below this value are ignored.
        event_lookback: Event lookback window in days. Events older than this are excluded.

    Returns:
        Event signal Series aligned with dates, with value range [-1.0, 1.0].
    """
    event_df = event_df[event_df["score"].abs() >= min_score_threshold].copy()
    event_df["date"] = pd.to_datetime(event_df["date"])

    signal = pd.Series(0.0, index=dates)

    for trade_date in dates:
        # Only consider events published on or before trade_date (avoid look-ahead)
        mask = (event_df["date"] <= trade_date) & \
               (event_df["date"] >= trade_date - pd.Timedelta(days=event_lookback))
        relevant = event_df[mask]

        if relevant.empty:
            continue

        days_since = (trade_date - relevant["date"]).dt.days.values
        scores = relevant["score"].values
        # Exponential decay: score * exp(-lambda * days)
        decayed = scores * np.exp(-decay_lambda * days_since)
        # Sum multiple events and clip to [-1, 1]
        signal[trade_date] = np.clip(decayed.sum(), -1.0, 1.0)

    return signal
Weighted Combination of Technical and Event Signals
python
def combine_signals(tech_signal: pd.Series, event_signal: pd.Series,
                    alpha: float = 0.6) -> pd.Series:
    """Combine technical and event signals with weights.

    Args:
        tech_signal: Technical signal, range [-1.0, 1.0].
        event_signal: Event-driven signal, range [-1.0, 1.0].
        alpha: Weight of the technical signal, default 0.6 (technical primary, event secondary).

    Returns:
        Combined signal, range [-1.0, 1.0].
    """
    combined = alpha * tech_signal + (1 - alpha) * event_signal
    return combined.clip(-1.0, 1.0)

Default alpha = 0.6: technical signal 60%, event signal 40%.

Parameters

ParameterDefaultDescription
alpha0.6Weight of the technical signal (1-alpha is the event weight)
decay_lambda0.1Decay coefficient (higher values decay faster; 0.1 ≈ decays to 37% in 10 days)
event_lookback30Event lookback window in days (older events are excluded)
min_score_threshold0.2Minimum score threshold (events with

LLM Scoring Prompt Template

After fetching news with read_url, use the following standardized prompt to keep scoring consistent:

You are a financial event analyst. Read the following news / announcement and score its impact on the stock price.

Scoring scale:
- 1.0: extremely bullish (for example, earnings far above expectations, major favorable policy)
- 0.5: moderately bullish (for example, earnings slightly above expectations, favorable industry news)
- 0.2: mildly bullish
- 0.0: neutral (no obvious impact)
- -0.2: mildly bearish
- -0.5: moderately bearish (for example, earnings below expectations, tighter industry regulation)
- -1.0: extremely bearish (for example, accounting fraud, major violations, black-swan event)

Score strictly on the scale above. Output one number only. Do not explain.

News content:
{news_content}

Score:
Show full SKILL.md (276 more words)Show less

Common Pitfalls

  1. Look-ahead bias: the date in the event CSV must be the "knowable date" — announcements released after market close should use the next trading day, not the same day. In backtests, strictly enforce event_date <= trade_date
  2. Duplicate event scoring: the same event may appear from multiple news sources and generate multiple rows. Deduplicate by (date, event_type) or average the scores
  3. Sentiment drift: the LLM scoring standard can drift as the prompt or model version changes. Fix the prompt template and recalibrate regularly
  4. Event sparsity: most trading days have no events, so the event signal is 0 and the final signal is mainly driven by technicals. This is normal; do not fabricate data just to "fill gaps"
  5. Event data in backtests: historical backtests require a fully prepared historical event CSV in advance; you cannot fetch it in real time. It is recommended to maintain separate event files per instrument
  6. Commas in the summary field: a common reason for CSV parsing errors — avoid commas in summary, or read with pd.read_csv(quoting=csv.QUOTE_ALL)
  7. Decay parameter sensitivity: overly large decay_lambda makes event impact disappear too quickly, while overly small values keep stale events active for too long. In theory, different event types should use different decay profiles, but the default simplifies all of them to 0.1

Dependencies

bash
pip install pandas numpy

No additional dependencies. LLM analysis is handled by the Agent itself, and the read_url tool is built in.

Signal Convention

  • Pure event signal: [-1.0, 1.0] (computed from event score + time decay)
  • Combined signal: alpha * tech_signal + (1 - alpha) * event_signal, clipped to [-1.0, 1.0]
  • When no event exists, event_signal = 0, so the combined signal collapses to the pure technical signal

© HKUDS, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in agent/src/skills/event-driven of HKUDS/Vibe-Trading.

  • SKILL.md
  • example_signal_engine.py

Open the folder on GitHubat commit 14cabaf

Compare with similar skills

Event-Driven Sentiment Signals next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Event-Driven Sentiment Signals compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Event-Driven Sentiment Signals this skillHKUDS/Vibe-Trading35k—~2.1kAutomated safety check: PassMIT
Tushare Datazillionare/zillionare3192 repos~2.3kAutomated safety check: PassNone
Quant Blog Writingzillionare/zillionare319—~895Automated safety check: PassNone
Quant Analystmajiayu000/claude-skill-registry6661 repos~964Automated safety check: PassMIT
Backtestinggauss314/skills246—~2.4kAutomated safety check: PassMIT
Option Pricinggauss314/skills246—~4.7kAutomated safety check: PassMIT

Similar skills

  • Tushare Data

    zillionare/zillionare

    面向中文自然语言的 Tushare 数据研究技能。用于把“看看这只股票最近怎么样”“帮我查财报趋势”“最近哪个板块最强”“北向资金在买什么”“给我导出一份行情数据”这类请求,转成可执行的数据获取、清洗、对比、筛选、导出与简要分析流程。适用于 A 股、指数、ETF/基金、财务、估值、资金流、公告新闻、板块概念与宏观数据等研究场景。

    319 GitHub starsUsed in 2 repos~2.3k tokens
    Business, Finance & HRAuto-check passed
  • Quant Blog Writing

    zillionare/zillionare

    撰写文笔精炼、富有深度的量化交易博文,论点清晰、证据确凿、叙事层次更加丰富。适用于量化交易博文、因子研究、回测复盘、数据源排查、市场微观结构、策略原理、风险控制、职业观察、量化人物故事等选题。文章将聚焦具体角度,提供详实的大纲、证据规划及成稿,力求内容兼具思想深度与诚实性,而非单纯口号式宣传;同时,通过人物经历、引言、贡献及行业背景的融入,让文章更具可读性和吸引力。

    319 GitHub stars~895 tokensUpdated today
    Business, Finance & HRAuto-check passed
  • Quant Analyst

    majiayu000/claude-skill-registry

    Expert in quantitative finance, algorithmic trading, and financial data analysis using Python (Pandas/NumPy), statistical modeling, and machine learning.

    666 GitHub starsUsed in 1 repo~964 tokens
    Data & AnalyticsAuto-check passed
  • Backtesting

    gauss314/skills

    Academic backtesting framework for quantitative research. An agent skill from gauss314/skills.

    246 GitHub stars~2.4k tokensUpdated 3 mo ago
    Business, Finance & HRAuto-check passed
  • Option Pricing

    gauss314/skills

    Pricing completo de opciones europeas y americanas. An agent skill from gauss314/skills.

    246 GitHub stars~4.7k tokensUpdated 3 mo ago
    Business, Finance & HRAuto-check passed
  • Vectorbt

    agiprolabs/claude-trading-skills

    High-performance vectorized backtesting with parameter optimization, portfolio simulation, and rich performance metrics

    410 GitHub stars~2.6k tokensUpdated 1 mo ago
    Business, Finance & HRAuto-check passed

More from HKUDS/Vibe-Trading

All 89 skills in this repo
  • Eastmoney Market Data

    HKUDS/Vibe-Trading

    Index of Eastmoney's free, no-token market data interfaces for China A-shares and Hong Kong stocks: fund flows, dragon-tiger lists, margin trading, reports and news.

    35k GitHub stars~1k tokensUpdated today
    Auto-check passed
  • OKX Market Data

    HKUDS/Vibe-Trading

    Retrieves public OKX cryptocurrency market data such as spot prices, candlesticks, funding rates and open interest through the OKX V5 REST API, with no authentication.

    35k GitHub stars~1.3k tokensUpdated today
    Auto-check passed
  • SEC EDGAR Filings Fetcher

    HKUDS/Vibe-Trading

    Fetches U.S. SEC EDGAR data: resolves tickers to CIK numbers, lists recent 10-K, 10-Q and 8-K filings with document URLs, and pulls XBRL financial series.

    35k GitHub stars~1.4k tokensUpdated today
    Auto-check passed
  • A-Share ST Risk Screener

    HKUDS/Vibe-Trading

    Predicts whether a mainland China A-share company risks an ST or *ST warning after its next annual report, using financial thresholds and Sina penalty records.

    35k GitHub stars~4.9k tokensUpdated today
    Auto-check passed
  • Breaks a structural trend such as AI infrastructure into its physical supply chain and ranks lesser-known listed companies sitting on each bottleneck.

    35k GitHub stars~2.7k tokensUpdated today
    Auto-check passed
  • Plans and drafts an eight-part, roughly 120k-word investigative series on one company, built around a strict fact-check pass rather than fast drafting.

    35k GitHub stars~2.4k tokensUpdated today
    Auto-check passed

Questions about Event-Driven Sentiment Signals

What does Event-Driven Sentiment Signals do?

Scores news, announcements and macro events with the LLM, stores them in an event CSV and blends the decaying event signal with technical signals in signal_engine.py. 0, then writes the scores into an event CSV with the columns date, event_type, score, source and summary. The date must be when the event became knowable, so an after-close release moves to the next trading day.

When should I use Event-Driven Sentiment Signals?

Event-Driven Sentiment Signals fits situations like: turning news and announcements into dated sentiment scores for a backtest; combining event signals with technical signals through weights; setting the time decay for earnings, macro or policy events; structuring event data as a CSV that signal_engine.py reads.

How do I install Event-Driven Sentiment Signals in Claude Code?

Run `npx skills add HKUDS/Vibe-Trading --skill event-driven -a claude-code`. Or copy the skill folder (agent/src/skills/event-driven in HKUDS/Vibe-Trading) into .claude/skills/event-driven in your project. Claude Code loads it when a task matches its description.

How do I install Event-Driven Sentiment Signals in Codex?

Run `npx skills add HKUDS/Vibe-Trading --skill event-driven -a codex`. Or copy the skill folder (agent/src/skills/event-driven in HKUDS/Vibe-Trading) into .agents/skills/event-driven in your project. Codex loads it when a task matches its description.

Can I use Event-Driven Sentiment Signals in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add HKUDS/Vibe-Trading --skill event-driven -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/event-driven, .gemini/skills/event-driven, .github/skills/event-driven and .opencode/skills/event-driven in your project.

What does Event-Driven Sentiment Signals need to run?

Going by SKILL.md and its folder, Event-Driven Sentiment Signals needs Python for the scripts in its folder and the command-line tools its instructions call (pip). Our summary lists: The read_url tool for fetching articles; Python with pandas and numpy.

Does Event-Driven Sentiment Signals access the network?

SKILL.md contains no URLs. Its commands use pip, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Event-Driven Sentiment Signals safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Event-Driven Sentiment Signals use?

Event-Driven Sentiment Signals is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Event-Driven Sentiment Signals use?

About 2.1k tokens (SKILL.md is roughly 8.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Event-Driven Sentiment Signals?

Skills that share tags, products or a category with Event-Driven Sentiment Signals: Tushare Data (zillionare/zillionare, 319 stars), Quant Blog Writing (zillionare/zillionare, 319 stars), Quant Analyst (majiayu000/claude-skill-registry, 666 stars) and Backtesting (gauss314/skills, 246 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Event-Driven Sentiment Signals?

HKUDS (a GitHub organization) maintains it in HKUDS/Vibe-Trading, which has 34,949 GitHub stars. The repository holds 89 skills in this directory. The repository was last updated on October 8, 2026.

Source: HKUDS/Vibe-Trading on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.