# Search across markets

> Rank many perps against each other and hold the best long and the worst short, then search the scores and settings with a genetic search that never sees the holdout.

The strategies elsewhere in these docs trade the market they read. A **cross-sectional** strategy ranks many markets against each other: every few days it takes the most traded perps on Hyperliquid or Lighter, ranks them by a **score**, holds the top share long and the bottom share short, and pays fees and each market's funding.

## The score

A score is a line of Flowscript that publishes `metric("score", …)`, read on each market's daily bars. Momentum, skipping the last few days:

```text
const close = bars.close(market, interval);
metric("score", close[skip] / close[lookback + skip] - 1);
```

## Test one book

`backtest_rotation` runs one book over the platform's full perp history (every perp on each venue, delisted ones too, with daily candles and funding), and reports:

- its return on the training span and on a **holdout** it never saw;
- 20 random books and stale versions of it, as baselines;
- its **deflated Sharpe ratio**, marked down for every setting you say you've tried.

## Search

`start_strategy_search` runs a genetic search over scores, their arguments and the book (how many markets, how often to rebalance, how much long and short). It never sees the holdout.

Read the best result's **verdict** first: `promising` only when the holdout, the baselines and the deflated Sharpe ratio all agree, otherwise `not proven` or `no edge`, with reasons.

> [!WARNING] Report the holdout and the trial count
> A training-span Sharpe ratio on its own is the number a search is built to inflate. Quote the holdout and how many settings were tried beside any headline number, and paper-trade a result before money.
