Logo Strategy Framework

Strategy Framework

Cộng đồng
agiprolabs
strategy-framework

Standardized template for defining trading strategies with entry rules, exit rules, position sizing, risk parameters, and performance criteria

Tổng quan

Nhà phát hànhagiprolabs
Kho mãclaude-trading-skills
Tên kỹ năngstrategy-framework
Sao
434
Bản fork
85
Tệp đi kèm
4
Giấy phépMIT
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI là Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 4 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được agiprolabs công bố trên GitHub. Hãy đọc nội dung nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Strategy Framework trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL thư mục kỹ năng bên dưới và xác nhận.
    https://github.com/agiprolabs/claude-trading-skills/tree/main/skills/strategy-framework
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/agiprolabs/claude-trading-skills.git /tmp/claude-trading-skills
mkdir -p .claude/skills
cp -r /tmp/claude-trading-skills/skills/strategy-framework .claude/skills/strategy-framework
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Strategy Framework trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự tải Strategy Framework ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên Strategy Framework không bị giới hạn ở mô hình mà kỹ năng này được viết cho. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên kỹ năng chưa dùng không tốn chi phí.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

Strategy Framework

A standardized system for defining, documenting, testing, and managing trading strategies. This skill provides templates and tools that enforce discipline, enable reproducibility, and make strategies testable.

Why a Strategy Framework Matters

Trading without a written strategy framework leads to:

  • Inconsistency: ad-hoc decisions driven by emotion rather than rules
  • Untestability: vague ideas that cannot be backtested or evaluated
  • Scope creep: strategies that drift without version-controlled definitions
  • Unmanaged risk: missing stop losses, position limits, or drawdown halts

A strategy framework forces you to:

  1. State a falsifiable hypothesis about a market inefficiency
  2. Define precise, machine-testable entry and exit rules
  3. Specify position sizing and risk parameters before trading
  4. Set minimum performance criteria for continuation or retirement
  5. Track changes through versioned strategy documents

Strategy Definition Template

Every strategy must be documented using the standard template. The full copy-paste template is in references/strategy_template.md.

Core Sections

Identity

Name: SOL-EMA-Cross v1.0
Asset class: Solana tokens (top 50 by 24h volume)
Timeframe: Primary 1H, confirmation 4H
Style: Trend following

Edge Hypothesis: State what market inefficiency you are exploiting and why it exists.

Hypothesis: Solana mid-cap tokens exhibit momentum persistence
on the 1H timeframe due to retail herding behavior and low
institutional participation. EMA crossovers capture the
initiation of these trends.

Entry Rules: Specific, testable conditions combined with AND/OR logic.

python
def entry_signal(data: pd.DataFrame) -> bool:
    """All conditions must be True (AND logic)."""
    ema_cross = data["ema_12"] > data["ema_26"]  # EMA 12 crossed above 26
    ema_rising = data["ema_26"].diff(3) > 0       # 26 EMA trending up
    volume_ok = data["volume"] > data["vol_sma_20"] * 1.5  # Volume confirmation
    regime_ok = data["adx"] > 20                  # Trending regime
    return ema_cross & ema_rising & volume_ok & regime_ok

Exit Rules: Every strategy needs multiple exit mechanisms.

Exit TypeMethodParameters
Stop LossATR-based2.0 × ATR(14) below entry
Take ProfitRisk multiple3.0 × risk (3:1 R:R)
Trailing StopChandelier3.0 × ATR(14) from highest high
Time StopBar countClose if flat after 20 bars
Signal ExitEMA reversalEMA 12 crosses below EMA 26

Position Sizing: Method and parameters. See the position-sizing skill for details.

python
risk_per_trade = 0.02        # 2% of portfolio
stop_distance_pct = 0.05     # 5% from entry (ATR-derived)
position_size = (portfolio * risk_per_trade) / stop_distance_pct

Risk Parameters: Portfolio-level guardrails. See the risk-management skill.

Max concurrent positions: 5
Risk per trade: 2% of portfolio
Daily loss limit: 5% of portfolio
Max drawdown halt: 15% — stop trading, review strategy
Correlated exposure limit: 10% (e.g., meme tokens combined)

Filters: Conditions that prevent entry even if signals fire.

python
def filters_pass(token: dict, market: dict) -> bool:
    """All filters must pass before entry is allowed."""
    volume_ok = token["volume_24h"] > 500_000      # Min $500K volume
    liquidity_ok = token["liquidity"] > 100_000    # Min $100K liquidity
    age_ok = token["age_days"] > 7                 # Not brand new
    holders_ok = token["holder_count"] > 500       # Sufficient distribution
    regime_ok = market["regime"] != "crisis"       # No crisis regime
    return all([volume_ok, liquidity_ok, age_ok, holders_ok, regime_ok])

Performance Criteria: When to continue, review, or retire.

Continue: Sharpe > 1.0, PF > 1.5, Win Rate > 40%, MDD < 20%
Review:   Any metric degrades 25% from baseline
Retire:   Rolling 30-day Sharpe < 0, or 3 consecutive losing months

Strategy Lifecycle

1. Hypothesis

Identify a market inefficiency and explain why it exists and why it might persist.

Good hypothesis: "New PumpFun tokens that reach 80+ SOL in bonding curve within 10 minutes have a 65% probability of graduating to Raydium, creating a predictable price spike at graduation."

Bad hypothesis: "SOL will go up." (Not specific, not testable, no edge identified.)

2. Definition

Write the full strategy document using the template in references/strategy_template.md. Every field must be filled. If you cannot fill a field, the strategy is not ready.

3. Backtest

Test on historical data using vectorbt or equivalent. Requirements:

  • Minimum 100 trades in the test period
  • Use walk-forward validation (train on 70%, test on 30%)
  • Account for slippage and fees (see slippage-modeling skill)
  • Report both in-sample and out-of-sample metrics

4. Paper Trade

Run the strategy in simulation for at least 2 weeks (or 30 trades, whichever is longer).

  • Compare paper results to backtest expectations
  • If results differ by more than 25%, investigate before proceeding

5. Small Live

Trade with minimum viable size (enough to cover fees, small enough to be inconsequential).

  • Run for at least 30 trades
  • Compare to paper trade results

6. Scale

If small-live metrics match expectations (within 25% of backtest):

  • Increase position size gradually (25% increments per week)
  • Monitor metrics continuously

7. Monitor

Ongoing performance tracking:

  • Daily: P&L, trade count, win rate
  • Weekly: Sharpe ratio, profit factor, drawdown
  • Monthly: Full strategy review against performance criteria

8. Retire

Stop using a strategy when:

  • Rolling 30-day Sharpe drops below 0
  • Three consecutive losing months
  • Market regime permanently shifts (e.g., regulatory change)
  • A better strategy replaces it for the same edge

Strategy Evaluation Criteria

Minimum thresholds before a strategy should be traded live:

MetricTrend FollowingMean ReversionScalping
Min Trades100100500
Sharpe (OOS)> 1.0> 1.0> 1.5
Profit Factor> 1.5> 1.5> 1.3
Max Drawdown< 20%< 15%< 10%
Win Rate> 35%> 55%> 55%
Avg Win/Avg Loss> 2.0> 1.0> 1.0

Strategy Types for Crypto

Detailed descriptions of each strategy type are in references/strategy_types.md.

Momentum / Trend Following

  • Edge: Price trends persist due to behavioral biases and information asymmetry
  • Indicators: EMA crossovers, SuperTrend, ADX, MACD
  • Win rate: 35-45%, relies on large winners
  • Best regime: Trending markets with moderate volatility

Mean Reversion

  • Edge: Price oscillates around equilibrium due to overreaction
  • Indicators: RSI, Bollinger Bands, z-score, VWAP deviation
  • Win rate: 55-65%, relies on high win rate with smaller gains
  • Best regime: Ranging markets with low-moderate volatility

Breakout

  • Edge: Compressed volatility leads to directional expansion
  • Indicators: Bollinger Band squeeze, Donchian channels, volume breakout
  • Win rate: 30-40%, relies on catching large moves
  • Best regime: Transitioning from low to high volatility

Copy Trading / Wallet Following

  • Edge: Skilled wallets have informational or analytical advantages
  • Indicators: Wallet PnL history, trade frequency, token selection
  • Win rate: Depends on followed wallet quality
  • Best regime: Any (depends on followed wallet's strategy)

PumpFun Sniping

  • Edge: Predictable price dynamics around token creation and graduation
  • Strategies: Creation snipe, volume confirmation, graduation play
  • Win rate: Highly variable (20-60% depending on approach)
  • Best regime: High retail activity periods

Arbitrage

  • Edge: Price discrepancies across DEXs or between spot and perpetuals
  • Indicators: Price feeds from multiple venues, funding rates
  • Win rate: > 80% when executed correctly
  • Best regime: High volatility, fragmented liquidity

Market Making

  • Edge: Capturing bid-ask spread while managing inventory risk
  • Indicators: Order book depth, volatility, inventory position
  • Win rate: > 60%, relies on volume and spread capture
  • Best regime: Stable markets with consistent volume

Common Strategy Mistakes

  1. No written rules: Trading on intuition, unable to backtest or reproduce
  2. Curve fitting: Optimizing parameters until backtest looks perfect, fails live
  3. Missing stops: "I'll exit when it feels right" leads to catastrophic losses
  4. Ignoring regime: Using a trend strategy in a ranging market (or vice versa)
  5. Survivorship bias: Only backtesting tokens that still exist
  6. Lookahead bias: Using future information in backtest signals
  7. Ignoring costs: Not accounting for slippage, fees, and market impact
  8. Over-trading: Entering on marginal signals to "stay active"
  9. Strategy hopping: Abandoning strategies after normal losing streaks
  10. No retirement plan: Continuing to trade a broken strategy out of attachment

Integration with Other Skills

SkillIntegration
vectorbtBacktest strategy definitions programmatically
pandas-taCompute technical indicators for entry/exit signals
regime-detectionMarket regime filters for strategy activation
exit-strategiesDetailed exit rule implementation
position-sizingPosition size calculation methods
risk-managementPortfolio-level risk parameter enforcement
slippage-modelingRealistic execution cost estimation
feature-engineeringML feature computation from strategy signals

Files

References

  • references/strategy_template.md — Complete copy-paste strategy definition template
  • references/strategy_types.md — Detailed guide to each strategy type with parameters and examples

Scripts

  • scripts/define_strategy.py — Interactive strategy definition tool with --demo mode
  • scripts/strategy_scorecard.py — Strategy evaluation scorecard with GO/REVIEW/NO-GO recommendations

Tệp đi kèm

Mô hình đọc các tệp này khi cần trong lúc kỹ năng được tải. Các tệp được cung cấp ở dạng có thể đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Strategy Framework làm được gì?

Standardized template for defining trading strategies with entry rules, exit rules, position sizing, risk parameters, and performance criteria

Vì sao nên dùng Strategy Framework trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Strategy Framework là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Strategy Framework trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/agiprolabs/claude-trading-skills/tree/main/skills/strategy-framework. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm và cài đặt thành một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Strategy Framework?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Bạn có thể dùng Strategy Framework với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Strategy Framework với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Strategy Framework có miễn phí không?

Có. Kỹ năng này được agiprolabs phát hành trên GitHub theo giấy phép MIT. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp cho mô hình các công cụ mới để gọi — mã được chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và tiêu chí của đầu ra tốt. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇