Discovery Lab

Test a trading rule or a whole portfolio against real market history. Choose a market, a period from the last hour to the last 30 years, a bar interval from 1 minute to weekly, a starting balance and a position size, then see what our risk engine reports: return, Sharpe ratio, drawdown, value at risk, robustness, walk forward results and more.

  • No account or login
  • 1 minute to weekly bars, requested from public sources when you run a test
  • Nothing stored by Sapientia
Test
Market
Period and bars
Period
Bar interval
Account and sizing
Position sizing
Direction
Strategy

Risk and costs

Your settings are kept in this page's address, so you can share a test by copying the link.

Preparing the Lab.

How the Lab works

Where does the data come from?

When you run a test, your browser requests history through this website's host: Yahoo Finance for stocks, ETFs, Treasury and commodity futures and currencies, Coinbase for digital assets, European Central Bank reference rates as a fallback for daily currency prices, and three month interest rates from the Federal Reserve Bank of St. Louis (FRED) for the currency carry rule. Daily stock and ETF prices can be adjusted for splits and dividends. The data is held only in your browser tab for that session; Sapientia never receives or stores it.

Which bar intervals and periods can I use?

Periods run from the last hour to the last 30 years, or any dates you choose. Bars run from 1 minute to weekly. Yahoo Finance keeps 1 minute bars for the last 29 days, 2 to 30 minute bars for the last 59 days and hourly bars for about two years; daily and weekly bars go back as far as each market's history. Coinbase keeps digital asset candles at every interval for years, and the Lab requests up to 18,000 of them in one test. Short periods on stocks and ETFs use the most recent trading hours, so a 6 hour test run at the weekend covers Friday's session. Before each test, the Lab also fetches enough earlier bars to warm up the strategy's indicators, so signals are ready from the first bar of your period.

How are trades filled?

A rule is evaluated at each bar's close and any trade fills at the next bar's open, so no test can use information from the future. Stops and targets are checked against each bar's high and low; if the market opens beyond a stop, the trade fills at the open. After a stop, the rule waits for a fresh signal before entering again. Costs are charged on both entry and exit.

How is position size calculated?

Fixed size trades the same number of shares, coins, lots or contracts every time; one currency lot is 100,000 units of the base currency, and futures contracts use their exchange multiplier. Percent of equity invests a share of the account's value at each entry. Volatility target sizes each entry so the position's expected annual volatility matches your target, based on the previous 20 bars and capped at four times equity. Profits and losses on pairs such as USD/JPY are converted to U.S. dollars.

What do the statistics mean?

CAGR is the compound annual growth rate, shown for tests of three months or more. The Sharpe ratio is the annualised average return per bar divided by its volatility, with no risk free rate deducted; intraday tests are annualised from trading hours per year. Sortino counts only downside volatility. Maximum drawdown is the largest fall from a previous peak, and Calmar is CAGR divided by it. VaR (95%) is the loss exceeded on the worst 5% of bars, and expected shortfall is the average loss on those bars. Profit factor is gross profit divided by gross loss.

What do walk forward and portfolio tests show?

Walk forward analysis chooses a rule's settings on one stretch of history and trades them on the next stretch, repeatedly, so the result reflects decisions made without hindsight. A large gap between training and test results is the clearest sign of a fitted rule. Portfolio tests hold up to eight stocks, ETFs or digital assets at target weights, rebalanced monthly, quarterly, yearly or never, with costs on every rebalancing trade; inverse volatility weighting gives steadier holdings a larger share. Presets include the 60/40 mix of stocks and bonds and the permanent portfolio of stocks, long Treasuries, gold and Treasury bills.

What does the Lab leave out?

Taxes, financing and borrowing costs (except the interest rate difference in the currency carry rule), dividends owed on short positions, margin interest, market impact beyond your cost setting, and contract rolls in continuous futures series. Results for thinly traded symbols may be unrealistic.

Is this how Sapientia trades?

No. The Lab runs six classic, published rules and a few well known portfolio mixes so that anyone can see how disciplined testing works. Discovery's own research, models and positions are proprietary and are not shown on this website.

Hypothetical results

Backtests are simulations applied to historical data with the benefit of hindsight. They do not represent actual trading, do not reflect Sapientia Financial's strategies, positions or performance, and do not predict future results. Real trading involves costs, liquidity limits and risks a simulation cannot capture. Nothing in Discovery Lab is investment advice or a recommendation to buy or sell any instrument.