agentleFS
qunyou-agentqunyou-agent/finance-skills/skills/trading/strategy-development/SKILL.md

strategy-development

Skill4 starsChanged 4 months agoMITView on GitHub

Designs and implements new trading strategies. Covers signal generation, entry/exit logic, position sizing, and risk management rules. Trigger when the user wants to create, modify, or formalize a trading strategy.

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Never use future data in signal calculation

    line 49
  2. Distinctive:

    Test on out-of-sample periods separate from optimization

    line 50
  3. Distinctive:

    Keep strategies explainable — complexity should be justified

    line 52

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Strategy Development

Helps design, implement, and formalize trading strategies.

Real Code Reference

  • tradinglearn/strategies/macd_strategy.py — Example: MACDStrategy with generate_signals(data) -> DataFrame
  • tradinglearn/pytdx2/backtest.py — BaseStrategy with buy_condition() / sell_condition() / update_position()
  • tradinglearn/pytdx2/evftrade/BaseStrategy.py — Abstract BaseStrategy with buy_condition(price, time) / sell_condition(price, time)
  • tradinglearn/pytdx2/macd_strategy.py — MACDStrategy(BaseStrategy) implementation
  • tradinglearn/pytdx2/large_trade_model.py — LargeTradeStrategy with risk controls

Process

  1. Requirements — timeframe, instruments, risk tolerance, return targets
  2. Signal logic — entry conditions, exit conditions, filters
  3. Position sizing — fixed fraction, Kelly criterion, volatility-based
  4. Risk management — stop-loss, take-profit, trailing stops
  5. Implementation — code as a class with generate_signals(data) -> DataFrame
  6. Validation — walk-forward analysis, out-of-sample testing, overfitting checks

Strategy Template (follow tradinlearn convention)

class MyStrategy:
    def __init__(self, param1=default, param2=default):
        self.param1 = param1
        self.param2 = param2

    def generate_signals(self, data: pd.DataFrame) -> pd.DataFrame:
        """Return DataFrame with 'position' column: 1=long, 0=flat, -1=short."""
        signals = pd.DataFrame(index=data.index)
        signals['position'] = 0
        # ... signal logic using data['close'], data['volume'], etc.
        return signals

Key Principles

  • Never use future data in signal calculation
  • Test on out-of-sample periods separate from optimization
  • Account for transaction costs and slippage in backtest
  • Keep strategies explainable — complexity should be justified

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.