The Minerva Strategy Builder
What the builder is
Minerva tests trading strategies on historical US stock prices.
You describe a strategy or trading idea in your AI chat (Claude, ChatGPT, Muse, Kimi, or otherwise).
Minerva turns your idea into rules using the Minerva engine and saves it.
Minerva can then test it on past prices.
Tests cost credits, which are bought on minerva1.com.
The simplest and cheapest starting point is a normal backtest. But Minerva's power lies in its ability to do Optimizations, or collections of backtests that either fine-tune your strategy automatically, give you a statistical understanding of whether your strategy is luck or edge, or both.
After performing a backtest and an optimization, you also have the option of running Reports. The Full report gives you a complete picture of your strategy: everything an institution needs to know about it before committing capital to it. The How it works report draws what each step of your strategy does.
Sections 01 to 04 cover what you need to build and test a strategy. Sections 05 to 17 are for advanced users.
01Set up Minerva Connect
Minerva Connect is Minerva's MCP server. MCP is the standard an AI assistant uses to call outside tools. Connect gives the assistant Minerva's tools: read the module library, save strategies, quote and start runs, read results.
- Add the connector. In Claude: Customize → Connectors → + → Add custom connector. Paste
https://connect.minerva1.com/mcp. - Sign in. Google or email, on Minerva's login screen. Accept the terms. This is the same account as minerva1.com, with the same credits. No paid Minerva plan is needed.
- Credits. Runs draw on the account's Minerva credits, which are bought on minerva1.com. Credits are usable at once.
- Results. Minerva emails a link when a run finishes. Run history and reports are at
connect.minerva1.com/resultsand in the Lab at minerva1.com.
Claude always quotes a run first and waits for your yes before starting it.
Apps that ask for a token instead of a sign-in (Muse). Get a personal token at connect.minerva1.com/connect/personal. Paste it into the app's credential prompt. Never paste it into the chat.
02Describe a strategy
Type the strategy into your AI chat in plain words.
Say which stocks to trade, when to buy and when to sell. Claude fills in any number you leave out and shows every setting it used. If Minerva cannot build part of the strategy, Claude says which part and why.
Four requests, simple to complex
- "Buy SPY when its 50-day average crosses above its 200-day average. Sell when it crosses back below."
- "Buy SPY when its 2-day RSI falls below 10. Sell when the RSI rises above 80."
- "Every month, hold whichever of SPY and EFA had the higher 12-month return. If AGG's 12-month return is higher than SPY's, hold AGG instead."
- "Every month, hold the 10 stocks with the biggest 6-month price gain among the 500 largest US stocks, in equal amounts."
- Stocks. One ticker, a short list of tickers or funds, or the 500 largest US stocks. The 500-stock list is the top 500 holdings of the iShares Russell 3000 ETF. It changes over time: on each date it holds the 500 that were largest on that date.
- Prices. Daily or hourly. Daily prices start 2005-01-03.
- Numbers. Claude writes each number you give as a range around it, and an optimization searches the ranges for the best values (Section 04). You can give a range yourself, such as "try 20 to 90 days". A number stays fixed only when you ask for that, for example "test it exactly as written".
03Build and Backtest
The first request above, from start to finish.
- Ask. "Buy SPY when its 50-day average crosses above its 200-day average. Sell when it crosses back below. Test it exactly as written, on all the history you have."
- Build. Minerva turns the request into rules and saves the strategy to your account. Every number stays as written, because the request asks for that.
- Price. Claude quotes the backtest: 2 credits. Nothing runs until you say yes.
- Backtest. Minerva tests the strategy from 2005-10-19 to 2026-06-16 with $100,000. It starts 2005-10-19, the first day with enough earlier prices for the 200-day average.
- Result. Claude summarizes the result and gives the link to its result page.
Result: Sharpe Ratio 0.71. $100,000 became $581,622 after costs, 8.9% a year. Worst drop: −33.2%. SPY held throughout returned 11.4% a year before costs, with a worst drop of −55.1%.
What the numbers mean
| On the page | Meaning |
|---|---|
| Sharpe | The average of the account's own daily returns divided by how much they swing, on a yearly scale, with the swing widened when good or bad days come in runs (the Newey-West correction). Higher means steadier growth. |
| Cum. return | The total gain over the whole test. |
| CAGR | The average growth rate per year, compounded. |
| Max drawdown | The largest fall from a high to a later low. |
| Final equity | What the $100,000 at the start was worth at the end, after costs. |
| Trades, winners, losers | Completed purchases and sales. A winner ended with a profit. |
| List, equal weight | The list's members on each date held in equal amounts, rebalanced every bar, before costs, over the same dates. Here the list is SPY alone: SPY held throughout. |
Every run stays in your account at connect.minerva1.com/results.
04Optimizations and Reports
The steps after a backtest. Claude quotes each one in credits before it runs.
Optimization
An optimization is a collection of backtests. Claude writes each number as a range around it, or you give the range, such as "try 21 to 252 days". Minerva tests the values in the ranges on the earlier dates and picks one setting. It then tests that setting on the last part of the dates, which the search did not use. It grades that result with a LuckFactor, how lucky its Sharpe Ratio is (lower is better), and a RobustGrade, whether the strategy carries signal or only noise (0 to 99, higher is better). The Luck and Robustness Measures Reference Guide explains both.
Example: a strategy on 11 funds: SPY, IWM, EFA, EEM, TLT, IEF, LQD, TIP, GLD, VNQ and DBC. At each month end it holds a fund long if its price momentum is above zero and short if it is below zero. Each fund is sized by its volatility over the last 60 days. The request asks to search only the momentum window, from 21 to 252 days in steps of 21, and to keep every other number as written. The search runs from 2006-01-04 to 2026-06-16. Price: 16 credits.
Result: the search chose a 105-day window. On the dates the search did not use, 2021-09-29 to 2026-06-16: Sharpe Ratio 0.19, 0.7% a year after costs. The same 11 funds held returned 6.7% a year before costs.
Reports
A report is a study of one strategy that Minerva runs and writes up. It needs a strategy with at least one range.
| Report | What Minerva does | Price |
|---|---|---|
| Full report | Minerva's full strategy report runs several optimizations on one strategy, then many focused backtests around the best region they find, and names up to three best candidate strategies. Result: a twelve-section report page and data files. | 1,800 credits |
| How it works | Minerva runs each step of the strategy on a made-up list of stocks and draws what it does, and what changing each setting does. No dates, market data or results. Result: a three-figure report page and a summary file. | 6 credits |
- Reports use daily prices. The Full report needs at least 5,175 trading days, about 20.5 years.
- Each report has one price, the same for every strategy, window and universe (Section 16).
- Cancelling a backtest or optimization refunds it. A report that fails, or that you cancel before its computation starts, is refunded in full; one you cancel after its computation starts keeps the approved charge.
05How a strategy is built
Connect shows five inline screens in Claude: the module library (list_strategy_modules), a saved strategy (save_strategy, get_strategy), the start screen (get_started), a strategy's ways to run (quote_strategy_options) and a run's report (get_run_report). Every other tool returns text and data. Hosts without inline screens receive the same content as text. The screens in Sections 06 to 09 are the first two of those inline screens, running on this page with Minerva's answers for each example. A finished run opens on Minerva Connect's results page, shown in Section 03.
Terms
| Term | Meaning |
|---|---|
| Bar | One time step of price data: one trading day (1 day bars) or one hour (1 hour bars). All windows and periods are counted in bars. |
| Universe | The list of stocks the strategy may trade. |
| Point-in-time universe | A universe whose members change over time. On each date it holds only the stocks that were members on that date. |
| Setting | A value a module needs, such as a window length or a number of stocks. |
| Searched setting | A setting given as a range instead of one value. Minerva tests values in the range. |
| Backtest | One historical test of a strategy, at one frozen choice of its settings, over a chosen stretch of dates: the trades it made, its value over time, and its results. |
| Optimization | A search for a strategy's best settings. Every parameter in a strategy is parsed out so that a series of backtests can be performed by sweeping through the values of all its parameters. Furthermore, Minerva splits past dates into a development period (and, further even more, performs Combinatorially Purged Cross-Validation, or CPCV, on this development period) and then a subsequent "future" holdout period. The optimization performs tens of thousands of backtests using a genetic search across many parameter settings during the development period, picks one and freezes it, then tests that one setting once on the holdout period. Optimizations deliver a LuckFactor™ and a RobustGrade™ in addition to Sharpe and other performance and robustness measures. |
| Quote | The price and estimated run time of a request. Free. Nothing runs. |
| Report | Minerva's full strategy report runs several optimizations on one strategy, then many focused backtests around the best region they find, and names up to three best candidate strategies. Each candidate gets every measure and score in the Luck and Robustness Measures Reference Guide, the MinervaScore among them, and a thorough analysis based on the millions of backtests across many optimizations that the report performs. |
A strategy is a column of modules read from top to bottom. Each bar, Minerva works down the column for every stock in the universe.
The ten module families
| Family | Modules | What it does | Examples |
|---|---|---|---|
| Rankings | 101 | Gives each stock a number on each bar. 54 are Minerva catalog signals. | Price momentum · Return volatility · Distance from the closing high · A dataset factor |
| Series | 4 | Builds price lines and arithmetic for later modules. | Price channel · Combine series · Bar prices |
| Filters | 78 | Removes stocks for that bar. | Top percent · Dollar-volume floor · Signal is on · From one event until another · True on at least K of the last N bars |
| Market | 8 | Turns the whole strategy on or off. | Universe above its moving average · Calendar window · A symbol's ranking above or below · Breadth of a universe |
| Trade signals | 67 | Requests a purchase on the bar an event happens. | Signal switches on · Breakout · Moving-average cross · Scheduled trade |
| Rotation | 8 | Decides which stocks are held. Exactly one per strategy. | Hold the top N · Hold in N slots · Pairs · Buy every signalled stock in equal parts |
| Weights | 9 | Splits the money among holdings. One per strategy. | Equal · Inverse volatility · Risk parity · Market-cap weights · Inverse beta |
| Constraints | 4 | Caps holdings or sizes the two sides. | Cap per stock · Cap per universe · Beta-balanced sides · Exposure |
| Risk | 11 | Protects positions or the account. | Stop loss · Trailing stop · Circuit breaker · Hold a fund when no stock is held |
| Exits | 9 | Sells positions in trade-signal strategies. | Sell after N bars · Signal switches off · Not up X% after N bars · All of these steps pass |
Two kinds of account
- Re-ranked (schematic kind
schedule). The rotation re-ranks the remaining stocks on a fixed schedule and holds the best. Rotations: Hold the top N, Hold every stock still in, Keep until it ranks below M, Pairs. - Trade signals (schematic kind
events). A trade-signal module requests purchases. The rotation fills free slots. Exits and stops sell. Rotations: Hold in N slots, Trade signals with periodic rebalancing, Short entries on trade signals, Buy every signalled stock in equal parts.
Some modules work in only one kind. Each module states its fit in the library. Minerva refuses a strategy that mixes them (Section 09).
Fixed facts
- Bar sizes: 1 day, 1 hour.
- Decisions are made at a bar's close from that bar's completed prices. Entries and exits fill at the next open, the next bar's VWAP (volume-weighted average price) or the next close. Within a bar, fills run open, then VWAP, then close, and an exit never fills later in the bar than its entry. Allowed pairs (entry/exit): open/open, VWAP/open, VWAP/VWAP, close/open, close/VWAP, close/close.
- Universes: one point-in-time universe (the top 500 holdings by weight of the iShares Russell 3000 ETF, from 2005), 43 industry-group universes, Minerva's named lists and your own saved lists.
- Funds a strategy may hold when it holds no stock: TLT, IEF, SHY, AGG, GLD.
- Daily data starts 2005-01-03.
Beta to SPY: Inverse beta and Beta-balanced sides
Two account modules read each stock's beta to SPY (SPY is the only choice today). Each works on its own; a strategy can use one, the other or both. Both read SPY's bars, which the run binds itself, and the results name SPY.
- Beta. Beta = Cov(stock, SPY) / Var(SPY) of one-bar returns over the last beta window bars, sample (n − 1), the same arithmetic as the Benchmark hedge. The window runs from 21 to 504 bars and starts at 252 (252 sessions on daily bars).
- Lowest beta. Both cards have a Lowest beta in steps of 0.05, starting at 0.30: from 0 to 1 on Beta-balanced sides, from 0.05 to 1 on Inverse beta. A beta below the lowest beta, a negative beta included, counts as the lowest beta: the stock stays in and is sized as if its beta were the lowest beta, so a stock whose beta is near or below zero never takes almost a whole side. A stock without a full window of returns has no beta and is skipped at that re-rank, and the next-ranked stock takes its place. Each decision counts the stocks sized at the lowest beta and the stocks skipped.
- Inverse beta (Weights). Evens out beta within each side: each stock's weight within its side is (1 / beta) ÷ the sum of (1 / beta), so every stock in a side holds the same beta-dollars. It does not balance one side against the other: each side keeps half the account, so a long and short book is no closer to beta neutral than equal weights. To balance the sides, add Beta-balanced sides; with both and the same number of stocks on each side, every position holds the same beta-dollars. Its card's Beta window and Lowest beta are the ones both cards read. Long only, short only or long and short.
- Beta-balanced sides (Constraints). Long and short strategies only. Its target n, short beta-dollars per long beta-dollar, runs from 0.5 to 2.0 in steps of 0.01 and starts fixed at 1.00 (beta neutral); every re-rank sizes the book to n. Each side keeps its own weights a: with β_L = Σ a·β over the longs, β_S over the shorts and G the account the two sides would hold without the module, the longs take L = G·β_S / (β_S + n·β_L) and the shorts S = G·n·β_L / (β_S + n·β_L). A stock cap or a universe cap holds a stock (or a universe) at its cap and gives the rest of its side's budget to the side's other stocks; then one side is scaled down so the book is back on n. No cap is exceeded, the other side keeps its budget and what is not placed stays cash. A volatility target and a hedge apply afterwards. A side with no stock left leaves both sides in cash, and its sales say why. Taken with every relative weighting; not with a fixed share per fund, the volatility budget or position sizing, which set dollar amounts directly. With Inverse beta weights the sides card has no window or lowest beta of its own.
- Rebalance band. The sides card's Rebalance band is on with a low and a high, from 0.5 to 2.0, starting at 0.95 and 1.05, with low ≤ n ≤ high. It is a trigger, not a search range. A ratio r is a book net long by (1 − r) of its long beta-dollars, so 0.95 to 1.05 is 5% net long to 5% net short. At each close between re-ranks the book's short beta-dollars per long beta-dollar is measured, hedge and park rows left out, each stock at its beta at that close (a held stock without one at its last beta). Outside the band, every holding is resized at the next open so the book is back on n, with the long plus short dollars and each side's proportions kept; those orders say Back onto the beta target. The band is checked at a close and traded at the next open, so it narrows the ratio's range without keeping the book inside it. With the band off, the book is balanced at re-ranks only. Not taken with Overlapping cohorts, which balance each cohort at its start.
- What a run shows. Each re-rank's Why this trade line gives the target long and short dollars, beta-dollars and ratio, and the book the account held at the next close. The account summary gives the target, names SPY, and gives the median and range of the ratio held and, with the band, the share of closes outside it and the number and traded value of band rebalances; the results list each band rebalance with its ratio before and at the next close. The decisions download carries the same values.
Overlapping cohorts: rebalanced or drifting
Overlapping cohorts (Risk) start a cohort at every re-rank and keep it for the set number of re-ranks K. Each cohort holds up to the stocks held on each side, so K cohorts can hold up to K times that many on a side.
- Rebalanced at every re-rank (the card's first choice). Each stock's target is the live cohorts' average weight, and at every re-rank every holding is resized to that weight of the account's equity then. A re-rank whose market condition is off picks nothing and starts a cohort of cash: its share stays cash until it ends, while older cohorts keep their weights until they end. A stop sells the stock and removes it from every cohort. With filters checked every bar, a stock whose steps turn off between re-ranks is sold, and the older cohorts' weight buys it back at the next re-rank.
- Let cohorts drift. Each of the K cohort slots is an account of its own, with its own quantity of each stock and its own cash, starting with the starting capital ÷ K. A cohort keeps the quantities it bought until its end: an untouched cohort never trades as prices move, and a cohort never lends cash to another. At a re-rank the cohort K re-ranks old ends, and the new cohort invests that slot's value at the deciding close in every one of this re-rank's targets, bought at the next fill with whole shares. Cohorts may hold opposite sides of one stock: the account holds the sum of the cohorts' quantities, which can be exactly zero, and a new cohort's order nets with the others' into one order. Stops, the circuit breaker, a sale between re-ranks, a list departure, a payout and the end of the test sell the account's position, which closes every cohort's quantity in that stock, long and short, at that fill: each cohort receives its quantity at the fill price and the order's costs split among the cohorts on the account's side. A split scales every cohort's quantity. Dividends, payments in lieu and spin-off credits split by the cohorts' quantities when they are booked (the last holders' once the account no longer holds the stock), so a cohort short a stock pays its part; a stock the cohorts hold at exactly zero pays and receives no dividend. Borrow fees are charged on the account's short only and split among the cohorts that are short. A fee settlement splits as its order. Not taken with Rebalance when a holding drifts from its share, a benchmark hedge, a park fund or position sizing, which size from the whole account. With a beta feature each cohort is balanced at its start; its beta can move away from those targets as prices move.
- Account size. Each cohort holds part of the account in whole shares, so a small account leaves a visible part of each cohort in cash: five cohorts of 50 stocks a side on $100,000 buy about $200 a position.
- What a run shows. With drifting cohorts the results list each cohort's slot, start and end sessions, capital and current long and short value, and with a beta feature its start beta-dollars.
Exposure: each side's size and a limit on long plus short
Exposure (Constraints) sets how much of the account each side holds and lets the account hold more than its equity, up to a limit. It works in strategies that re-rank, with the weights Equal, Inverse volatility, Risk parity, Inverse beta, Market-cap weights and Weights by rank. A strategy without the card holds each side at 100% of equity ÷ the number of sides it trades, at most 100% in all.
- Long and Short (% of equity). From 1 to 200 in steps of 1, starting at 100; a long-only strategy has only Long, a short-only strategy only Short. Each side's stocks together target that percentage of the account's equity at the re-rank: each stock at its side's percentage ÷ the stocks held (Hold every stock still in: ÷ the stocks it holds), weighted within the side by the weights card. A stock cap or a universe cap holds a stock at its cap and gives the rest of its side's percentage to the side's other stocks. With Beta-balanced sides, Long + Short is the total that Beta-balanced sides divides between the sides by beta.
- Benchmark hedge on top. With a Benchmark hedge, the hedge shorts SPY at the stocks' beta times their dollars on top of the long side. Without Exposure, the hedge shrinks the stocks to make room: a long side of beta b ends at 1 ÷ (1 + b) of equity.
- Long plus short, at most (% of equity). From 100 to 200 in steps of 1, starting at 200; each side's percentage must be at or below it, over every searched value. 200% is Alpaca's overnight buying power at its 50% initial margin. When a re-rank's targets, the hedge included, add up to more than the limit, every target is multiplied by the same factor so the total is the limit, which keeps the net beta, and the re-rank says it was scaled down. A hedged basket of beta 1.3 at 200% asks for 100% long and 130% SPY short, 230% in all, and holds 200 ÷ 230 of each: 87% long and 113% short.
- Borrowing. A purchase may take the account's long plus short value up to the limit times the account's value at that fill's prices, less the purchase's own costs; a fill the limit cuts short says "Not enough buying power". Above 100% the cash can fall below zero: an account long 150% holds cash of −50% of its equity. Financing (Section 11) charges the equity the reference rate plus the spread, and the cash earns the reference rate, so a negative cash pays the reference rate; Alpaca charges its margin rate, 6.50% a year for non-elite accounts, on the end-of-day debit. A beta-hedged long at a beta below 1 borrows no cash: the SPY sale's proceeds stay in the account.
- Net beta. Each re-rank records its targets' net beta to SPY: Cov(targets' return, SPY's return) / Var(SPY's return) of one-bar returns over the last beta window bars, sample (n − 1), the Benchmark hedge's arithmetic. The Beta window runs from 21 to 252 bars and starts at 63; with a Benchmark hedge the card reads the hedge's window instead, so a hedged strategy records a net beta near 0. The net beta is not measured at a re-rank where a target or SPY lacks a full window. The run reads SPY's bars itself.
- Equity at zero. An account with Exposure whose equity at a close falls to zero or below sells every position at its next fill and trades no more; the results name the session. Margin calls are not modeled: a broker can sell positions as soon as the equity falls below its maintenance requirement (Alpaca's: 30% of a long's value above $6 a share), while the backtest holds the positions until the strategy's own rules sell them or the equity reaches zero.
- Not offered in strategies that buy on trade signals; not with Position sizing, A fixed share per fund or Volatility budget per stock, which set dollar amounts directly; and not with Let cohorts drift, whose cohorts each size from their own cash.
- What a run shows. The rule row names the sides' percentages, the limit and the beta window. Each re-rank's Why this trade line gives the long, short, gross and net dollars, the gross as a percentage of equity, the net beta and, when the limit scaled the targets, the percentage they came to before it. The account summary counts the re-ranks scaled to the limit. The decisions download carries the same values.
Symbols read without trading
A symbol's ranking above or below can name any priced symbol, a member of the strategy's universe or not. A symbol that is not a member is read and never traded: it is never ranked against the universe, selected, sized or part of the benchmark, and it adds one stock's bars to the run's price. Such a symbol takes the rankings computed from one stock's own bars; a ranking that compares stocks with each other has no value for it, and Minerva refuses the strategy with the ranking's name.
The card can also divide one symbol by another, for example HYG divided by IEF. On each bar where both symbols printed, the value is HYG's close ÷ IEF's close. A ranking that reads earlier closes of the ratio first puts each symbol's earlier close in that symbol's current share basis, so a split in either symbol leaves the ratio continuous. A ratio has closes only, so a ranking that reads opens, highs, lows or volume is refused for it.
Breadth of a universe
Breadth of a universe (Market) turns the strategy on or off by the share of a universe's stocks, or of its dollar volume, that is advancing, declining, above its N-bar average, at its N-bar high or at its N-bar low, against a level; or by that share's rise, in points, from its lowest value over the last M bars. The universe is picked with the same picker as the strategy's own universe: a named list, a point-in-time universe or an industry group. It need not be the strategy's own universe.
A stock counts on a bar when the bar is inside its membership (a point-in-time universe's dates; every bar of a named list), it printed on that bar and it has the closes the measure reads, each earlier close in the bar's share basis. Advancing and declining shares leave out the stocks that closed unchanged. Count weighting counts each stock once; dollar-volume weighting counts the bar's close times its volume.
A universe other than the strategy's own is frozen at the quote, as a point-in-time universe is: its members over the run's dates. The run reads each member's prices one at a time for the shares; a member is never ranked, selected, traded or part of the benchmark. A member without prices in the run's dates is left out of that universe's shares, not out of the strategy's universe. A backtest's price counts each member's bars like a stock of the universe; an optimization's price adds the time to read every member once. Paper trading reads the breadth of named lists, every member each session; it doesn't read the breadth of point-in-time universes or industry groups yet.
Conditions held over a window of bars
Three cards each hold exactly one filter or market condition.
- True on at least K of the last N bars (Filters). On a bar, the held condition was true on at least K of the N bars ending that many bars back (0: ending at the bar), for example "on at least 1 of the 10 bars before today". A stock condition counts the stock's own printed bars, a market condition the account's bars. Before the window exists the card is off, and K above N is never true. K and N can be searched.
- True at least K times since entry (Filters, inside an exit's All of these steps pass). On a bar, the held condition was true on at least K bars since the position's entry, within the last N bars when a window is set. An entry at a bar's open counts that bar's close; an entry at a close starts with the next bar. The entry is the bar the position opened, from flat or from the other side; resizes and re-ranks keep it. In a re-ranked strategy, a stock sold by an exit holding this card is not bought again on that side until the strategy's rules stop wanting it there (it fails a step, leaves the picks, or the market condition turns off).
- Buy again only after (Trade signals, after the strategy's trade signals). A stock starts armed. After a purchase of the stock fills, the strategy does not buy it again until the held condition has been true at the close of a bar after the purchase's fill bar; that close re-arms the stock, whether or not the position is still open. A stock condition is read for that stock, a market condition for the account.
Exits: delays, the card each sale names, buying after a stop
- Exit delay. Every exit card has an exit delay of D bars, 0 to 63, which can be searched. An exit that fires at the close of bar j sells at the strategy's exit fill after the close of bar j + D (0: at the next exit fill). Bars count the stock's own printed bars in a trade-signal strategy and the account's bars in a re-ranked strategy. The position stays held until that fill unless another exit, a stop or the stock rotation sells it first, and the exit firing again never moves a sale already due.
- The card a sale names. A sale by an exit card names that card, in the trades and the holdings. When several exit cards fire at one close, the sale names the first of them in the strategy's exits list, and a stop that sells at a close comes after the exit cards. All of these steps pass may appear more than once, each its own card in the exits list's order.
- Stop at a price line. Its After buying choice keeps the stop on the line (it follows the line bar by bar) or holds it at its level at the buying decision. A stop that sells at a close sells at the strategy's exit fill: the next open, or the next close when exits fill at the next close. Such a stop takes an exit delay.
- After a stop (Hold in N slots and the other trade-signal rotations). With Next bar, a stock that a stop or a profit target sold within a bar is not bought at that bar's close. With Same close, the stock is flat at that close and may be bought on an entry signal decided there.
Calendar and cross-section cards
- Scheduled trade: months. With months listed, the trade buys only on its rule's sessions in those months, for example the 5th-to-last session of December. With no months listed, it buys in every month.
- Return so far this period (Rankings). The stock's close over its last close of the previous week, month, quarter or year, less 1, both in today's shares: the year-to-date return for a year. A stock that did not print in the previous period has no value.
- At least N printed bars (Filters). Keeps a stock that printed on at least N bars up to and including the bar.
- In the top or bottom part of the stocks (Filters). With n the stocks still in that have a value of the ranking, and each stock's rank from the chosen end (1 at that end; tied stocks share their best rank), the card keeps a stock when parts × rank ≤ kept × n. The bottom 1 of 10 parts of 2,700 stocks keeps the worst 270; the bottom 1 of 3 parts keeps the lowest third.
- All of these selections (Filters). Two or more lists of steps, each run from the stocks in before the group. A stock passes when every list keeps it, so a part or a percentile in one list is measured across the same stocks as in the other.
- Buy every signalled stock in equal parts (Rotation, trade signals, long). At each decision it buys every signalled stock not already held. The account's equity at the deciding close, less the positions that decision keeps, is split equally among those stocks. Each order is good for its fill bar only: an order whose stock does not trade on that bar is cancelled, and its share stays in cash.
06Example 1: three modules
A monthly momentum rotation. Its three numbers are searched around the request's values, so it runs as an optimization.
Every month, hold the 10 stocks with the biggest 6-month price gain among the 500 largest US stocks, in equal amounts.
Connect tool: list_strategy_modules
The module library screen. Tabs are the ten families. Click a module to see its settings and ranges.
The assistant matches each phrase to a module:
| Your words | Module | Setting |
|---|---|---|
| 500 largest US stocks | Universe: iShares Russell 3000 ETF equity holdings (Top 500 by Weight) | point in time, 500 members |
| biggest 6-month price gain | Price momentum, tagged A | Window ↔ 63–189 bars by 21 (7 values), around 126 |
| hold the 10 | Hold the top N, ranked by A | Stocks held ↔ 5–15 by 5 (3 values), around 10 |
| every month | Hold the top N | Re-rank every ↔ 14–28 bars by 7 (3 values), around 21 |
| in equal amounts | Equal | none |
Connect tool: save_strategy · "Monthly momentum, top 10"
The same answer as text. Hosts without inline screens show this:
Monthly momentum, top 10 · 1 day bars · 3 searched · 63 settings
Universe: iShares Russell 3000 ETF equity holdings (Top 500 by Weight) (point in time, 500 members)
Rankings ┌ Price momentum [A] · Window ↔ 63–189 by 21 (7 values) · compare universe · better higher
Rotation ├ Hold the top N · Check filters every_bar · Stocks held ↔ 5–15 by 5 (3 values) · Re-rank every ↔ 14–28 by 7 (3 values) · Weight of A 100 weight · side long_only · priority rank · Rank by A 100
Weights ├ Equal
Exits └ Sells a stock that ranks out of the top N at a re-rank
Warmup 190 bars · longest hold 0 bars
https://minerva1.com/app/backtester/builder?strategy=2ec65d1baf9fc8fd564d1fd18c231afe770013d0419d9e66fe3e36fa4000c1ac
An optimization of this strategy searches 3 settings. Fixed numbers, which an optimization never searches: Hold the top N · Weight of A 100 weight.
- "Sells a stock that ranks out of the top N at a re-rank" is part of Hold the top N. It is not a separate module.
- 3 searched settings: 7 window values × 3 holdings values × 3 re-rank values = 63 settings.
- Weight of A stays 100: the rotation ranks by A alone, so no other weight changes the trades. The line under the schematic names every fixed number.
- Warmup 190 bars: the strategy needs 190 bars of history before its first decision, the longest searched window (189) plus 1.
- The id at the end of the link is the strategy's identity. Saving the same strategy again returns the same id.
- See the options asks the assistant for every way to run the strategy, each with its credits and time. Open in Lab opens the strategy in the builder at minerva1.com.
07Example 2: six modules
Purchases on a signal event, with a trend filter, a stop and a timed exit. Seven numbers are searched, so it runs as an optimization.
From the 500 largest US stocks, buy a stock when the Classic Wilder RSI signal switches on (14-bar RSI, oversold at 30), but only if the stock is above its 200-day moving average. Hold at most 10. Sell after 10 days or at an 8% loss.
Connect tool: save_strategy · "RSI dips above the 200-day average"
| Your words | Module | Family |
|---|---|---|
| above its 200-day moving average | Distance from moving average, Window ↔ 150–250 by 50 around 200, tagged A | Rankings |
| (the "above" part) | Ranking above or below a level: reads A, above a level ↔ −0.02–0.02 by 0.02 around 0 (2% below to 2% above the average) | Filters |
| when the RSI signal switches on | Signal switches on: Classic Wilder RSI Extremes, RSI period ↔ 10–18 by 4 around 14, oversold ↔ 28–32 by 2 around 30 | Trade signals |
| hold at most 10 | Hold in N slots, Stocks held ↔ 5–15 by 5 around 10, ranked by A | Rotation |
| at an 8% loss | Stop loss ↔ 6–10% by 2 around 8% | Risk |
| sell after 10 days | Sell after N bars ↔ 5–15 by 5 around 10 | Exits |
RSI dips above the 200-day average · 1 day bars · 7 searched · 2187 settings
Universe: iShares Russell 3000 ETF equity holdings (Top 500 by Weight) (point in time, 500 members)
Rankings ┌ Distance from moving average [A] · Window ↔ 150–250 by 50 (3 values) · compare universe · better higher
Filters ├ Ranking above or below a level [reads A] · Comparison above · Level ↔ -0.02–0.02 by 0.02 (3 values)
Trade signals ├ Signal switches on: Classic Wilder RSI Extremes · Rsi period ↔ 10–18 by 4 (3 values) · Oversold ↔ 28–32 by 2 (3 values) · Overbought 70 value · Min forecast abs 5 value · signal classic_wilder_rsi_extremes@1.0.0
│ Buy: the stock that triggered the event
Rotation ├ Hold in N slots · Stocks held ↔ 5–15 by 5 (3 values) · Weight of A 100 weight · priority rank · Rank by A 100
Weights ├ Equal
Risk ├ Stop loss · Loss (%) ↔ 6–10 by 2 (3 values)
Exits └ Sell after N bars · After ↔ 5–15 by 5 (3 values)
Warmup 250 bars · longest hold 15 bars
https://minerva1.com/app/backtester/builder?strategy=087b9c6ff7c857db335163bcc1fbf3093bb561bbb046ef45f4b5486a7165ef5f
An optimization of this strategy searches 7 settings. Fixed numbers, which an optimization never searches: Signal switches on: Classic Wilder RSI Extremes · Overbought 70 value; Signal switches on: Classic Wilder RSI Extremes · Min forecast abs 5 value; Hold in N slots · Weight of A 100 weight.
- Kind
events: purchases come from the trade signal, not from a schedule. - 7 searched settings, 3 values each: 3 × 3 × 3 × 3 × 3 × 3 × 3 = 2,187 settings.
- Three numbers stay fixed, because no other value would change the trades. Overbought 70 sets the signal's short side, which a strategy that buys when the signal switches on never uses. The signal's forecast is 20 whenever it is on, so every Min forecast abs from 0 to 20 lets the same purchases through. The rotation ranks by A alone, so the weight of A stays 100.
- Longest hold 15 bars, the longest searched value of Sell after N bars. Warmup 250 bars, set by the longest searched moving-average window.
- Weights were not stated. Minerva added Equal.
- "Buy: the stock that triggered the event" is the purchase rule. Other rules buy a member of the stock's industry group instead.
08Example 3: eight modules
A market gate, two filters, a ranking, a rotation, weights, a cap and a stop. Eleven numbers are searched, so it runs as an optimization.
From the 500 largest US stocks, trade only while the universe is above its moving average; test 100 to 250 days in steps of 50. Skip stocks with under $20M of average daily dollar volume over 20 days. Rank by price momentum leaving out the latest 21 days; test 126, 189 and 252 days. Keep the top 20%. Hold the best 10, 15 or 20, re-ranked every 21 days, weighted by inverse volatility over 63 days, at most 10% in any stock. Use a trailing stop of 10, 15 or 20%.
Connect tool: save_strategy · "Trend-gated 12-1 momentum, 15 stocks"
| # | Module | Family | Setting |
|---|---|---|---|
| 1 | Dollar-volume floor | Filters | At least ↔ $10M–$30M by 10 (3 values), window ↔ 10–30 bars by 10 (3 values) |
| 2 | Universe above its moving average | Market | Window ↔ 100–250 by 50 (4 values) |
| 3 | Price momentum leaving out recent bars, tagged A | Rankings | Window ↔ 126–252 by 63 (3 values), leave out ↔ 14–28 by 7 (3 values) |
| 4 | Top percent, reads A | Filters | Above percentile ↔ 70–90 by 10 (3 values) |
| 5 | Hold the top N, ranked by A | Rotation | Stocks held ↔ 10–20 by 5 (3 values), re-rank every ↔ 14–28 by 7 (3 values) |
| 6 | Inverse volatility | Weights | Weight lookback ↔ 42–84 bars by 21 (3 values) |
| 7 | Cap per stock | Constraints | At most ↔ 5–15% by 5 (3 values) |
| 8 | Trailing stop | Risk | ↔ 10–20% by 5 (3 values) |
Trend-gated 12-1 momentum, 15 stocks · 1 day bars · 11 searched · 236196 settings
Universe: iShares Russell 3000 ETF equity holdings (Top 500 by Weight) (point in time, 500 members)
Filters ┌ Dollar-volume floor · At least ($M) ↔ 10–30 by 10 (3 values) · Window ↔ 10–30 by 10 (3 values)
Market ├ Universe above its moving average · Window ↔ 100–250 by 50 (4 values)
Rankings ├ Price momentum leaving out recent bars [A] · Window ↔ 126–252 by 63 (3 values) · Leave out the latest ↔ 14–28 by 7 (3 values) · compare universe · better higher
Filters ├ Top percent [reads A] · Side top · Above percentile ↔ 70–90 by 10 (3 values)
Rotation ├ Hold the top N · Check filters every_bar · Stocks held ↔ 10–20 by 5 (3 values) · Re-rank every ↔ 14–28 by 7 (3 values) · Weight of A 100 weight · side long_only · priority rank · Rank by A 100
Weights ├ Inverse volatility · Weight lookback ↔ 42–84 by 21 (3 values)
Constraints ├ Cap per stock · At most (%) ↔ 5–15 by 5 (3 values)
Risk ├ Trailing stop · From the high (%) ↔ 10–20 by 5 (3 values)
Exits └ Sells a stock that ranks out of the top N at a re-rank
Warmup 253 bars · longest hold 0 bars
https://minerva1.com/app/backtester/builder?strategy=27b32cbc15c802a339431b4dda5c6d22e579cb008dda57df8d9beb1323d30aeb
An optimization of this strategy searches 11 settings. Fixed numbers, which an optimization never searches: Hold the top N · Weight of A 100 weight.
- 11 searched settings. Settings: 4 market windows × 3 values for each of the other ten = 236,196 combinations.
- The request's ranges are searched as given. Each single number in the request is searched around its value, such as Re-rank every 14 to 28 bars around 21. Only the weight of A stays fixed: the rotation ranks by A alone.
- Warmup 253 bars: the longest searched momentum window (252) plus 1.
- A searched range is shown with ↔ and a colored outline on the screen.
09When Minerva refuses a strategy
Minerva compiles every strategy when it is saved. A strategy that cannot run is not saved. The answer gives the reason in the compiler's words and marks the module.
Hold the top 10 of the 500 largest US stocks by 6-month momentum, re-ranked monthly, and sell each stock after 10 days.
Connect tool: save_strategy · refused
Hold the top N decides holdings by re-ranking. Sell after N bars works only with trade signals. The fix is either a trade-signal strategy (Hold in N slots plus a trade signal) or no timed exit. The assistant explains the choice and does not substitute a different rule silently.
10Fixed and searched settings
Every numeric setting is either one value or a search.
"params": {"window": 126} fixed
"params": {"window": {"search": [63, 189, 21]}} searched: 63, 84, 105, 126, 147, 168, 189
"choices": {"side": {"search": ["top", "bottom"]}} searched choice
Write every numeric setting as a search around the value the person or the source gives, with that value inside the range; where neither gives a value, search around the module's default. An optimization searches only the searched settings: a fixed value is never searched, and a setting left out of the request is fixed at its default. Fix a setting only where the person says to fix it, or where no other value would change the trades, such as the rank weight of a rotation that ranks by one letter.
- A search is
[low, high, step]in the setting's own unit. Values are snapped to the module's legal step. - Settings count = the product of each searched setting's number of values.
- No searched settings: the strategy runs as a backtest. Minerva refuses to optimize it and names its fixed numbers.
- One or more searched settings: the strategy runs as an optimization.
- Each setting has a legal range in the library (for example, Stocks held 1–100, Re-rank every 1–126 bars). A value outside it is refused.
Example 1 with every number fixed, as when the person asks to test a 126-bar window, 10 stocks and a re-rank every 21 bars exactly:
Monthly momentum, top 10, fixed · 1 day bars · 0 searched · 1 settings
Universe: iShares Russell 3000 ETF equity holdings (Top 500 by Weight) (point in time, 500 members)
Rankings ┌ Price momentum [A] · Window 126 bars · compare universe · better higher
Rotation ├ Hold the top N · Check filters every_bar · Stocks held 10 stocks · Re-rank every 21 bars · Weight of A 100 weight · side long_only · priority rank · Rank by A 100
Weights ├ Equal
Exits └ Sells a stock that ranks out of the top N at a re-rank
Warmup 127 bars · longest hold 0 bars
https://minerva1.com/app/backtester/builder?strategy=dfdaaea0b9a5d85461d5ea250bce7c844954312eaba232ceacea6c7d5cfb0b29
An optimization of this strategy searches 0 settings. Fixed numbers, which an optimization never searches: Price momentum · Window 126 bars; Hold the top N · Stocks held 10 stocks; Hold the top N · Re-rank every 21 bars; Hold the top N · Weight of A 100 weight.
0 searched settings and 1 setting: the strategy runs as a backtest (Section 11). Warmup 127 bars = window 126 + 1.
11Run a backtest
A backtest runs one strategy with fixed settings over a date range: a strategy whose numbers the person fixed (Section 10), or the setting an optimization chose (chosen_strategy, Section 12). Connect refuses to backtest a strategy with searched settings. Three steps: quote, run, read.
- Quote.
quote_backtestwith the strategy id, start date, end date and starting capital. The strategy carries its universe, bar size and rules. The run sets only dates, capital, costs (financing included), the benchmark and compute pricing. - Run. After your approval,
run_backtestwith the spec the quote returned, unchanged, the quote'squote_id, the compute you chose (Standard or Fast, underrouting_options) and that option's credits and approved units. The spec carriesrotation_snapshot_id: the universe membership frozen at quote time. - Read.
get_run_statusuntil it finishes, thenget_run_reportfor the P&L report.
Price a backtest of "Monthly momentum, top 10, fixed" from 2006 to the latest data with $100,000.
Connect tool: quote_backtest
{"kind": "backtest", "quote_id": "ce055305-3fcb-4ff9-bbc5-06478f26794a",
"routing_options": {"standard": {"credits": 2, "runtime_minutes_est": 128.6, "expected_wait_minutes": 11,
"host": "m7a.4xlarge, 16 evaluators", "available": true},
"fast": {"credits": 2, "runtime_minutes_est": 59.2, "expected_wait_minutes": 11,
"host": "c7i.2xlarge, 4 evaluators", "available": true}},
"pricing_version": "minerva-chain-backtest-chain-basis-38aea54b9-2026-11-04",
"cost_inputs": {"cost_mode": "fixed", "slippage_bps": 3, "max_participation_pct": 20,
"commission_per_share": 0.0035, "min_commission": 0.35, "borrow_rate_source": "flat",
"borrow_flat_rate_pct": 0.25, "borrow_collateral_mark": "102_rounded_up",
"financing_reference": "none", "financing_spread_pct": 0},
"symbols": ["A", "AA", "AA-2016", "AABA", "AAL", ...],
"rotation_snapshot_id": "3fcd2f22-a8ff-4c0a-8f00-0eba98f261b6",
"spec": {"strategy_id": "dfdaaea0…0b29", "start_date": "2006-01-03", "end_date": "2026-06-16",
"initial_capital": 100000, "rotation_snapshot_id": "3fcd2f22-a8ff-4c0a-8f00-0eba98f261b6"}}
Response from Minerva, shortened here. The symbol list holds every stock that was a member of the universe at any point in the dates: 1,312 here. Each compute option also carries its approved units, start estimate and refund terms. Run times are rounded to one decimal.
Connect tool: get_run_status · "QS 40 N16 — Dual momentum SPY EFA AGG"
{"status": "success", "trade_mode": "rotation", "credits": 2,
"headline": {"cagr": 0.0685, "sharpe_ratio": 0.5218, "sortino_ratio": 0.7174, "calmar_ratio": 0.2093,
"max_drawdown": -0.3271, "total_trades": 59, "win_rate": 0.6780, "total_cost": 206.90,
"initial_capital": 100000, "final_equity": 382570.18,
"one_account": {"stock_count": 3, "same_stocks_cagr": 0.0712, "gap": -0.0028,
"same_stocks_max_drawdown": -0.4101, "failed_ticker_count": 0, "not_trading_ticker_count": 0,
"compared_with": "the list's members on each date held in equal amounts, rebalanced every bar, before costs"}},
"reports": [{"rank": 1, "status": "generated", "html": true, "markdown": true}],
"message": "✅ Run complete. 📊 Your report is ready."}
A real finished run on this account: a three-fund builder strategy (SPY, EFA, AGG), 2006-03-13 to 2026-06-16. Values rounded here to 4 places.
Backtest rules
- A builder strategy trades its universe as one account.
- Minimum price: 2 credits. The quote is the price.
- A stock whose prices fail does not fail the run. The run completes without it. The status counts it (
failed_ticker_count) and the report names it. A stock with no prices in the dates is counted separately (not_trading_ticker_count). - The run fails, and is refunded, only if it is left with too few stocks to trade.
get_run_reportreturnsresults_url, the run's result page (Section 03), an HTML report link and the report as Markdown.- A backtest headline's
daily_newey_west_sharpeis its Sharpe Ratio over its scored sessions: the Newey-West Sharpe of the account's own daily returns. Its report's Edge & Robustness section shows the Sharpe on the amount-held basis. - Financing. The cost settings
financing_reference(noneortreasury_bill_13_week) andfinancing_spread_pct(percent a year) finance the strategy's capital: on each day the strategy holds a position, its capital is borrowed at the reference rate plus the spread, and the account's cash, collateral and short sale proceeds included, earns the reference rate. None with a spread of 0 is no financing. The tester guide's Trading costs section gives the arithmetic. A quote with the Treasury bill rate fails with "The T-bill rate is not available for these dates" when the rate cannot be read for the run's dates. The results show funding and cash interest beside the borrow fee, the rates' last observation, and the sessions with capital in use. - Benchmark.
comparison_benchmarksets what the run is compared with: the list's members on each date held in equal amounts (also when not set),cash(a return of 0), one ticker held alone (for exampleSPY), ormarked_stocks, the stocks in at the step "Benchmark: the stocks in at this step". That card keeps every stock and marks its step, once, at the top level of the steps, in a strategy that buys on trade signals. The marked benchmark is the strategy run again without the filters after that step, buying every signalled stock in equal parts at the strategy's own fills and selling them by its exits, with no trading cost and no financing. The benchmark feeds the return minus the benchmark, the relative return on deployed capital and the comparison table, and the results name it. The luck and robustness measures keep the list's members, equal weight, whatever the benchmark is. - Relative return on deployed capital. On each day with capital in use, the return per dollar invested, before financing, minus the benchmark's return on the same dollars over the same hours; the measure is the mean of those daily differences × 252, a line of the comparison table. Both sides borrow the same capital on the same days, so financing drops out. With cash as the benchmark, the daily difference is the return on deployed capital after financing. Example: +0.12% a day per dollar deployed against SPY's +0.10% on the same days is (0.12% − 0.10%) × 252 = +5.04% a year. A run never invested shows N/A.
12Run an optimization
An optimization searches the searched settings on the development period, with walk-forward and Combinatorial Purged Cross-Validation (WF+CPCV): the development period is cut into 10 slices, and the search is scored on each of the 120 ways to set 3 slices aside. It then picks one setting, freezes it and tests it once on the holdout period: the last part of the date range, unused by the search. The full pipeline is described in the Minerva tester documentation.
Price an optimization of Trend-gated 12-1 momentum from 2006 to the latest data.
Connect tool: quote_optimization
{"kind": "optimization", "quote_id": "90570b51-2b66-4c8d-a40a-8d8293185b30",
"routing_options": {"standard": {"credits": 251, "runtime_minutes_est": 7146.6, "expected_wait_minutes": 11,
"host": "m7a.2xlarge, 8 evaluators", "available": true},
"fast": {"credits": 404, "runtime_minutes_est": 897.4, "expected_wait_minutes": 11,
"host": "c7a.32xlarge, 120 evaluators", "available": true}},
"pricing_version": "chain-basis-38aea54b9-2026-11-04",
"search_settings": {"population": 128, "generations": 3, "cpcv_n_splits": 10, "cpcv_n_test_splits": 3,
"validation": "walk_forward_cpcv", "seed_salt": null},
"trade_mode": "rotation",
"strategy": {"name": "Trend-gated 12-1 momentum, 15 stocks", "kind": "schedule", "side": "long_only",
"searched": 11, "settings": 236196},
"rotation_snapshot_id": "f719a8f0-d0e6-4b58-bd70-489500ee1250"}
Response from Minerva, shortened here: each compute option also carries its approved units, start estimate and refund terms, and the quote carries the costs, the strategy's universe and the spec to run. Run times are rounded to one decimal.
An optimization's quote gives two compute options under routing_options: Standard, the least cost, and Fast, the shortest compute time, each with its credits, run time and expected wait. The two can have equal prices. The approval names the option you chose, with that option's credits and approved units.
Connect tool: quote_optimization · start 2006-01-03 · refused
strategy_chain@1.0.0 needs 253 daily bars of history before the first scored bar for these settings,
and Minerva's daily data starts 2005-01-03. The earliest start for this search is 2006-01-04;
this request starts 2006-01-03.
Nothing is charged for a refused quote.
Optimization settings
| Field | Range | Effect |
|---|---|---|
population | 4–1024, default 128 | Candidate settings tried per round. Higher costs more. |
generations | 1–20, default 3 | Rounds of the genetic search. Higher costs more. |
| CPCV slices | 10, with 3 set aside at a time, fixed | Not an option. |
seed_salt | up to 32 letters, digits, _ or - | Repeats the search with different random draws on the same data. Same price. Not independent out-of-sample evidence. |
compute_pricing | on_demand or spot | Compute price basis. |
wf_train_days, wf_test_days, wf_step_days | optional | Walk-forward window lengths. |
optimization_objective | return_minus_benchmark (also when not set), sharpe_ratio, return_per_year_over_days_with_capital_in_use, sharpe_ratio_over_days_with_capital_in_use, relative_return_on_deployed_capital, information_ratio_over_days_with_capital_in_use | The number the search orders the settings it tried by and picks the best with, after every cost, financing included. A setting whose value is undefined ranks below every number. |
comparison_benchmark | as for a backtest | The run's benchmark (Section 11). |
What an optimization returns
- A one-account strategy's search ranks settings by its optimization objective: the Sharpe Ratio of its return minus its benchmark when none is set, otherwise the run's Sharpe Ratio, its return per year or its Sharpe Ratio over the days with capital in use (each day's return per dollar invested), its relative return on deployed capital, or its information ratio over the days with capital in use (the same daily differences as a Sharpe Ratio). The results name the objective used. Every optimization gets a LuckFactor and a RobustGrade, with the measures they grade, on the amount-held basis; the Luck and Robustness Measures Reference Guide explains each.
chosen_strategy: the one setting the optimizer froze for the holdout period. Itsbacktest_speccan be passed unchanged toquote_backtestandrun_backtestto re-run it.- The optimization's figures cover only its holdout period. A re-run over the whole window is not comparable with them.
- The optimization's
daily_newey_west_sharpeis its holdout period's Sharpe Ratio, the same definition a backtest reports.
13Strategy request reference
save_strategy takes a name (1–100 characters) and a strategy object. list_strategy_modules returns the exact schema as spec_schema.
Write every number in a module's params, the rotation's rank, a ranking part's weight and a purchase rule's peers or peer_rank as {"search": [low, high, step]}: a range around the number the person or the source gives (around the module's default where neither gives a number), with that number inside the range and the range inside the setting's legal range. A bare number is fixed and is never searched, and a setting left out is fixed at its default. Write a bare number only where the person says to fix that setting, or where no other value would change the trades, such as the rank weight of a rotation that ranks by one letter (only the ratio of rank weights matters).
Top-level fields
| Field | Required | Content |
|---|---|---|
chain_version | yes | 1 |
bar_size | yes | 1day or 1hour |
universe | yes | A universe id from the library's universes |
steps | no | Ordered list of Rankings, Series, Filters, Market and Trade-signal modules |
rotation | yes | One Rotation module, with rank: letter → weight (0.01–100) |
weights | no | One Weights module. Equal if omitted |
constraints, risk, exits | no | Lists of modules of those families |
execution | no | {"entry", "exit"}: next_open, next_vwap or next_close. Default open/open. An exit fills no later in the bar than its entry: a next-VWAP exit requires a next-VWAP or next-close entry, and a next-close exit a next-close entry |
combine | no | {"mode": "any" | "all", "within": bars}: how several trade signals combine. Default any |
long_steps, short_steps | no | Step keys that select the long side and the short side of a long-short rotation |
tie_break | no | A ranking letter with values that breaks ties. Required when the rotation ranks only by on/off rankings |
residualization | no | {"benchmark": "SPY", "beta_lookback_bars": 20–500}: signals read prices net of SPY's beta share |
state_context | no | Where analytical state starts |
Module fields
| Field | Content |
|---|---|
key | Your name for this module in the strategy: lowercase letters and digits, up to 16 characters, starting with a letter |
id | The module id from the library, such as price_momentum |
as | A ranking's letter (1–3 capitals), so later modules can read it |
reads | The letters a filter or exit reads |
params | Numeric settings: each {"search": [low, high, step]} around the number given, or a bare number where the setting is fixed |
choices | Named options: a value or {"search": [option, …]}. A catalog signal module names its signal here: {"signal": "classic_wilder_rsi_extremes@1.0.0"} |
inputs | Series inputs: {"module": key, "port": name} or {"constant": number, "unit": unit} |
when, then, else | Contents of "If a market condition, else" |
on, off | Contents of "From one event until another" |
options | Contents of "Any of these selections" |
parts | Parts of a blended ranking, each with a weight (0.01–100, fixed or searched) |
buy | A trade signal's purchase rule: itself, group_top or group_kth (a member of the stock's group, ordered by a letter) |
universes | A set of groups the module works within, such as industry_groups |
targets, shares | Instruments a module trades and fixed shares per fund |
Example 3 as sent
{"chain_version": 1, "bar_size": "1day", "universe": "96ec0ce8-241d-54ae-a142-befe992c2c7a",
"steps": [
{"key": "liquid", "id": "liquidity_floor",
"params": {"usd_millions": {"search": [10, 30, 10]}, "window": {"search": [10, 30, 10]}}},
{"key": "market", "id": "universe_trend", "params": {"window": {"search": [100, 250, 50]}}},
{"key": "mom", "id": "price_momentum_skip", "as": "A",
"params": {"window": {"search": [126, 252, 63]}, "skip": {"search": [14, 28, 7]}}},
{"key": "top", "id": "top_percent", "reads": ["A"], "params": {"percentile": {"search": [70, 90, 10]}}}],
"rotation": {"key": "hold", "id": "top_n", "rank": {"A": 100},
"params": {"holdings": {"search": [10, 20, 5]}, "every": {"search": [14, 28, 7]}}},
"weights": {"key": "w", "id": "inverse_volatility", "params": {"weight_window": {"search": [42, 84, 21]}}},
"constraints": [{"key": "cap", "id": "cap_stock", "params": {"percent": {"search": [5, 15, 5]}}}],
"risk": [{"key": "trail", "id": "trailing_stop", "params": {"percent": {"search": [10, 20, 5]}}}]}
What a save returns
identity: 64-character id. Pass it asstrategy_idto quotes and runs, and aschain_idto reports.spec: the strategy normalized, with every default filled in.searched: the number of settings an optimization searches.fixed_numeric_settings: each number the strategy fixes, which an optimization never searches; the line under the text schematic names them.rows: one row per setting: name (chain__<key>__<field>), unit, legal range, step, scale (log for windows and lookbacks, linear otherwise), fixed value or searched value count.schematic: the diagram data the screen and text draw from.requirements: warmup bars, lifecycle kind, longest hold, group sets and datasets read.
14Compiler rules
Minerva compiles a strategy once, at save. The compiled strategy is the executable definition. Backtests, optimizations and reports run it unchanged.
- Placement. Each module belongs in one place: steps, rotation, weights, constraints, risk or exits. A module elsewhere is refused.
- Fit. A re-ranked rotation refuses trade signals. A slot rotation requires them. Exits such as Sell after N bars require trade signals.
- References. Every letter a module reads, and every letter the rotation ranks by, must be a ranking earlier in the strategy. A rotation with priority
rankneeds at least one ranking letter. - Units. Series carry units. A raw price changes at every split, so a price never ranks stocks. Fixed numbers in arithmetic declare a unit (fraction, multiple, percent).
- Ranges. Every value and search must lie inside the module's legal range and step.
- Unused rankings. A ranking letter that no module uses is refused: "ranking A is not used by any module".
- Ties. A re-ranked rotation that ranks only by on/off rankings must set
tie_breakto a ranking with values. - Warmup. The compiler computes the bars of history needed before the first decision from the largest values the settings can take. A run that starts too early is refused with the earliest legal start (Section 12).
- Lifecycle. Each strategy has one lifecycle kind:
target_state(holdings follow the rules each bar),deterministic_horizon(positions close after a known number of bars) ormodel_managed_exit(a signal decides the exit). The longest hold is stated in bars. - Identity. The id is a hash of the compiled strategy. The same strategy always gets the same id.
- No silent substitution. A refused strategy is not altered and saved. The refusal names the module and the reason.
15The Full report
Minerva's full strategy report runs several optimizations on one strategy, then many focused backtests around the best region they find, and names up to three best candidate strategies. You request it the same way as a run: quote, approve, read. In the Lab it is labeled "Full — complete research report".
Requirements
- The strategy must have at least one searched setting with two or more values. A report always optimizes. There is no report of a single fixed setting.
- Daily bars, Minerva's standard bar policy.
- The strategy supplies its own universe and authored settings. The request sets the observation window, capital and costs.
- The Full report needs at least 5,175 scored sessions in the window.
What it runs
Maps the strategy's settings, selects up to three candidates, and tests them.
| Stage | Work |
|---|---|
| A. Broad sample | 4,000 settings from a scrambled Sobol design over every searched setting. Used to rank settings and draw the map. Never candidates. |
| Influence | Each setting's influence: the spread of median Sharpe Ratio between its best and worst of 6 bins. Chosen: influence ≥ 0.10 Sharpe Ratio, at most 4, at least the top 2. Others are fixed at their best bin's center. |
| B. Grid | Up to 6 values per chosen setting, crossed. |
| Range extension | 0–2 extra batches when the best settings sit on the edge of a range that can go further. |
| Candidates | Frontier: settings no other setting beats on both Sharpe Ratio and time below zero (rolling one-year Sharpe Ratio below 0). Candidate 1: the highest Sharpe Ratio on the frontier. Candidate 2: the least time with the rolling one-year Sharpe Ratio below zero. Candidate 3: of the ten highest Sharpe Ratios from 2023-01-01, the one whose lowest nearby from-2023 Sharpe Ratio is highest. |
| C. Nearby settings | One step either side on every fixed setting for each frontier setting; a 5 × 5 half-step block around each provisional candidate. |
| D. Candidate checks | Ten start dates 5 sessions apart; every stock count not already run; stop loss and trailing stop at 5, 10, 15 and 20%; 40 periods × 10 start days of one-year accounts; for group-buying candidates, 10 random group assignments of the same sizes. |
| Optimizations | Per purchase subject: one over the whole window with its holdout period, plus one rolling optimization per calendar year from the window's fourth year. Population 128, 3 generations, CPCV 10/3. |
| Replays | Each optimization's chosen setting run over the whole window. |
What it shows
| Full report section |
|---|
| 1. The strategy and how it was chosen · 2. Capital: funded on demand · 3. The optimizations · 4. Exposures · 5. Performance · 6. Correlation · 7. Edge & Robustness · 8. Industry-group definitions · 9. Next steps · 10. What the headline counts · 11. Definitions · 12. Follow-ups |
Section 7, Edge & Robustness, gives each candidate its MinervaScore, LuckFactor+ and RobustGrade with the measures they count, and PBO beside the MinervaScore, in the groups Luck vs. Edge, Signal vs. Noise and The Two Combined; the Luck and Robustness Measures Reference Guide explains each. Candidate 1 is the main narrative: sections 1 to 6 and 8 to 12 describe it. Candidates 2 and 3 appear where section 1 says how each candidate is chosen, in section 5's comparison table and in section 7. All other evidence is in supporting tables and downloads.
How the report labels its evidence
- Each optimization's development period and holdout period, and the whole-window replay, are shown separately.
- Earlier years checked after selecting on later data are labeled "Earlier history checked after selection". They are not forward out-of-sample evidence.
- The whole-window curve includes development dates and is labeled "Historical backtest; includes data used in selection".
- Each optimization shows its own LuckFactor and RobustGrade. The MinervaScore is the report's, one for each candidate.
Request, approve, read
Quote a Full report for Trend-gated 12-1 momentum from 2006-01-04 to 2026-06-16.
Connect tool: quote_signal_report
{"spec": {"report_kind": "full",
"subject": {"kind": "chain",
"chain_id": "27b32cbc15c802a339431b4dda5c6d22e579cb008dda57df8d9beb1323d30aeb",
"revision": "27b32cbc15c802a339431b4dda5c6d22e579cb008dda57df8d9beb1323d30aeb"},
"observation_start": "2006-01-04", "observation_end": "2026-06-16",
"initial_capital": 100000, "timeframe": "1day",
"cost_config": {"cost_mode": "fixed", "slippage_bps": 3, "commission_per_share": 0.0035,
"min_commission": 0.35, "max_participation_pct": 20},
"bar_policy": {"session_policy": "extended_hours", "bar_clock_policy": "printed_bars"}}}
The request the assistant sends. report_kind is full; a How it works report is how_it_works. revision must equal chain_id.
| Quote field | Content |
|---|---|
quote_id, request_sha256 | The immutable quote and the hash of its request |
runnable, refusal_code, reason | Whether it can be approved, and why not |
expected_credits, max_credits | The report's price, reserved at approval |
runtime_minutes_est | The quoted run time: about 24 hours |
routing_options | Standard and Fast compute: each one's credits, compute time, expected wait, availability and refund terms |
stages | The planned work: optimization counts, populations, generations, CPCV shape, maximum backtests |
windows | The frozen dates: whole window and optimization window |
searched_axes | Every searched setting: name, unit, range, step or choices |
expires_at | When the quote lapses |
Connect tool: run_signal_report
{"approval": {"quote_id": "<quote_id from the quote>",
"expected_request_sha256": "<request_sha256 from the quote>",
"expected_max_credits": <max_credits from the quote>,
"idempotency_key": "<one stable key>"}}
The approval repeats the quote's id, request hash and maximum, and names the chosen routing and its approved_units when the quote has routing options. It does not re-quote. A changed request needs a new quote.
get_run_statuson a report returns:report_kind,stage,progress_message,report_available,expected_credits,reserved_credits,charged_credits,refunded_credits,leader_summary,terminal_reason,progressandchildren(each optimization and backtest it started).get_run_reportreturns the HTML report link, the Markdown link and four downloads:summary.json,analysis.json,tables.zip,series.npz.cancel_runstops every child run. The charge and the refund follow the refund terms the quote showed and you approved.- A cancelled or failed report shows a final state with its charge and refund. It never shows as loading.
16Report prices
A Full report costs 1,800 credits, the same for every strategy, window and universe; a How it works report costs 6 credits. The quote is the price. A report is quoted with one compute option, Standard.
- Approval reserves the price. A completed report is charged it.
- A report that fails, or that you cancel before its computation starts, is refunded in full; one you cancel after its computation starts keeps the approved charge.
What a Full report runs
For a daily strategy on the point-in-time 500-stock universe, 2005 to 2026, with two purchase subjects.
| Full report | |
|---|---|
| Optimizations | 21 standard (2 whole-window + 19 yearly), 128 × 3 generations |
| Backtests | thousands of fixed settings in stages A–D, plus replays |
| Credits | 1,500 |
| Produces | Up to three candidates, each with its MinervaScore, LuckFactor+ and RobustGrade; the settings map, the stop and start-date checks and the yearly optimizations. Twelve sections. |
The price covers the Full report's conditional work too: up to two range-extension batches, and a second set of yearly optimizations when Candidates 1 and 2 use different purchase subjects (2 + 38 optimizations instead of 2 + 19).
For comparison: Example 3's single ordinary optimization quotes 251 credits on Standard compute and 404 on Fast (Section 12).
17Connect tool reference
| Tool | Charges | Does |
|---|---|---|
list_strategy_modules | no | The module library, universes, datasets and spec_schema. Pass family, module or dataset to narrow it. Inline screen. |
save_strategy | no | Compiles and saves a strategy, or refuses it with the reason. Inline screen. |
get_strategy | no | One saved strategy by id. Inline screen. |
list_strategies | no | Saved strategies, newest first. |
quote_backtest, quote_optimization | no | Price, run time and the frozen spec to run. |
run_backtest, run_optimization | yes | Starts the quoted run after approval. |
quote_signal_report | no | Prices a Full report or a How it works report. |
run_signal_report | yes | Starts exactly the approved report quote. |
get_run_status | no | Status, headline results, chosen_strategy for optimizations, report progress. |
get_run_report | no | Report links, Markdown and downloads of a finished run. |
inspect_run_coverage | no | Which stocks ran, were left out or failed, with reasons, 100 at a time. |
list_runs | no | Recent runs with status and approved credits. |
cancel_run | refund | Stops a run. Unused credits are refunded. |
get_credit_balance | no | The account's credits. |
Module counts, universes, saved answers and quotes on this page were read from Minerva on 2026-11-08 and 2026-11-09 (catalog 4572cdc3a59a).