event-driven
यह क्या करती है
यह स्किल एजेंट को समाचार, घोषणाओं और नीति अपडेट को ट्रेडिंग के लिए स्कोर किए गए इवेंट डेटा में बदलने देती है। यह उन ट्रेडरों के लिए है जो घटनाओं पर प्रतिक्रिया देना और उन्हें कीमत संकेतों के साथ जोड़ना चाहते हैं।
कब इस्तेमाल करें
- ✓जब आप किसी कंपनी या सेक्टर की हाल की खबरों को भावना के लिए स्कोर करना चाहें।
- ✓जब आप घोषणाओं और नीति अपडेट से इवेंट संकेत रणनीति में जोड़ना चाहें।
- ✓जब आप इवेंट डेटा को ट्रेडिंग लॉजिक से अलग एक सरल तालिका में रखना चाहें।
Skill का लिंक
https://github.com/HKUDS/Vibe-Trading/blob/main/agent/src/skills/event-driven/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“इस हफ़्ते की इस कंपनी की खबरें इकट्ठा कीजिए, हर खबर को भावना और असर के लिए स्कोर कीजिए, और उसे हमारे कीमत संकेत के साथ मिलाइए।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट समाचार और घोषणाओं का पूरा टेक्स्ट लाता है, AI से हर आइटम को बहुत बियरिश से बहुत बुलिश तक के पैमाने पर स्कोर करवाता है, और नतीजे एक तालिका में सहेजता है। फिर एक सिग्नल फ़ाइल समय-क्षय लागू करती है और इवेंट स्कोर को तकनीकी संकेत के साथ मिलाती है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
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,
अक्सर पूछे जाने वाले सवाल
स्कोर की सीमा का क्या मतलब है?
स्कोर माइनस एक, यानी बहुत मंदी, से प्लस एक, यानी बहुत तेज़ी, तक रहते हैं।
इवेंट डेटा अलग फ़ाइल में क्यों रखें?
इससे डेटा और ट्रेडिंग लॉजिक अलग रहते हैं, और दोनों की जाँच और बदलाव आसान होता है।
क्या पुरानी खबरें अब भी गिनी जाती हैं?
हाँ, पर समय-क्षय के ज़रिए उनका असर धीरे-धीरे घटता है।
जानकारी
लेखक का मूल विवरण
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
लोकप्रियता
- GitHub स्टार
- 37k
- रैंकिंग में स्थान
- #7517
- लाइसेंस
- MIT
- अपडेट की गई
- 1/11/2026
कमेंट
- …
इस repository की और skills
vibe-trading
37kयह आपके एजेंट को वित्त शोध का पूरा टूलकिट देती है, जिसमें बैकटेस्ट, फ़ैक्टर एनालिसिस, ऑप्शन प्राइसिंग और कई बाज़ारों का डेटा शामिल है।
adr-hshare
37kयह आपके एजेंट को दिखाती है कि कई बाज़ारों में लिस्टेड एक चीनी कंपनी के भाव की तुलना कैसे करें, जैसे अमेरिकी ADR और हॉन्गकॉन्ग शेयर।
akshare
37kयह आपके एजेंट को चीनी और वैश्विक शेयरों, फ़्यूचर्स, फ़ॉरेक्स और आर्थिक संकेतकों का मुफ़्त बाज़ार डेटा लेने देती है, बिना API key के।
alpha-zoo
37kयह आपके एजेंट को बने-बनाए स्टॉक फ़ैक्टरों की लाइब्रेरी देखने और चुने हुए बाज़ार पर उनके पूरे समूह के रिटर्न की भविष्यवाणी की क्षमता जाँचने देती है।
मिलती-जुलती skills
gitcrawl
394kयह आपके एजेंट को GitHub issues और pull requests के सेव आर्काइव में खोजने, मिलते-जुलते मामलों को समूह में रखने और लाइव स्थिति जांचने देती है।
slacrawl
394kयह आपके एजेंट को स्थानीय Slack आर्काइव में संदेश खोजने और गिनने, उसकी ताज़गी जांचने और ज़रूरत पड़ने पर उसे ताज़ा करने देती है।
goplaces
394kयह आपके एजेंट को Google Places से जगहें खोजने, उनका विवरण और समीक्षाएं पाने, और जगह के नाम हल करने में मदद करती है, स्क्रिप्ट के लिए JSON आउटपुट के साथ।