# Sf Profit Factor

> Rank StrategyFactory strategies specifically by profit factor with sanity floors so PF outliers from tiny samples don't dominate. Use when the user asks "find high profit factor strategies / show me PF > 2 / which strategies have the best risk-reward / what's got the cleanest profit factor". Read-only.

- Skill: `daviddme/sf-profit-factor` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add daviddme/sf-profit-factor`
- Raw SKILL.md: https://api.skillmd.com/api/skills/daviddme/sf-profit-factor/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: daviddme (https://skillmd.com/u/daviddme)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/daviddme/sf-profit-factor

---


# sf-profit-factor

Profit factor is gross-profit / gross-loss. Above 1 means edge, above 1.5
is strong, above 2 is elite. This skill ranks strategies by PF but applies
sanity floors so a strategy with PF=8 over 5 trades doesn't beat one with
PF=2.5 over 800 trades.

## When to use

- "Find high profit-factor strategies on SF"
- "Show me PF > 2 with at least 200 trades"
- "Which strategies have the cleanest risk-reward profile?"

## Floors applied before ranking

- PF ≥ 1.2 (rejects everything below "real edge")
- Trades ≥ 30 (rejects tiny samples)
- Net profit > 0 (rejects "high PF but lost money" curveballs)

## Scoring (single-purpose, PF-heavy)

```
score = 0.70 * min(PF, 5) / 5       # PF capped at 5 so outliers don't dominate
      + 0.20 * (1 - drawdown/40)    # drawdown penalty
      + 0.10 * min(trades, 500)/500 # sample-size confidence
```

## How to run

```
python sf-profit-factor/pf.py \
  [--top N]                # default 10
  [--prescreen N]          # default 200
  [--min-pf X]             # default 1.5
  [--min-trades N]         # default 100
  [--max-drawdown %]       # default 30
  [--pair CSV] [--timeframe CSV]
  [--json]
```

## Output

Table sorted by raw PF (so the user sees what they came for), with the
sanity-aware score in the last column.

