agentleFS
cecewu3cecewu3/agent-trading-skills/skills/backtest/SKILL.md

backtest

Skill0 starsChanged 12 days agoMITView on GitHub

Validate proposed entry/exit threshold or size changes against historical klines with fees and an out-of-sample window before going live. Use when the user wants to change take-profit, stop-loss, strength floors, or position sizes, or asks to backtest a rule. Trigger phrases: "backtest", "validate thresholds", "simulate on klines", "out-of-sample test", "before changing TP/SL".

6 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 6 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Before changing entry.* (including per-tier min_confidence / min_impact / max_risk and sell_min_confidence) or risk.* thresholds, simulate …

    line 16
  2. Very specific:

    Test: backtest.test_start → test_end (report this as primary)

    line 36
  3. Distinctive:

    No trades triggered → report "no signals".

    line 59
  4. Distinctive:

    Never hardcode personal threshold numbers in this skill.

    line 63
  5. Distinctive:

    Prefer out-of-sample honesty over flattering train metrics

    line 64

“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “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

Backtest

Overview

Before changing entry.* (including per-tier min_confidence / min_impact / max_risk and sell_min_confidence) or risk.* thresholds, simulate the rule set on historical candles. Include fees (backtest.fee_rate), split train vs out-of-sample test windows, and report metrics. This skill does not promise profitability—only disciplined validation.

When to use

  • User proposes new TP / SL / max-hold / strength / size values
  • Calibrating probe vs normal tiers
  • Regression check after judge rubric changes (replay saved news+labels if available)

Instructions

  1. Freeze candidate config — copy proposed values into a temporary config or CLI overrides; do not write live config.yaml until results reviewed.
  2. Download klines for symbols under test (interval backtest.kline_interval) from the venue's public market data API (Binance reference: /api/v3/klines or data mirror).
  3. Simulate
    • Apply entry rules when using a historical signal file, or a simplified proxy if only OHLC (document the proxy clearly)
    • Honor entry.min_confidence, per-tier min_confidence / min_impact / max_risk, and entry.sell_min_confidence when signals include those fields
    • Apply exits: risk.take_profit_pct, risk.stop_loss_pct, risk.max_hold_hours
    • Deduct fees each side using backtest.fee_rate
    • Enforce caps: risk.max_buy_quote, risk.max_total_cost_quote, and tier size_quote values
  4. Split
    • Train: backtest.train_start → train_end (tuning only)
    • Test: backtest.test_start → test_end (report this as primary)
  5. Report (JSON + short markdown): trade count, win rate, profit factor, max drawdown, fee drag, exposure time, vs buy-and-hold baseline on same window. Flag if test window is too short or sample size tiny.
  6. Gate — do not recommend promoting thresholds when out-of-sample is weak or statistically empty; ask user to decide.

Suggested CLI

python backtest.py --config config.candidate.yaml
python backtest.py --override take_profit_pct=X stop_loss_pct=Y

Project paths

PathRole
config.yaml / candidate filethresholds under test
backtest.pysimulator
data/reports/backtest-*.mdartifacts

Failure handling

  • Missing fee_rate → refuse to run (silent zero-fee backtests are misleading)
  • Incomplete klines → shrink window or abort with reason
  • No trades triggered → report "no signals"; do not invent fills

Guidelines

  • Never hardcode personal threshold numbers in this skill; always read config
  • Prefer out-of-sample honesty over flattering train metrics
  • Spot-only simulation; no leverage

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.