How the engine works
Fitness & metrics
The Fitness tab decides what the optimizer maximizes — a single named metric, or a weighted blend of several. This choice shapes every strategy the search produces, so it's the highest-leverage setting in the app.
The metric
The Metric dropdown offers:
| Metric | What it measures |
|---|---|
| Composite (production blend) — recommended | A risk-adjusted blend of return, risk, and consistency. The default and almost always the right choice. |
| Net profit | Total dollars won minus lost |
| Profit factor | Gross profit ÷ gross loss |
| Sharpe ratio | Return per unit of volatility |
| Sortino ratio | Return per unit of downside volatility |
| Win rate | Winning trades ÷ total trades |
| Expected value | Average P&L per trade |
| Average R | Average result as a multiple of the initial risk |
| K-ratio | Consistency of equity-curve growth |
| MAR ratio | Return ÷ max drawdown (annualized flavor) |
| Return / drawdown | Net profit ÷ max drawdown |
| Average daily profit | Mean P&L per trading day |
| Trades / day | Trading frequency |
Why Composite is the default
Single raw metrics are easy to game, and the optimizer will game them. The app warns inline when you pick a known foot-gun:
- Net profit rewards a few outlier wins or one late regime — classic overfit "lottery" curves that the validation gauntlet then marks Kill — and the score isn't comparable across runs with different date ranges.
- Profit factor is easily inflated by a handful of trades on a small sample. Pair it with a minimum-trades gate, or prefer Composite.
- Trades / day alone just maximizes how often the strategy trades, ignoring whether those trades make money. Use it as a small weighted-blend term to nudge frequency, never as the sole objective.
Weighted combination
Add rows under Weighted combination to optimize a blend: pick a metric from "add weighted term…", set its weight, remove with ✕. Adding any weighted term switches the run to the weighted form (the single Metric above is then ignored). A typical use: Composite-like behavior plus a small Trades / day term to pull the search toward a target frequency.
Soft-penalty targets
Four optional targets dock the Composite score when a candidate misses them — they shape the search without hard-rejecting candidates. Each has a target and a penalty weight (blank = engine default, shown as the placeholder):
| Target | What it does | Default weight |
|---|---|---|
| Min trades / day | Docks candidates trading less often than the target. | 1 per trade/day under |
| Min win rate | Docks candidates below a win-rate floor (enter a fraction, e.g. 0.55 = 55%). |
20 per unit of win-rate fraction under |
| Max entry-signal rate | Caps how often the entry condition fires, as a fraction of the flat bars it's checked on (0.3 = 30%). Stops "blind," always-true entries that open a position on the first available bar every time. |
12 per unit over |
| Max time in market | Caps the fraction of bars the strategy may hold a position (0.5 = in a trade at most half the time). Forces it to be flat and selective rather than always in the market. |
12 per unit over |
All four apply to the Composite metric only, and only bite when a target is set (blank or 0 = off).
Fitness vs. gates vs. validation
Fitness is what the search chases. Gates are floors a finished candidate must clear. Validation is the evidence gathered about the finalists. A high fitness score alone means nothing until the gauntlet has had its say — the verdict is the summary that matters.