Event Driven logo

Event Driven

OrganizationPopular
HKUDS
event-driven

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.

Overview

PublisherHKUDS
RepositoryVibe-Trading
Skill nameevent-driven
Stars
33.6K
Forks
5.5K
Bundled files
1
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by HKUDS on GitHub. Read the source before you install it.

Installation

Install the Event Driven AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/HKUDS/Vibe-Trading.git /tmp/Vibe-Trading
mkdir -p .claude/skills
cp -r /tmp/Vibe-Trading/agent/src/skills/event-driven .claude/skills/event-driven
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Event Driven in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Event Driven on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Event Driven is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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:

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

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Event Driven AI skill do?

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.

Why use Event Driven on TypingMind?

Because you install it once and use it with any model. Event Driven is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Event Driven in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/HKUDS/Vibe-Trading/tree/main/agent/src/skills/event-driven. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Event Driven?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Event Driven?

As many as you like. As long as a model supports skills, you can use Event Driven with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Event Driven AI skill free?

Yes. It is published on GitHub by HKUDS under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇