Skillpedia
التحليل وجداول البيانات37k · #7558

strategy-generate

ما الذي تفعله

تحوّل هذه المهارة فكرة تداول بسيطة إلى استراتيجية عاملة وتختبرها على بيانات سابقة. وهي موجهة للمتداولين الذين يريدون تجربة أفكارهم دون كتابة محرك اختبار رجعي كامل.

متى تستخدمها

  • ✓عندما تصف فكرة تداول وتريد تحويلها إلى استراتيجية قابلة للاختبار.
  • ✓عندما تريد تعديل استراتيجية قائمة ومعرفة كيف تتغير النتائج.
  • ✓عندما تريد اختبارًا رجعيًا بمقاييس واضحة ومراجعة صادقة للنتيجة.

رابط المهارة

https://github.com/HKUDS/Vibe-Trading/blob/main/agent/src/skills/strategy-generate/SKILL.md

انسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.

طريقة الاستخدام

أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.

رسالة جاهزة للصق

استخدم هذه المهارة لمساعدتي: https://github.com/HKUDS/Vibe-Trading/blob/main/agent/src/skills/strategy-generate/SKILL.md اقرأ ملف SKILL.md في هذا الرابط ونفّذ تعليماته لمهمتي.
تريد أن يجد الذكاء الاصطناعي مهارات مثل هذه بنفسه؟ثبّت خادم Skillpedia MCP المجاني: سطر واحد، ويبحث في 15,000+ مهارة قبل كل مهمة.ثبّته في دقيقة واحدة →

مثال على ما تطلبه من الذكاء الاصطناعي

“ابنِ استراتيجية تشتري عندما يتجاوز متوسط 20 يومًا متوسط 60 يومًا، واختبرها على Apple رجعيًا.”

5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.

كيف تعمل

تكتب المهارة ملف إعداد وسكريبت إشارات، وتفحص الشيفرة بحثًا عن الأخطاء، ثم تشغّل أداة الاختبار الرجعي المدمجة. بعدها تراجع المقاييس وتعرض النتائج بوضوح، بما فيها النتائج السيئة.

المحتوى التقني (ملف SKILL.md الأصلي)

النص الأصلي من المؤلف، مباشرة من GitHub.

Workflow

  1. Requirements parsing: parse user intent, extract instrument codes, time range, and strategy logic, then write config.json
  2. Strategy design: think through the 5 questions of data / signal / position sizing / backtest / validation
  3. Strategy coding: write code/signal_engine.py (following the SignalEngine contract)
  4. Syntax check: bash("python -c \"import ast; ast.parse(open('code/signal_engine.py').read()); print('OK')\"")
  5. Run backtest: call the backtest tool (built into the engine; no need to write run_backtest.py)
  6. Evaluate results: use the backtest tool's structured metrics, validation and artifact summary. Read artifacts/metrics.csv or targeted rows with read_run_artifact only when the requested evidence is missing from that summary. Judge by the review criteria and report failures honestly.
  7. Fix implementation errors: repair code/contract errors and rerun to verify. Poor returns in a correctly implemented strategy are a valid result: report them and stop. Change the strategy or test additional candidates only when the user requested optimization or comparison, within their specified scope. Deeper attribution and robustness research are performed when requested, not added to every backtest.

You only need to write signal_engine.py and config.json. The backtest tool automatically handles data loading and backtest execution.

Adapting a registered strategy

  1. Read get_strategy_evidence(strategy_id="sdm:...") for the parent's description and computed regime definitions. A stale, disabled, decayed or inadequately evidenced parent cannot be adapted.
  2. Call adapt_strategy(strategy_id=..., name=..., universe=..., config=...) with explicit codes and date window. Only name, universe and optional position sizing may change. Signal definition, entry and exit rules remain the parent's. Missing inputs require a question, never a fabricated metric or threshold.
  3. Use the returned assigned run_dir and seeded config.json. Generate the child's code/signal_engine.py from its description using the contract below; never copy a parent run's metrics. Preserve the bound codes, dates and strategy_adaptation metadata. Record model provenance through the normal write tool.
  4. Call backtest(run_dir=...), inspect its artifacts, then refresh_strategy_evidence(runs=[{"strategy_id": "sdm:<child>", "run_dir": "<assigned>"}], scope="strategies"). This updates only successful named strategies and preserves the parent's evidence. Refresh refuses a different run or changed config/code/results against the run card.
  5. Read the child's evidence and report its actual quality, cost and decay warnings. A successful backtest is not adequate regime evidence or independent approval. An unchanged mathematical signal can legitimately generate identical code for another universe; hashes establish provenance, not semantic correctness of generated Python.

Requirements Parsing

Extract the following from the user's description:

  • Instrument codes: process them according to the normalization rules below
  • Time range: if the user does not specify dates, default to 10 years back from today (for example, if today is 2026-03-18, then start_date=2016-03-18, end_date=2026-03-18)
  • Indicator warm-up: a long lookback (MA200, a 252-day z-score) needs bars from before the requested period. Move start_date back to load them and declare the boundary with warmup_bars — the requested period is what gets graded, and undeclared warm-up bars are graded too. Silently backdating start_date by a year turns a 10-year backtest into an 11-year one that still calls itself 10 years: the extra year's trades, CAGR and benchmark all enter the report, the run succeeds, and the numbers look internally consistent
  • Strategy logic: entry / exit conditions and indicator parameters

If critical information is missing, you must ask the user instead of guessing:

  • Instrument not specified → ask which instrument they want to backtest (offer several popular suggestions)
  • Strategy description is vague (for example, "help me build a strategy") → provide 2-3 strategy directions for the user to choose from
  • Mixed markets but not clearly specified → confirm the data source

Write config.json first, then write code. config.json must be placed in the root of run_dir.

Strategy Design

Before writing code, think through these 5 questions:

  1. **Data
الأسئلة الشائعة

هل أحتاج إلى كتابة شيفرة الاختبار الرجعي؟

لا. تكتب المهارة منطق الإشارة والإعدادات فقط، وتتولى أداة الاختبار الباقي.

ماذا لو خسرت الاستراتيجية أموالًا؟

تعرض المهارة ذلك بصراحة، فالعائد الضعيف من استراتيجية بُنيت بشكل صحيح نتيجة صالحة.

هل تستطيع تحسين الاستراتيجية؟

نعم، لكن فقط عندما تطلب التحسين أو المقارنة، وضمن النطاق الذي تحدده.

التفاصيل

الوصف الأصلي من المؤلف

Create, modify, and optimize quantitative trading strategies, then backtest and evaluate them.

repo: HKUDS/Vibe-Trading

الشعبية

نجوم GitHub
37k
الترتيب
#7558
الترخيص
MIT
آخر تحديث
1‏/11‏/2026

هل هذه المهارة مفيدة؟

0

سجّل الدخول للتصويت.

التعليقات

  • …

المزيد من المهارات من هذا المستودع

مهارات مشابهة