Canli Validation
v0.16.0Deflated Sharpe and PBO checks.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
get_key Get a free validation key
Issue a free validation key for this session. Rarely needed: the first validation issues one itself unless CANLI_KEY or local mode is set, and the read tools need none. Quotas: 1000 validations per key per UTC day, 5 keys per client per UTC day, 1048576 bytes per validation request, 1024 bytes per key revocation request, 20000 observations per series, 200 variants per matrix.
| Parameter | Type | Description |
|---|---|---|
label | string | Name for the key. |
validate_deflated_sharpe Validate deflated Sharpe
Deflated Sharpe ratio: the probability (0 to 1) that the selected strategy's Sharpe beats the best that luck gives across the variants tried, with the probabilistic Sharpe and that luck benchmark. Send the seven statistics or a return series. With every variant's returns use validate_overfitting; luck as a trial count, validate_luck_trials; a multiple-testing haircut, validate_haircut_sharpe. A deflated Sharpe or overfitting probability above or below any threshold is not admission to anything and is not a forecast.
| Parameter | Type | Description |
|---|---|---|
cross_trial_sharpe_sd_annualized | number | Standard deviation of annualized Sharpe across those trials. |
effective_independent_trials | integer | Independent variants tried before choosing this one. |
non_excess_kurtosis | number | Kurtosis, not excess kurtosis; 3 if Normal. |
observations | integer | Number of return observations. |
observed_sharpe_annualized | number | Annualized Sharpe as observed. |
periods_per_year | number | Periods per year: 252 daily, 365 crypto, 52 weekly, 12 monthly. |
returns | array | Periodic returns as fractions (0.01 = 1%), oldest first; replaces the Sharpe, observations, skew and kurtosis. |
skew | number | Skewness of returns; 0 if Normal. |
validate_overfitting Validate overfitting (CSCV)
Probability of backtest overfitting (0 to 1) by CSCV: how often the in-sample best variant falls below the out-of-sample median. Needs every variant's returns (periods by variants); with summary statistics only, use validate_deflated_sharpe. A deflated Sharpe or overfitting probability above or below any threshold is not admission to anything and is not a forecast.
| Parameter | Type | Description |
|---|---|---|
matrix * | array | Returns as fractions, one row per period, one column per variant. |
max_combinations | integer | Most splits evaluated, up to 2000 (default). |
n_splits | integer | Even number of blocks, at least 2; default 16. |
seed | number | Sampling seed; default 42. |
validate_reality_check Data-snooping tests (SPA, Reality Check, StepM)
Data-snooping tests on every variant a search tried: Hansen's SPA p-value that the best beat the benchmark only by luck, White's Reality Check, and the variants Romano-Wolf StepM finds better. Send all variants tried, not only the winners. A deflated Sharpe or overfitting probability above or below any threshold is not admission to anything and is not a forecast.
| Parameter | Type | Description |
|---|---|---|
alpha | number | Familywise error for StepM; default 0.05. |
benchmark | array | Benchmark return per period; default zero. |
block_length | integer | Mean bootstrap block in periods; default round(n^(1/3)). |
matrix | array | Returns of every variant the search tried, one row per period, one column per variant. |
matrix_file | string | Path to a CSV or JSON with one numeric column per variant, instead of matrix. |
reps | integer | Bootstrap draws; default 2000. |
seed | integer | Sampling seed; default 42. |
validate_paper_evidence Validate paper evidence
Checks paper-evidence.v0 structure and disclosures. With CANLI_LOCAL=1, record_file reads an export bundle and journal_file verifies signatures, source hashes and recomputed claims. Without a journal, source facts and signatures are unchecked. Local files are never uploaded. This verdict is about the series exactly as submitted. The service never saw the data source, its costs, survivorship, or any lookahead in how the series was built.
| Parameter | Type | Description |
|---|---|---|
journal_file | string | Local signed journal to recompute and bind; requires CANLI_LOCAL=1. |
record | object | A canli.paper-evidence.v0 record. |
record_file | string | Local record or export-bundle JSON path; requires CANLI_LOCAL=1. |
signature | object | Detached record signature for a signed inline record; requires journal_file. |
validate_breadth Validate breadth ceiling
Book Sharpe ceiling from adding sleeves of this quality and correlation, the Sharpe at a sleeve count, and the sleeves a target needs. For portfolio construction; it validates no single strategy. This verdict is about the series exactly as submitted. The service never saw the data source, its costs, survivorship, or any lookahead in how the series was built.
| Parameter | Type | Description |
|---|---|---|
average_pairwise_correlation * | number | Average correlation between sleeves, -1 to 1. |
sleeve_sharpe * | number | Annualized Sharpe of one sleeve. |
sleeves | integer | Sleeve count, for that book's Sharpe. |
target | number | Target book Sharpe, for the sleeves it needs. |
validate_track_record Minimum track record length
Minimum track record length (observations and years) for an observed Sharpe to beat a benchmark at a confidence level; with observations, the record's probabilistic Sharpe so far. For live or paper records; to size a backtest for its trials, use validate_backtest_length. A deflated Sharpe or overfitting probability above or below any threshold is not admission to anything and is not a forecast.
| Parameter | Type | Description |
|---|---|---|
non_excess_kurtosis * | number | Kurtosis, not excess kurtosis; 3 if Normal. |
observed_sharpe_annualized * | number | Annualized Sharpe as observed. |
periods_per_year * | number | Periods per year: 252 daily, 365 crypto, 52 weekly, 12 monthly. |
skew * | number | Skewness of returns; 0 if Normal. |
benchmark_sharpe_annualized | number | Annualized Sharpe to beat; default 0. |
confidence | number | Between 0 and 1; default 0.95. |
observations | integer | Record length so far, for its probabilistic Sharpe. |
validate_backtest_length Minimum backtest length
Minimum backtest length (years) before the best of N independent trials is not expected to reach a target Sharpe by luck; with backtest_years, the most trials those years allow. For planning a search; once it has a result, use validate_deflated_sharpe. A deflated Sharpe or overfitting probability above or below any threshold is not admission to anything and is not a forecast.
| Parameter | Type | Description |
|---|---|---|
backtest_years | number | Backtest length in years, for the most trials it allows. |
effective_independent_trials | integer | Independent trials tried (backtests, parameter sets, ideas). |
target_sharpe_annualized | number | In-sample annualized Sharpe you would call a discovery; default 1. |
validate_haircut_sharpe Haircut Sharpe ratio
Haircut Sharpe for multiple testing (Harvey and Liu 2015): the Sharpe a single test would have needed, by Bonferroni and independent tests, and with the other tests' Sharpes, Holm and BHY. For the probability the Sharpe is real, use validate_deflated_sharpe. A deflated Sharpe or overfitting probability above or below any threshold is not admission to anything and is not a forecast.
| Parameter | Type | Description |
|---|---|---|
observations * | integer | Return observations behind the Sharpe. |
observed_sharpe_annualized * | number | Annualized Sharpe as observed. |
periods_per_year * | number | Periods per year: 252 daily, 365 crypto, 52 weekly, 12 monthly. |
autocorrelation | number | Lag-1 autocorrelation of returns, -1 to 1; default 0. Corrects the annualized Sharpe (Lo 2002). |
other_sharpe_ratios_annualized | array | Annualized Sharpes of the other tests over the same observations; adds Holm and BHY. |
tests | integer | Tests run, this one included; gives the Bonferroni and independent-test haircuts. |
validate_luck_trials Luck-equivalent trials
How many skill-less strategies a search would need for its best to reach this Sharpe by luck (Monte Carlo), and with a trial count, the chance it did. States luck as the best of N random tries; for the probability the Sharpe is real, use validate_deflated_sharpe. A deflated Sharpe or overfitting probability above or below any threshold is not admission to anything and is not a forecast.
| Parameter | Type | Description |
|---|---|---|
observations * | integer | Return observations behind the Sharpe. |
observed_sharpe_annualized * | number | Annualized Sharpe as observed. |
periods_per_year * | number | Periods per year: 252 daily, 365 crypto, 52 weekly, 12 monthly. |
autocorrelation | number | Lag-1 autocorrelation of returns, -1 to 1; default 0. Corrects the annualized Sharpe (Lo 2002). |
effective_independent_trials | integer | Independent trials tried; adds the chance the best reached this Sharpe by luck. |
skew | number | Skewness; below -0.5 the reading warns the counts are too generous. |
audit_backtest Audit a backtest
One-call audit of a strategy's returns. Headline: one test whose false-positive rate was measured on nine return shapes (White's Reality Check with variants, luck trials with Lo's correction without). Then deflated Sharpe, minimum track record and, with variants, overfitting and out-of-sample decay, each with its receipt, plus fix_next. Send every variant tried (variants_file) so trials are counted; point returns_file at a CSV instead of pasting. A deflated Sharpe or overfitting probability above or below any threshold is not admission to anything and is not a forecast.
| Parameter | Type | Description |
|---|---|---|
periods_per_year * | number | Periods per year: 252 daily, 365 crypto, 52 weekly, 12 monthly. |
benchmark_sharpe_annualized | number | Annualized Sharpe to beat; default 0. |
confidence | number | Between 0 and 1; default 0.95. |
cross_trial_sharpe_sd_annualized | number | Standard deviation of annualized Sharpe across those trials. Optional with variants: measured from them, and the larger is used. |
effective_independent_trials | integer | Independent variants tried before choosing this one. Optional with variants: counted from them, and the larger number is used. |
n_splits | integer | Even number of blocks, at least 2; default 16. |
returns | array | Periodic returns as fractions (0.01 = 1%), oldest first; replaces the Sharpe, observations, skew and kurtosis. |
returns_column | Column name or 1-based position, when returns_file has several numeric columns. | |
returns_file | string | Path to a CSV or JSON of the returns on this machine (not on the hosted endpoint), instead of returns. |
variants | array | Optional returns of every variant tried (this one included), one row per period, one column per variant; adds the overfitting check. |
variants_file | string | Path to a CSV or JSON with one numeric column per variant, instead of variants. |
verify_receipt Verify a receipt
Verify a receipt offline: its Ed25519 signature against the bundled canlicapital.com key, its output hash and its id. Send an id to fetch it first, or the receipt itself. The receipt is content-hashed, reproducible from the open-source core it names, and signed with Ed25519 by a key published at https://canlicapital.com/.well-known/canli-receipt-keys.json.
| Parameter | Type | Description |
|---|---|---|
id | string | Receipt id from a validation result. |
include_receipt | boolean | With id: also return the stored receipt. |
receipt | object | A receipt object, to verify without fetching. |
service_status Service status
Whether the validation API is up, with its quotas; check after a timeout before resubmitting. No key. This verdict is about the series exactly as submitted. The service never saw the data source, its costs, survivorship, or any lookahead in how the series was built.
backtest_strategy Backtest a rule over a parameter grid, validated
Backtest a rule on your prices over a whole parameter grid, then validate the best with the count of variants actually run: deflated Sharpe, overfitting probability, minimum track record, vs buy and hold, after costs. A backtest, deflated or not, is not a forecast and not advice.
| Parameter | Type | Description |
|---|---|---|
family * | string | sma_cross (fast, slow), momentum (lookback, skip), mean_reversion (window, entry_z), breakout (lookback), buy_and_hold. |
allow_short | boolean | Short instead of flat; default false. |
cost_bps | number | Cost per unit of turnover, bps; default 5. |
dates | array | Optional ISO dates, one per value. |
grid | object | Values per parameter, e.g. {"fast":[10,20],"slow":[50,200]}; every valid combination runs (max 200). |
periods_per_year | number | 252 daily (default), 365 crypto, 52 weekly, 12 monthly. |
prices | array | Prices, oldest first. |
prices_column | Column name or 1-based position. | |
prices_file | string | CSV or JSON of prices on this machine; local server only. |
summarize_series Summarize a price or return series
A long price or return series in about 100 words plus fields: growth, risk, dated drawdowns, trend, volatility regime, tails, jumps, stale data. Use instead of reading raw bars. Nothing here is a forecast or advice.
| Parameter | Type | Description |
|---|---|---|
benchmark_returns | array | Same-period benchmark returns; adds beta. |
dates | array | Optional ISO dates, one per value. |
name | string | Label for the text. |
periods_per_year | number | 252 daily (default), 365 crypto, 52 weekly, 12 monthly. |
prices | array | Prices, oldest first; or returns, or series_file. |
returns | array | Returns as fractions, oldest first. |
series_column | Column name or 1-based position. | |
series_file | string | CSV or JSON of prices or returns on this machine; local server only. |
series_kind | string | series_file holds; default prices. |
stress_test Stress-test a strategy's returns
Stress a strategy's returns: bootstrap histories (how often the drawdown limit breaks or Sharpe turns negative) and named crash, volatility, repeat and stuck-position scenarios, with a fragility share. Frequencies over resampled histories are not forecasts of the future.
| Parameter | Type | Description |
|---|---|---|
block | number | Mean block length; default cube root of n. |
crash | number | Crash size, negative; default min(-0.2, 3x worst period). |
drawdown_limit | number | Fraction; default 0.2. |
outage_periods | integer | Stuck periods after the worst; default 5. |
paths | integer | Default 1000. |
periods_per_year | number | 252 daily (default), 365 crypto, 52 weekly, 12 monthly. |
returns | array | Strategy returns as fractions, oldest first. |
returns_column | Column name or 1-based position. | |
returns_file | string | CSV or JSON of returns on this machine; local server only. |
seed | integer | Default 42; reproduces exactly. |
volatility_multiplier | number | Default 2. |
check_feasibility Check a plan against broker limits and impact
Check a trading plan before it trades: broker order-rate and minimum-order limits, 2026 US day-trading rules, square-root market impact with crowding, and the capital where costs eat the return. Checks the plan as described against published broker limits and a market-impact model; it never contacts a broker or sees an account.
| Parameter | Type | Description |
|---|---|---|
adv_usd * | number | Daily dollar volume of a typical holding. |
capital_usd * | number | |
daily_volatility * | number | Of a typical holding, e.g. 0.02. |
orders_per_rebalance * | integer | |
rebalances_per_year * | number | |
turnover_per_year * | number | Buys plus sells a year / capital. |
account | string | |
asset_class | string | |
broker | string | Default other. |
copies | integer | Agents trading the same signal at once; default 1. |
expected_gross_return | number | Annual, before costs; adds capacity. |
impact_coefficient | number | Square-root law Y; default 1. |
minutes_per_rebalance | number | Default 1. |
orders_per_minute_limit | number | If the broker's is not on file. |
spread_and_fees_bps | number | Per trade; default 0. |
check_leakage Check a signal for lookahead
Does a signal look ahead? plan gives cuts; rerun your code on the first cut rows for each, then compare. Rows that changed used later rows; the result names the pattern and horizon. No code is sent. A pass covers only these cuts: the columns are the caller's, and survivorship, vendor revisions or a leak no cut reaches leave no trace.
| Parameter | Type | Description |
|---|---|---|
action * | string | |
columns | object | compare: {name: {full: [all rows], prefixes: [[first cuts[i] rows], ...]}}, null for missing. |
columns_file | string | compare, on your machine: a JSON file {cuts, columns} instead. |
cuts | array | compare: plan's cuts. |
observations | integer | plan: rows in the series. |
prefixes | integer | plan: cuts, default 5. |
seed | integer | |
timestamps | array | |
tolerance | number | Default 1e-9. |
placebo_test Test a research pipeline on placebo data
Does your pipeline find edges in noise? plan writes placebo files (your data's returns in random orders, so nothing is predictable); run the whole pipeline on real.csv and on each, then compare for a p-value that counts every choice it makes. Beating the placebos shows the pipeline finds more in the real order of the returns than in random orders of the same returns; it does not show the edge survives costs, capacity or the future.
| Parameter | Type | Description |
|---|---|---|
action * | string | |
columns | object | plan: {asset: [values]} instead of data_file. |
data_file | string | plan, on your machine: CSV or JSON, a column per asset, dates optional. |
kind | string | plan: default prices. |
lower_is_better | boolean | |
method | string | |
placebo_results | array | compare: its result on each placebo, in file order. |
placebos | integer | plan: default 19, up to 199. |
real | number | compare: the pipeline's result on the real data. |
seed | integer |