AgentSkillsCN

planning-trading-systems

在策略正式实施之前,先完成完整交易系统的规划设计。从边缘界定、入场与出场规则、仓位管理,到风险管理,全程提供指导。适用于在编写策略代码之前使用。

SKILL.md
--- frontmatter
name: planning-trading-systems
description: Designs complete trading systems before implementation. Guides through edge definition, entry/exit rules, position sizing, and risk management. Use before writing strategy code.

Planning Trading Systems

Triggering Contexts

  • User wants to build a new trading strategy
  • User has a vague idea ("I want to trade momentum")
  • Before any Pinescript coding begins
  • When existing strategy lacks clear rules

Workflow Checklist

(Copy into task.md when starting)

  • Define the Edge (Why does this work?)
  • Entry Rules (Signal, confirmation, filters)
  • Exit Rules (Profit target, stop loss, time-based)
  • Position Sizing (How much per trade?)
  • Position Management (Trailing, scaling)
  • Risk Management (Drawdown limits, correlation)
  • Expected Metrics (Win rate, R:R, expectancy)
  • Generate strategy-spec.md

Instructions

1. Edge Definition

Ask the user:

  • What market inefficiency are you exploiting?
  • What is the alpha source? (Trend, mean-reversion, volatility, information)
  • What market conditions does this edge work in?

Reject vague answers. "I want to use RSI and MACD" is not an edge.

2. Entry Rules

Define precise, unambiguous criteria:

ComponentDescription
Primary SignalMain trigger (e.g., EMA crossover)
ConfirmationSecondary filter (e.g., RSI > 50)
Trend FilterHigher TF alignment (e.g., above 200 EMA on D)
TimingWhen to execute (close of bar, limit order)

Quality check: Can a machine execute this without interpretation?

3. Exit Rules

Exit TypeExample
Stop Loss1x ATR below entry
Profit Target2x ATR from entry
Trailing StopTrail by highest high - 1.5 ATR
Time ExitClose after 10 bars if no TP/SL hit

Rule: Stop loss must be defined BEFORE entry. Risk-first thinking.

4. Position Sizing

MethodFormula
Fixed FractionalSize = (Equity × Risk%) / (Entry - SL)
Fixed LotSame size every trade
Volatility-BasedSize inversely proportional to ATR

Recommend 1-2% risk per trade for most traders.

5. Position Management

  • Scale In: Rules for pyramiding (if any)
  • Scale Out: Partial TP (e.g., 50% at 1R, rest at 2R)
  • Breakeven: When to move SL to entry

6. Risk Management

ParameterRecommended
Max Risk Per Trade1-2%
Max Daily Loss3-5%
Max Drawdown10-20%
Max Open Positions3-5

7. Expected Metrics

Set expectations BEFORE backtesting:

MetricTarget
Win Rate40-55%
Avg R:R1.5:1+
Max Drawdown< 25%
ExpectancyPositive

Expectancy = (WinRate × AvgWin) - (LossRate × AvgLoss)


Output Artifact

Generate strategy-spec.md using template in resources/strategy-spec-template.md.


Cross-References

  • Next Step: When design is complete → use coding-pinescript to implement
  • Input: Can be triggered after brainstorming-ideas for vague trading concepts