Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

Back to skills

Strategy Ab Test

ASecurity

Head-to-head strategy comparison — snapshot state, sweep params on strategy A, restore, sweep strategy B, then compare metrics side-by-side. Use when the user asks "which strategy is better?" or "A/B test these two".

6 stars
0 votes
0 copies
0 views
Added 9/20/2026
business

Security Analysis

A100/100

Scanned 9/20/2026

Install to Claude Code

$npx -y skills add FerroxLabs/murage --skill strategy-ab-test --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Strategy Ab Test?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Strategy Ab Test
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ferroxlabs-strategy-ab-test-murage/badge)](https://www.skillsdirectory.com/skills/ferroxlabs-strategy-ab-test-murage)

More formats (shields.io, HTML) on the badges page.

Download Zip
Files
SKILL.md
---
name: strategy-ab-test
description: Head-to-head strategy comparison — snapshot state, sweep params on strategy A, restore, sweep strategy B, then compare metrics side-by-side. Use when the user asks "which strategy is better?" or "A/B test these two".
license: MIT
---

# Strategy A/B Test

You are running two Pine strategies head-to-head on the same symbol/timeframe and reporting a data-backed winner.

## Step 1: Lock the Environment

The comparison is only valid if both strategies run on the same chart state.

1. `chart_get_state` — confirm symbol, timeframe, and chart type
2. `state_snapshot` with tag `abtest-baseline` — so you can roll back cleanly between A and B, and at the end

Example baseline: `ES1!`, `15m`, Candles.

## Step 2: Define What "Winner" Means

Ask the user (or use defaults) for the ranking metric. Common options:

- **Net Profit** — simplest, ignores risk
- **Sharpe Ratio** — risk-adjusted, preferred
- **Max Drawdown** — lower is better (use absolute value)
- **Profit Factor** — gross profit / gross loss
- **Composite** — rank each metric, sum ranks, lowest wins

Default: report all four, pick winner by **Sharpe**, break ties by **lower max drawdown**.

## Step 3: Run Strategy A

1. Load A's source: paste via `pine_set_source` (or `pine_open` if saved by name)
2. `pine_smart_compile` — auto-detect type, compile, surface errors
3. If errors: iterate via the `pine-develop` loop until clean
4. `strategy_sweep` — parameter sweep with cooldown + resume. Pass the param grid (e.g., `{ ema_len: [20, 50, 100], atr_mult: [1.5, 2.0, 2.5] }`)
5. Collect results — `strategy_sweep` returns per-combination `{net_profit, sharpe, max_dd, profit_factor, trades}`

Example — strategy A (trend-follow):

```
pine_set_source(<A source>)
pine_smart_compile()
strategy_sweep({ grid: { ema_len: [50, 100, 200], atr_mult: [1.5, 2.0] } })
```

Pick A's best row by the chosen metric. Record it.

## Step 4: Restore, Then Run Strategy B

1. `state_restore` with tag `abtest-baseline` — wipe A off the chart
2. Load B's source: `pine_set_source` + `pine_smart_compile`
3. `strategy_sweep` over B's param grid
4. Pick B's best row

Example — strategy B (mean-reversion):

```
state_restore({ tag: "abtest-baseline" })
pine_set_source(<B source>)
pine_smart_compile()
strategy_sweep({ grid: { rsi_len: [7, 14, 21], rsi_ob: [70, 75, 80] } })
```

If `strategy_sweep` pauses mid-sweep due to cooldown, it will auto-resume — just wait.

## Step 5: Compare Side-By-Side

Produce a metrics table:

| Metric | Strategy A (best) | Strategy B (best) | Winner |
|--------|-------------------|-------------------|--------|
| Net Profit | $8,420 | $6,110 | A |
| Sharpe | 1.42 | 1.78 | **B** |
| Max DD | -$2,100 | -$980 | B |
| Profit Factor | 1.65 | 1.89 | B |
| Trades | 84 | 142 | — |

Pull each row from each strategy's `data_get_strategy_results` for the best-params run.

## Step 6: Declare Winner + Caveats

- **Winner by default rule (Sharpe)**: Strategy B
- **Caveats**:
  - Trade count — if B has far more trades, is it over-trading? Factor commission
  - Regime — was the test window mostly trending or chop? A's edge may only show in trends
  - Robustness — check variance across the sweep, not just the single best row. Cherry-picked best params can overfit

## Step 7: Report + Cleanup

1. Show the table + winner call + caveats
2. `capture_screenshot` of the winning strategy loaded so the user has a visual
3. `state_restore` back to `abtest-baseline` if the user wants their original chart
4. Optionally `state_delete` the baseline snapshot once confirmed

## Error Notes

- `PINE_COMPILE_ERROR` — fix source, retry compile before sweeping
- `STRATEGY_SWEEP_COOLDOWN` — expected; the tool resumes automatically
- `CHART_LOADING` after restore — wait 1-2s and continue

Attribution

FerroxLabsFerroxLabs
View sourceMore from FerroxLabs →
SSkills DirectorySkills Directory

Your tool, in front of Claude Code builders.

3 founder slots · $299/mo · GSC-verified traffic · sponsors can never buy grades.

See placements

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Your tool, in front of Claude Code builders.

3 founder slots · $299/mo · GSC-verified traffic · sponsors can never buy grades.

See placements

Related Skills

Solution Architect

Designs system architecture, component specifications, and technical integration strategy. Use when: designing solutions, system architecture, technology stack, or integration approaches.

192 votes

Akorchak:Venture Assessment

Generate a comprehensive VC investment assessment report for a company

72 votes

Stock Analysis

Analyze stocks and cryptocurrencies using Yahoo Finance data. Supports portfolio management (create, add, remove assets), crypto analysis (Top 20 by market cap), and periodic performance reports (daily/weekly/monthly/quarterly/yearly). 8 analysis dimensions for stocks, 3 for crypto. Use for stock analysis, portfolio tracking, earnings reactions, or crypto monitoring.

6511 votes

Just Fucking Cancel

Find and cancel unwanted subscriptions by analyzing bank transactions. Detects recurring charges, calculates annual waste, and helps you cancel with direct URLs and browser automation. Use when: 'cancel subscriptions', 'audit subscriptions', 'find recurring charges', 'what am I paying for', 'save money', 'subscription cleanup', 'stop wasting money'. Supports CSV import (Apple Card, Chase, Amex, Citi, Bank of America, Capital One, Mint, Copilot) OR Plaid API for automatic transaction pull. Out...

6511 votes

Telegram Compose

Compose rich, readable Telegram messages using HTML formatting via direct Telegram API. Use when: (1) Sending any Telegram message beyond a simple one-line reply, (2) Creating structured messages with sections, lists, or status updates, (3) Need formatting unavailable via Clawdbot's Markdown conversion (underline, spoilers, expandable blockquotes, user mentions by ID), (4) Sending alerts, reports, summaries, or notifications to Telegram, (5) Want professional, scannable message formatting wit...

6511 votes
View all in business →