event-driven
Skill này làm gì
Skill này giúp agent biến tin tức, thông báo và cập nhật chính sách thành dữ liệu sự kiện đã chấm điểm để giao dịch. Skill dành cho trader muốn phản ứng với sự kiện và kết hợp chúng với tín hiệu giá.
Khi nào nên dùng
- ✓Khi bạn muốn chấm điểm cảm xúc của tin tức gần đây về một công ty hoặc ngành.
- ✓Khi bạn muốn đưa tín hiệu sự kiện từ thông báo và cập nhật chính sách vào một chiến lược.
- ✓Khi bạn muốn giữ dữ liệu sự kiện trong một bảng đơn giản, tách khỏi logic giao dịch.
Liên kết skill
https://github.com/HKUDS/Vibe-Trading/blob/main/agent/src/skills/event-driven/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Thu thập tin tức về công ty trong tuần này, chấm điểm cảm xúc và tác động của từng tin, rồi kết hợp với tín hiệu giá của chúng tôi.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent lấy toàn văn tin tức và thông báo, nhờ AI chấm điểm từng mục theo thang từ rất giảm giá đến rất tăng giá, rồi lưu kết quả vào một bảng. Một file tín hiệu sau đó áp dụng suy giảm theo thời gian và trộn điểm sự kiện với tín hiệu kỹ thuật.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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
- Data collection: use the
read_urltool to fetch the full text of news and announcements - LLM analysis: the LLM reads the news and scores it from
-1.0to1.0with a standardized prompt (extremely bearish to extremely bullish) - Generate the event CSV: write data in the
date,event_type,score,source,summaryschema - Signal aggregation:
signal_engine.pyreads 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
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:
| Field | Type | Description |
|---|---|---|
| date | str (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_type | str | earnings / macro / policy / sentiment / insider / technical_break |
| score | float | -1.0 ~ 1.0 (standardized LLM score) |
| source | str | Data-source tag (such as read_url) |
| summary | str | Event summary (one sentence, no commas) |
Event Type Details
| Type | Meaning | Typical Impact | Duration |
|---|---|---|---|
| earnings | Earnings release | Short-term shock | 1-5 days |
| macro | Macro data / central-bank policy | Medium-term impact | 5-20 days |
| policy | Industry policy / regulatory change | Long-term impact | 20-60 days |
| sentiment | Market sentiment / public opinion | Short-term shock | 1-3 days |
| insider | Insider trading / block trade | Medium-term signal | 5-10 days |
| technical_break | Break of a key technical level | Short-term catalyst | 1-5 days |
Signal Aggregation
Time Decay of Event Signals
Event impact decays exponentially over time:
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
def combine_signals(tech_signal: pd.Series, event_signal: pd.Series,
Câu hỏi thường gặp
Thang điểm nghĩa là gì?
Điểm chạy từ âm một, nghĩa là cực kỳ giảm giá, đến dương một, nghĩa là cực kỳ tăng giá.
Tại sao giữ dữ liệu sự kiện trong file riêng?
Điều này tách dữ liệu và logic giao dịch, giúp mỗi phần dễ kiểm tra và thay đổi hơn.
Tin cũ có còn tính không?
Có, nhưng ảnh hưởng của nó giảm dần theo thời gian nhờ cơ chế suy giảm.
Chi tiết
Mô tả gốc của tác giả
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.
repo: HKUDS/Vibe-Trading
Độ phổ biến
- Sao GitHub
- 37k
- Vị trí xếp hạng
- #7517
- Giấy phép
- MIT
- Cập nhật
- 1/11/2026
Bình luận
- …
Thêm skill từ kho mã này
vibe-trading
37kCho agent của bạn bộ công cụ nghiên cứu tài chính đầy đủ: backtest, phân tích nhân tố, định giá quyền chọn và dữ liệu thị trường nhiều nước.
adr-hshare
37kChỉ cho agent của bạn cách so sánh giá của một công ty Trung Quốc được niêm yết ở nhiều thị trường, như ADR ở Mỹ và cổ phiếu ở Hồng Kông.
akshare
37kCho agent của bạn lấy dữ liệu thị trường miễn phí: cổ phiếu Trung Quốc và toàn cầu, tương lai, ngoại hối, chỉ số kinh tế, không cần API key.
alpha-zoo
37kCho agent của bạn duyệt thư viện nhân tố cổ phiếu dựng sẵn và kiểm tra cả một nhóm nhân tố dự đoán lợi nhuận tốt đến đâu trên thị trường đã chọn.
Skill tương tự
gitcrawl
394kCho phép agent của bạn tìm trong kho lưu trữ issue và pull request GitHub, gom các mục trùng lặp và kiểm tra trạng thái hiện tại trên GitHub.
slacrawl
394kCho phép agent của bạn tìm và đếm tin nhắn trong kho lưu trữ Slack cục bộ, kiểm tra kho đó mới đến mức nào và làm mới khi cần.
goplaces
394kGiúp agent của bạn tìm địa điểm, lấy chi tiết và đánh giá, và xác định tên địa điểm bằng Google Places, với đầu ra JSON cho script.