Skip to main content
Glama

Server Details

Backtest trading rules and read registered finance studies, on point-in-time data.

Ownership verified
Status
Healthy
Uptime
100.0% over the last 24 hours
OAuth
Works in Glama
Last Tested
Transport
Streamable HTTP · MCP 2025-11-25
URL
ChatGPT
QuanterLab: Backtest Trading
Claude
QuanterLab: Backtest Trading

TDQS

B3.4/5.0

Scored across 51 tools

Disambiguation3/5

The surface is heavily segmented by run type (start_backtest, start_test, start_walkforward, start_stochastic_backtest, start_regime_analysis, start_regime_optimization, start_primitives_run, run_circuit), and several of these overlap in intent, with verbose descriptions doing most of the disambiguating work. Near-name-twins like card_setting vs card_settings and list_my_projects vs list_my_primitives_projects actively invite misselection, and nine near-identical get_*_progress tools plus summarize_workflow all return the same result shape. Descriptions are unusually explicit about routing, which rescues an otherwise confusing set.

Naming Consistency3/5

Most names are snake_case verb_noun (start_*, get_*_progress, list_*, save_*, show_*, build_*), and the start_X / get_X_progress pairing is a good, predictable pattern. But the convention breaks in places: noun-first card_setting/card_settings/card_share/card_slider, circuit_step/circuit_draft/circuit_progress, a bare my_paper_trades with no verb, and bare search/fetch. Readable overall but clearly mixed conventions.

Tool Count2/5

51 tools is far beyond a comfortable surface, and much of the bulk is mechanical duplication: nine progress-polling tools, several of which (get_primitives_run_progress) explicitly cover multiple run kinds, plus catalogs and card-callback tools. A single parametrized progress tool and consolidated list_* tools could cut this dramatically without losing capability.

Completeness4/5

Coverage of the research lifecycle is strong: catalogs (indicators, primitives, stochastic methods), many run starters, progress, summarize/save/share, paper trading, and portfolio/company lookups. Gaps are secondary: there is no cancel/stop for a running task, no delete or rename for saved results, projects or trading configs, and no way to modify a saved lab project outside the canvas.

Available Tools

51 tools
build_circuitAInspect

Opens a window in the chat where a circuit of QuanterLab's lab cards is put together step by step, as the lab's canvas shows it: each card arrives, the wires join, and when it runs every card lights up in turn and the result shows under it. It fits a person's own idea that no ready test (start_test) covers, and a change to a circuit built here before (fresh false). The cards go on with circuit_step and the circuit runs with run_circuit. Each run covers the last year unless the person names a span, three years at the most; a longer test runs in the lab. The circuit is kept as the person's project when it runs, so it opens in the lab as built. A run that takes more than two minutes does not start at once: run_circuit answers with its time and why for the person, and runs with confirm: true after their yes.

    Args:
        name: Optional. A short name for the circuit, in the person's words ("RSI dip on KO, tested forward").
        fresh: Optional. False opens the window on the circuit built here last, to change it and run it again;
            else a new, empty circuit.
    

Inputs: name, fresh.

card_settingB
Read-onlyIdempotent
Inspect

For a circuit's result card only, which calls it when a card's control changes: the circuit that ran with the card's changes, on the same stock and years. A change already run today, by anyone, answers at once with its card (its words, figures and chart); a new one runs, the card lighting each of the circuit's cards as the engine runs it, and asks again until it answers. It uses none of the day's runs; an account makes at most 40 new results a day from the cards' settings and the slider together. The circuit itself is not saved: the answer's lab_url opens it in the lab with the changes.

    Args:
        task_id: The task_id of the run the card shows.
        changes: Every change from the run as it ran, each {"card": its id, "setting": its key, "value": ...}.
        run: The id of that change's run as the last answer gave it, sent back while it goes on.
    

Inputs: changes (required), task_id (required), run.

card_settingsC
Read-onlyIdempotent
Inspect

For a circuit's result card only, which calls it when the result shows: each card of the circuit that ran, with its name, one plain line on what it does and its settings as controls (a number within its bounds, a choice, a switch), the card's own changes made first. No price and no setting in money is among them, nor one past what a run from the chat takes.

    Args:
        task_id: The task_id of the run the card shows.
        changes: Optional. The changes the card shows, each {"card": its id, "setting": its key, "value": ...}.
    

Inputs: task_id (required), changes.

card_shareA
Idempotent
Inspect

For a ready test's result card only, its Share button: a public page on QuanterLab for the result the card shows (the run's own, or a slider's stop), made on the press: the test in plain words, its chart against simply holding, three figures, the day it ran and a link to run it in the lab. Nothing about the person. An account sharing the same result twice gets the same page; an account makes at most 10 pages a day.

    Args:
        task_id: The task_id of the ready test the card shows.
        value: The slider's stop the card shows; left out, the run's own result.
    

Inputs: task_id (required), value.

card_sliderA
Read-onlyIdempotent
Inspect

For a ready test's result card only, which calls it when its slider moves to a stop: the same test on the same stock and years with the test's one setting at that stop. A stop already run, by anyone, answers at once with its card (its words, figures and chart); a new one runs, and the card asks again until it answers. It uses none of the day's runs; an account makes at most 40 new slider results a day.

    Args:
        task_id: The task_id of the ready test the card shows.
        value: The stop the slider moved to.
        run: The id of that stop's run as the last answer gave it, sent back while it goes on.
    

Inputs: value (required), task_id (required), run.

check_portfolioA
Read-onlyIdempotent
Inspect

Check the person's own portfolio in numbers, on two years of daily returns, on a card: their mix among every other way to split the same holdings (the efficient frontier, the least-risk and best-ratio mixes and how far theirs is from the edge), which holdings move together, where the swings come from, the same holdings split four other ways (mean-variance, risk parity, calmer weigh more, a score) and where $1 of the mix could be in a year.

    Use it when the person gives their holdings and asks for them to be analysed or checked ("here is my
    portfolio: AAPL 20%, MSFT 10% ...", "analyse my holdings"). It reads the past and says nothing about what to
    do: begin your answer with the answer's `line` as it is, then at most one sentence; the card shows the rest.
    Five holdings at the least and 30 at the most, none above half of the money; weights that do not add to 100
    are scaled, and a list without weights is weighed equally.

    Args:
        holdings: Each holding's ticker or company name, and its weight in percent where the person gave one.

    The answer gives `line` (say it first) and `card` (what the card shows), or `message` when the check stays in
    QuanterLab.
    

Inputs: holdings (required).

circuit_draftB
Read-only
Inspect

For the circuit's window only, which calls it while the circuit is built: the steps since it last asked, the circuit as it is drawn, and the run once one starts. Waits a few seconds for the next step.

    Args:
        window: The window's own id, from build_circuit.
        n: The last step the window has shown.
    

Inputs: window (required), n.

circuit_progressB
Read-only
Inspect

For the circuit card only, which calls it while a ready test runs: which of the circuit's cards have run and which one is running, waiting a few seconds for the next one to finish; when the run has finished, the report card's words and figures, its growth chart and the offers to run next. A rule a start tool ran on its module answers with how far it is, then the same.

    Args:
        task_id: The task_id start_test answered with.
        seen: How many cards the card has already shown as run.
        now: The card it shows as running.
    

Inputs: task_id (required), now, seen.

circuit_stepA
Destructive
Inspect

Puts the circuit opened with build_circuit together, one step after another, each checked as the lab checks it: a card type from the catalog (list_primitives), ports by name, settings inside their ranges and the cards the account's plan has. Steps run in order; one that cannot be done stops the rest and says why, and the ones before it stay done. The answer gives each card's id, ports and settings, the wires, and what the circuit still needs before it runs.

    Args:
        steps: One to twelve steps, each an object with an op:
            {"op": "add_card", "type": "ticker", "id": "tk", "params": {"symbol": "KO"}, "after": "x"}
                a card from the catalog; id (optional, lower case, like "tk") names it, after (optional)
                places it to the right of another card; params left out keep the card's own
            {"op": "connect", "from": "tk.ticker", "to": "tpl.ticker"} an output port to an input port
            {"op": "set_card", "card": "bt", "params": {"horizon": "2y"}} changes settings
            {"op": "remove_card", "card": "tk"}; {"op": "disconnect", "from": "...", "to": "..."}
            {"op": "set_anchor", "date": "YYYY-MM-DD"} the day the forward test starts from (else the last
                three years, up to the last month's end)
            {"op": "clear"} empties the circuit
            A Signal Module's rule is its config, one JSON object written as text, e.g. {"direction": "long",
            "entry": {"indicator": "rsi", "params": {"length": 2}, "operator": "crosses_below", "value": 10},
            "exit": {"indicator": "rsi", "params": {"length": 2}, "operator": "crosses_above", "value": 70},
            "confirm": null}. A forward test covers three years at most; asked for more, it is held at three.
            The SEC cards: sec_insider_buying, sec_fund_holdings, sec_company_industry and report_words each
            take a universe's stockset and hand their survivors to a portfolio_builder and a
            portfolio_backtest; sec_company_events and sec_activist_stakes are each a test on their own, a
            universe's stockset in.
    

Inputs: steps (required).

describe_capabilityA
Read-only
Inspect

Match a natural-language intent string to one or more QuanterLab workflows.

    Returns a list of matching workflows with their name, description, required and optional parameters, estimated
    runtime, and what a request may leave open with the default each one takes (`defaults`). Use this to pick the
    right `start_*` tool when the user describes what they want in their own words. The run starts with those
    defaults, named in one short line with its result; the person's own changes come after it, as next steps. An
    open question that names no rule, stock or study ("what can you do", "show me something") is answered as
    get_started answers it: one question, what the person would like to test, over three setups from QuanterLab's
    Library, and nothing else; nothing plays before the person picks, also when they leave the choice to you. A
    request to run or see something that names no rule and no stock ("make a backtest", "test something", "show me
    what it does") gets that same answer, never a default rule.

    Args:
        intent: What the person wants, in their own words, e.g. "I want to find mean-reverting
            stocks", "backtest an RSI strategy on Apple", "is my SPY
            strategy overfit?".
    

Inputs: intent (required).

fetchB
Read-only
Inspect

The text of one published paper by the id search returned: title, byline, the pooled statistics the page prints, and the authored sections (abstract, methodology, findings, limitations, discussion), with the paper's public URL for citation. It ends with the paper's next steps, the person's idea first: a version of their own, or the paper's own circuit (start_test with study set to this id) with one of the settings the paper names changed by talking.

Inputs: id (required). Returns: object

get_backtest_progressA
Read-only
Inspect

Progress of a backtest started with start_backtest.

    Returns `{task_id, status, progress, message, dashboard_url}`;
    `status` is 'running', 'completed' or 'error' and `progress` 0-100.
    When the run has finished, the answer also carries `result`, the same
    summary `summarize_workflow` gives: the verdict in words and, for a
    run of a year or longer, a few rounded figures; and `report_url`, the
    report, which the run's card in the chat shows. A rule that ran as a
    circuit of the lab's cards answers here as get_primitives_run_progress
    answers it.
    

Inputs: task_id (required).

get_mr_scan_progressA
Read-only
Inspect

Progress of a mean-reversion scan started with start_mr_scan.

    Returns `{task_id, status, progress, message, dashboard_url}`. When the
    scan has finished, the answer also carries `result`, with the names
    that passed and the closest misses (`candidates`), and `report_url`, the
    report, which the run's card in the chat shows.

Inputs: task_id (required).

get_pairs_scan_progressA
Read-only
Inspect

Progress of a pairs scan started with start_pairs_scan.

    Returns `{task_id, status, progress, message, dashboard_url}`. When the
    scan has finished, the answer also carries `result`, with the pairs
    that passed and the closest misses (`candidates`), and `report_url`, the
    report, which the run's card in the chat shows.

Inputs: task_id (required).

get_primitives_run_progressA
Read-only
Inspect

Progress of a lab run started with start_primitives_run, start_test, run_circuit, or start_backtest and start_walkforward when they ran the rule as a circuit (their answer's kind is primitives_run).

    Returns `{task_id, status, progress, message, dashboard_url}`; `status` reaches `done` or
    `error`. When the run has finished, the answer also carries `result`, the same summary
    `summarize_workflow` gives: the verdict in words and, under `figures.branches`, each branch
    by its card name with its dates, whether it beat simply holding and its benchmark, and for a
    branch tested over a year or longer its rounded return, Sharpe, worst drop and trades; and
    `report_url`, the report, which the run's circuit card in the chat shows (for a ready test from
    `start_test`, `offers` gives the next runs with their exact calls).
    

Inputs: task_id (required).

get_primitives_run_resultC
Read-only
Inspect

The outcome of a finished lab run in tiers, one row per result of the circuit: performance_tier, drawdown_band, trades_tier, skill_band, a market-state label and the like, each row under the card name the project gives its branch. The figures (dates, whether each branch beat simply holding, and for a year or longer the rounded return, Sharpe, worst drop and trades) come with get_primitives_run_progress as result, and from summarize_workflow. Point in time: the run's anchor and any look-ahead warning are given.

Inputs: task_id (required).

get_regime_analysis_progressA
Read-only
Inspect

Progress of a regime analysis or pairs check started with start_regime_analysis.

    Returns `{task_id, status, progress, message, dashboard_url}`. When the
    analysis has finished, the answer also carries `result`, the same
    summary `summarize_workflow` gives (for a pair, the pairs check), and
    `report_url`, the report, which the run's card in the chat shows.

Inputs: task_id (required).

get_regime_optimization_progressA
Read-only
Inspect

Progress of a regime optimization started with start_regime_optimization.

    Returns `{task_id, status, progress, message, dashboard_url}`. When the
    run has finished, the answer also carries `result`, the same summary
    `summarize_workflow` gives, and `report_url`, the report, which the
    run's card in the chat shows.

Inputs: task_id (required).

get_startedA
Read-only
Inspect

The first contact: what QuanterLab is and what it can do, for a hello, a question about QuanterLab, a request for help, a person with no rule in mind yet, or a request to run or see something that names no rule and no stock (make a backtest, test something, show me what it does). It answers with what QuanterLab does (tests that guard against overfitting, 20 years of daily point-in-time data, S&P 500 tests on the companies that were in the index on each date) and one question, what the person would like to test, over three setups from QuanterLab's Library, picked by their stored results and varied in kind, one tap each; the card also offers a company to look up, the person's own portfolio and a trading idea of their own. Its card is the answer: after it, ask only that question. It starts nothing. A tapped setup plays with start_test from its stored result, card by card, using none of the person's runs, and nothing plays before the person picks, also when they left the choice to you; a rule or a stock of their own is tested as they name it, and an idea of their own is built from the lab's cards in the chat with build_circuit, a year a run unless they name a span. plain says the same in words for a host that shows no cards.

Inputs: no named parameters.

get_stochastic_backtest_progressB
Read-only
Inspect

Progress of a stochastic backtest.

    Returns `{task_id, status, progress, message, dashboard_url}`. When the
    run has finished, the answer also carries `result`, the same summary
    `summarize_workflow` gives, and `report_url`, the report, which the
    run's card in the chat shows.

Inputs: task_id (required).

get_walkforward_progressA
Read-only
Inspect

Progress of a walk-forward started with start_walkforward.

    Returns `{task_id, status, progress, message, dashboard_url}`;
    progress moves window by window. When the run has finished, the answer
    also carries `result`, the same summary `summarize_workflow` gives, and
    `report_url`, the report, which the run's card in the chat shows. A
    rule that ran as a circuit of the lab's cards answers here as
    get_primitives_run_progress answers it.
    

Inputs: task_id (required).

keep_writeupA
DestructiveIdempotent
Inspect

Keep a write-up with the report of a finished QuanterLab run of the person's own, so the report they open and share carries it.

    Call it after you have written a run's write-up for the person (when they asked for one, for example with
    the card's Write it up): pass the run's task_id and the write-up's text as you wrote it. It is kept as plain
    text, in paragraphs and short heads: links, markup and anything that is not text are taken out, and at most
    4,000 characters are kept. A second call for the same run replaces the first. A run that is still going,
    or that is not the person's, is refused in one line.

    Args:
        task_id: The task_id of the finished run the write-up is about.
        text: The write-up as you wrote it for the person.

    The answer says whether it was kept (`kept`) and gives the report's link (`report_url`) to show the person.
    

Inputs: text (required), task_id (required).

list_fundamental_analyzersA
Read-only
Inspect

List the single-stock fundamental analyzers available in QuanterLab.

    Returns each analyzer's code, human-readable name, a one-line
    blurb, and the list of extra parameters it accepts (beyond
    `ticker`). The analyzers run on quanterlab.com, from the Supplementary
    Data menu at the top of the site; this catalog lists what is there.
    It analyses nothing itself: a question about one company (to look it
    up or analyse it, its fundamentals or its SEC filings) is answered in
    the chat by show_company.
    

Inputs: no named parameters.

list_indicatorsA
Read-only
Inspect

List the technical indicators QuanterLab supports for strategy building.

Returns metadata only: id, display name, category, parameters with defaults
and bounds, and a short description of typical use. Does NOT return any
market data or computed indicator values.

Args:
    category: Optional category filter, e.g. "momentum", "trend", "volatility", "volume".
    search:   Optional case-insensitive substring matched against indicator id and display name.

Inputs: search, category.

list_my_backtestsA
Read-only
Inspect

List the authenticated user's saved backtest results, newest first.

    Returns ID + strategy code + ticker + duration + total_trades + a
    categorical `performance_tier` enum (one of `promising` / `mixed` /
    `weak` / `unrated`) so the caller can rank or filter without seeing
    the underlying Sharpe / drawdown / return scalars. Each saved run
    opens on quanterlab.com, signed in: the sidebar's Research Library,
    under Reports. A run started from an assistant appears here only
    after `save_workflow_result`; its own report stays at the `report_url`
    it answered with.

    Args:
        strategy_code: Optional filter, for example "UB001UNIV", "SC001STCB",
            "RG001RGMO". When omitted, returns backtests from all strategies.
        limit: Max rows to return (1-100, default 20).
    

Inputs: limit, strategy_code.

list_my_filter_resultsB
Read-only
Inspect

List the user's saved scanner / filter results, newest first.

    Returns summary fields only (universe size, stocks passed, pass rate).
    The names each one passed open on quanterlab.com, signed in: the
    sidebar's Research Library, under Reports.
    

Inputs: limit.

list_my_primitives_projectsA
Read-only
Inspect

List your saved lab projects (circuits on the canvas), newest first.

    Each row: the project's `id`, its name, how many cards its circuit has, how many
    hypotheses are registered, and when it was created and last changed. The circuit, its
    settings and its results stay on QuanterLab, where a project opens on the canvas. Run one
    with `start_primitives_run` and its `id`.
    

Inputs: no named parameters.

list_my_projectsA
Read-only
Inspect

List the user's projects with item counts.

    These are the My Projects folders on quanterlab.com (saved items and
    notes), not the lab's circuits: those are `list_my_primitives_projects`.
    Returns project metadata only (name, description, category, item
    count, timestamps). A project's items open on quanterlab.com, under
    My Projects.

Inputs: no named parameters.

list_my_running_tasksA
Read-only
Inspect

List the person's runs that are still counted as running (at most 3 at once).

    Returns one row per run: its task_id, its kind, the seconds since it
    last reported progress, and `wedged`, true when it has reported no
    progress for 15 minutes and will be let go at the next start_* call.

    Use this when a start_* call is refused because 3 runs are already
    going and it is not clear which, most often after a conversation
    moved on in the middle of one. Read it before proposing a run's
    settings: `runs_left_today` is how many runs of today's allowance
    are left (null when the account has no daily count), and
    `runs_today` says it in words.

    Returns `{count, limit, tasks: [{task_id, kind, last_progress_age_s,
    wedged}], runs_left_today, runs_today, _data_policy}`. No market
    data, only the person's own runs.
    

Inputs: no named parameters.

list_my_trading_configsA
Read-only
Inspect

List the user's saved trading configs (exported from strategy builders).

    Default rows carry ID + strategy_type + strategy_code + trade_count
    tier + categorical performance_tier, without redistributing the
    user's full ticker watchlist on every call. Pass `include_details=True`
    to opt into the full row (ticker, timeframe, primary indicator,
    virtual_today). Opting in is logged for audit.

    Args:
        limit: Max rows to return (1-100, default 20).
        include_details: When True, returns the ticker / timeframe /
            primary_indicator / virtual_today / config_id fields.
            Defaults to False to avoid redistributing the full
            watchlist on every list call (opting in is audited).

Inputs: limit, include_details.

list_primitivesA
Read-only
Inspect

List the cards of QuanterLab's lab, the canvas where a strategy is drawn as a circuit of cards.

    On the canvas a strategy is a chain of research cards: universe, selection, signal or
    stochastic model, optimizer, walk-forward, forward test (the tools call a card a primitive).
    This returns the card catalog: each card's type, label, category, input and output ports,
    settings and description. build_circuit puts these cards together in the chat, step by step, and
    run_circuit runs the circuit, three years a run. Market data, saved circuits and results come from
    the run tools.

    Args:
        category: Optional category filter (e.g. "signal", "regime", "filter", "forward",
            "optimize", "factor", "autopsy", "analysis", "allocate").
        search:   Optional case-insensitive substring matched against block type and label.
    

Inputs: search, category.

list_stochastic_methodsA
Read-only
Inspect

List the stochastic methods QuanterLab supports for start_stochastic_backtest.

Returns metadata only: id, display name, category, parameters with defaults
and bounds, and a short description. Use this to discover valid
`primary_method.id` values for `start_stochastic_backtest`. Does NOT return
any market data or fitted parameter values.

Args:
    category: Optional filter, e.g. "mean_reversion", "trend", "pairs", "regime".
    search:   Optional case-insensitive substring matched against method id and name.

Inputs: search, category.

my_paper_tradesA
Read-only
Inspect

How the person's strategies tracked live on paper are doing: each one's name, the day it went live, today's state in words, and its own change since it went live next to simply holding over the same days, in whole percents: the answer to how their strategy, their paper trade or their live test is doing. Nothing here places an order or moves money.

Inputs: no named parameters.

run_card_progressB
Read-only
Inspect

For the report card only, which calls it while a run started from the chat goes on: how far the run is, waiting a few seconds for it to move on; when the run has finished, the card itself (its words, figures, chart and offers); when it stopped, the connector's words for why.

    Args:
        task_id: The task_id the start answered with.
        progress: How far the card already shows the run, in percent.
    

Inputs: task_id (required), progress.

run_circuitAInspect

Runs the circuit built with build_circuit and circuit_step, on the lab's engine, over three years at most, and keeps it as the person's project, so its report's Open in the lab puts the same circuit on the canvas. The window lights up card by card as it runs and the result appears under it. get_primitives_run_progress follows it by its task_id; when the run has finished it answers with the result and report_url, the run's report. Every account runs it within a daily allowance; a refused call does not count. A circuit asked for more than three years runs three, and held says so in one line: a longer test runs in the lab. A run that takes more than two minutes does not start at once: the answer gives its time and why to ask the person with ("This one takes about 25 minutes (20 years of the S&P 500). Run it?"), and the same call with confirm: true starts it after their yes.

    Args:
        name: Optional. The project's name in the person's words, when the circuit has none yet.
        question: Optional. One sentence restating what the run should answer, not the person's message: the
            title of the report, and kept only as that.
        confirm: Optional. True only after the person said yes to the time a first call of this run gave.
    

Inputs: name, confirm, question.

save_trading_configAInspect

Save the settings a run was started with as one of the person's trading configs.

    Saves what the person (or you on their behalf) set to start the
    run (ticker, indicator, conditions, risk settings). It shows under
    Trading configs in the Basic Strategies menu at the top of
    quanterlab.com, where the person can run it again.

    Useful AFTER you've validated a config (e.g. walk-forward looked
    good) so the user has it in their working library.

    It does not track the strategy live, and starts no paper trade:
    when the person asks to start it live, follow it or paper trade
    it, start_paper_trade does that, with a note on it every morning.

    Note: only saves for kinds that produce a deployable strategy
    (backtest, walkforward, stochastic_backtest, basic_backtest,
    regime_optimization). Scanner kinds (mr_scan, pairs_scan) don't
    have a config to save in this sense; save_workflow_result keeps
    their result instead.

    A rule that ran as a circuit of the lab's cards is kept as that
    circuit, with its report, under the report's name: `config_url`
    opens it in the lab, where it runs again as it ran.

    Args:
        task_id: The task_id returned by a prior `start_*` call.
        label: Optional human-readable label, max 100 chars.
    

Inputs: task_id (required), label.

save_workflow_resultAInspect

Save a finished run's result to the person's library on QuanterLab.

    The run is kept where the person finds it later, in the sidebar's
    Research Library on quanterlab.com, under Reports (one row with the
    report the run answered with):

      - a backtest, walk-forward, stochastic, basic or regime run, with
        its figures, trades, equity line and settings, opening as a full
        report;

      - a scan, with the names it passed and their settings.

    The run has to be finished: a save of a running task is refused
    with a message saying to wait for it.

    Args:
        task_id: The task_id returned by a prior `start_*` call.
        label: Optional name for the saved run, at most 100 characters.
            Without one it is named by its kind and stock ("Backtest on
            SPY, from an assistant"). A rule that ran as a circuit of the
            lab's cards is kept as its report, under the report's name.

    The answer carries `report_url`, the saved report's page, and
    `where`, the same place described in words (the sidebar's Research
    Library on quanterlab.com), for apps that rewrite links.
    

Inputs: task_id (required), label.

show_companyA
Read-onlyIdempotent
Inspect

Show a public company in its own numbers, as it filed them with the SEC, on a card: where its revenue went in its last annual report (costs, expenses, tax and profit), ten years of revenue and net profit, where it stands among its peers (ranks only), and what it does, in its own words.

    It is the answer to any question about one company or its stock that asks for no test, whatever its verb: to
    look it up, analyse it or research it, its fundamentals, its financials, its SEC filings, what it does or how
    it is doing ("look up NVDA", "analyse Apple", "Tesla's fundamentals", "what do Microsoft's filings show",
    "what do you think about NVDA", "tell me about Apple", "is Microsoft a good company", "should I buy NVDA").
    It answers at once, in the chat, from the company's ticker or name alone; no other tool comes first.
    QuanterLab gives no view on a stock: begin your answer with the answer's `line` as it is, then at most one
    sentence; the card shows the rest. A company QuanterLab holds no annual filings for is said in one line.

    Args:
        company: The company's ticker (NVDA) or its name (Nvidia).

    The answer gives `line` (say it first), `card` (what the card shows) and `company`.
    

Inputs: company (required).

show_report_cardA
Read-only
Inspect

Show a QuanterLab report as a card in the chat: what was compared, the test's figures beside simply holding the same asset, and a growth-of-$1 chart (for a stochastic run with a parameter grid, the grid of each setting's Sharpe with the best one outlined, its cells in grid), a button to open the full report, and the card's next steps as choices a tap puts in the chat, with one to change a setting (on a lab run, the choices open the project in the lab, where the change is made). It is for a report with no card in the chat yet: the link summarize_workflow or save_workflow_result answered with (a backtest, walk-forward, stochastic backtest, regime analysis or optimization, scan or lab run), or a report link the person pastes. A run started in this chat shows its result in its own card, so the report_url a start or its progress tool answered with needs no second card. One call shows the card, and the card offers the report's next steps as choices. The card shows what was compared and the figures; say what the result means in your own words.

    Args:
        report_url: the link summarize_workflow or save_workflow_result answered with
            (https://quanterlab.com/r/..., /report/..., /backtest-report/... or /filter-report/...), or a
            report link the person pastes.
    

Inputs: report_url (required).

start_backtestAInspect

Run a backtest of an indicator rule on one stock or ETF, on daily bars.

    A rule the lab's cards hold runs as a circuit of them on the lab's engine, as the lab's assistant builds it
    for the same words, over the span asked: the optimizer tries the settings around the rule on the two years
    before and picks the best, the forward test runs that pick against simply holding, and the autopsy deals the
    test's days again in new orders. It holds the entry's conditions (all must hold to buy), one exit condition, a
    confirming filter, a target and a holding limit (an indicator, or one of its lines, against a level, another
    of its lines or the price; two moving averages crossing); a short side runs long, a share of the account as
    the whole account, a commission as the lab's costs and a stop as the lab's Stop Loss card, each said in one
    line. Its card draws the circuit, lights each card as the run reaches it, shows the result under it, the
    surface of the settings the optimizer tried with its pick, and the fan of the dealt days; a change to a card's
    settings on the card runs it again. Its answer's kind is primitives_run, and get_primitives_run_progress
    follows it. Tuning window by window on past years is start_walkforward. Two exit conditions in one list run on
    the backtester, as before.

    No setting has to be settled before it runs: what the request leaves open (the stock or fund, the
    history, the entry and exit levels, the costs) runs with sensible defaults, which the result names in
    one short line; a change is a new run. `question` titles its report. The call waits for the run while it
    is likely to finish inside it, then answers with the result; the run's card in the chat shows the result
    or, for a longer run, how far it is, and fills in by itself, with the next steps as choices. A run
    started here needs no `show_report_card`.

    Every account runs it within a daily allowance; a refused call does not count, and get_started and
    every run's answer give today's count.

    A run takes about 30 seconds to 3 minutes. The call returns
    `{task_id, status, kind, dashboard_url}` at once.
    `get_backtest_progress(task_id)` reports progress; when the run has
    finished, its answer carries `result`: the summary in words and, for
    a run of a year or longer, a few rounded figures (the run's return
    next to simply holding the same stock over the same dates, Sharpe,
    worst drop, trades), and `report_url`, the full report.

    `list_indicators()` lists the indicators, their settings and the
    columns each one computes. An indicator is written
    `{"id": "rsi", "params": {"length": 14}}`.

    Args:
        ticker: Stock or ETF symbol (uppercase).
        entry_indicator / entry_conditions: The entry signal (required).
        exit_indicator / exit_conditions: Optional.
        confirmation_indicator / confirmation_conditions: Optional, a filter that
            must also hold on the day the entry fires. The common use is a trend
            filter: a two-day RSI pullback that buys only while the close is above
            its 100-day average is written as confirmation_indicator
            {"id": "sma", "params": {"length": 100}} and confirmation_conditions
            [{"column": "close", "operator": ">", "value": "SMA_100"}].
        timeframe: '1d' (daily bars, the only timeframe this connector runs).
        duration: The history tested, a span back from today: '60d', '6m',
            '1y', '2y', '3y', '5y', '10y' or 'max'; left out, or as given when the person named no span, the last year, said once with the longer run as the next step
            (on the lab's cards the last three years, said in one line; on the
            backtester the whole history held, up to 30 years).
            There is no start date: 'since 2010' is '10y' or 'max', and the
            figures carry the years the run covered.
        direction: 'long' | 'short' | 'both'.
        position_sizing: 'fixed' | 'percent_equity' (the default, as in
            the QuanterLab UI).
        risk_per_trade: Share of the account each trade uses. 1.0, the
            default, is the whole account, as in the QuanterLab UI; a
            smaller share leaves the rest in cash and scales the result
            down with it. Sizing across several positions (Kelly, GARCH,
            fixed) is handled in QuanterLab's portfolio and paper-trading
            tools.
        stop_loss_pct / take_profit_pct / max_holding_days: Optional exits.
        spread_bps / commission_per_trade: Trading costs (default a 10
            basis point spread and no commission).
        oos_pct: Share of the history held back, 0-100 (default 0). The
            run tests only the earlier part, and its result and report say
            the held-back part was never tested; the same run again with
            `oos_pct` 0 tests the whole history.

    Conditions are lists of `{"column": ..., "operator": ..., "value": ...}`;
    every condition in a list has to hold.
        operator: ">", ">=", "<", "<=", "==", "!=", "crosses_above" or
            "crosses_below".
        column: a column the strategy's indicators compute, as
            `list_indicators()` names it ("RSI_14"; "MACD_12_26_9",
            "MACDh_12_26_9" and "MACDs_12_26_9" for the MACD line,
            histogram and signal line), or a price field ("close").
        value: a number, or another column the strategy computes
            (SMA_50 against SMA_200 needs an sma of each length among
            the strategy's indicators).
    Entry and exit usually mirror each other: RSI below 30 in, above 70
    out; MACD crossing above 0 in, crossing below 0 out. An exit identical
    to its entry closes on the entry bar or never, and the run makes no
    trades. A golden cross is entry_indicator sma 50 and exit_indicator
    sma 200, with entry SMA_50 crosses_above SMA_200 and exit SMA_50
    crosses_below SMA_200; a trend line of N days is sma N in both lanes,
    with close crosses_above SMA_N in and crosses_below out.

    Example, long-only MACD momentum on PLTR, the person asking for three years:

        start_backtest(
            ticker="PLTR",
            entry_indicator={"id": "macd",
                             "params": {"fast": 12, "slow": 26, "signal": 9}},
            entry_conditions=[{"column": "MACD_12_26_9",
                               "operator": "crosses_above",
                               "value": 0}],
            exit_indicator={"id": "macd",
                            "params": {"fast": 12, "slow": 26, "signal": 9}},
            exit_conditions=[{"column": "MACD_12_26_9",
                              "operator": "crosses_below",
                              "value": 0}],
            timeframe="1d", duration="3y", direction="long",
        )

    question: Optional. One sentence restating what the run should answer
        ("does the 2-day RSI pullback beat holding SPY?"), not the person's
        message: the title of the report the finished run becomes, and kept
        only as that.

    `report_url` is the run written up as a QuanterLab report (the answer
    against simply holding the stock and SPY, the charts, the numbers,
    what the test cannot tell), and the run's card shows its link, which
    opens without a login. A run can also be kept in the user's library with
    `save_workflow_result` (the result) and `save_trading_config` (the
    settings), when the user wants to keep it.
    

Inputs: ticker (required), entry_indicator (required), entry_conditions (required), oos_pct, +15 more.

start_mr_scanAInspect

Run QuanterLab's mean-reversion scanner across an index.

    Every account runs it within a daily allowance; a refused call does not count, and get_started and
    every run's answer give today's count.

    A scan takes about 30 seconds to 3 minutes. The call returns
    `{task_id, status, kind, dashboard_url}`; `get_mr_scan_progress(task_id)`
    reports progress and, when the scan has finished, carries `result`:
    each filter's rule as applied with how many names passed it, and up
    to ten names, those that passed every filter and then the closest
    misses, ranked, each with its own statistics rounded (`candidates`).

    `steps` is an ordered list of filters, each
    `{"type": ..., "params": {...}}`; a name has to pass a filter to reach
    the next. The filters and their settings, defaults in brackets:
        hurst           max_h, the highest Hurst exponent that passes [0.45];
                        window, bars [100]
        halflife        min_hl and max_hl, the half-life band in days [5, 100]
        adf             max_pvalue, the highest ADF p-value that passes [0.05]
        kpss            min_pvalue, the lowest KPSS p-value that passes [0.05]
        variance_ratio  max_vr, the highest variance ratio [0.95]; lag, bars [5]
        autocorr        max_acf, the highest lag-one autocorrelation [0.0]
        volatility      min_vol and max_vol, annual volatility as a fraction
                        [0.15, 0.60]
        liquidity       min_dv, average daily dollar volume in millions [10]

    Args:
        steps: The filters, in order (required).
        index: The universe: 'sp500', 'nasdaq100' or 'dowjones'. Asked for another index (the DAX, the
            FTSE 100), pass it all the same: QuanterLab answers with its note and the same scan on the S&P
            500, and nothing runs.
        timeframe: '1d' (daily bars, the only timeframe this connector runs).
        duration: The history: '6m', '1y' or '3y'.
        question: Optional. One sentence restating what the run should answer, not the person's
            message: the title of the report the finished run becomes, and kept only as that.

    When the run has finished, its answer also carries `report_url`: the scan written up as a QuanterLab
    report (the funnel and every name that passed). The call waits for the run while it is likely to finish
    inside it; the run's card in the chat shows the result or, for a longer run, how far it is, and fills in
    by itself, with the next steps as choices and the report link. A run started here needs no
    `show_report_card`.
    

Inputs: steps (required), index, duration, question, +1 more.

start_pairs_scanAInspect

Scan an index for pairs of stocks that move together.

    For one chosen pair (KO and PEP, say), `start_regime_analysis` with
    `ticker` and `ticker_b` checks that pair directly.

    Every account runs it within a daily allowance; a refused call does not count, and get_started and
    every run's answer give today's count.

    A scan takes about 1 to 5 minutes (every pair in the universe after
    a correlation screen). The call returns `{task_id, status, kind,
    dashboard_url}`; `get_pairs_scan_progress(task_id)` reports progress
    and, when the scan has finished, carries `result` with up to ten
    pairs, those that passed every filter and then the closest misses,
    each with its own statistics rounded (`candidates`).

    `steps` has the same shape as in `start_mr_scan`. The filters and
    their settings, defaults in brackets:
        correlation      min_corr, the lowest return correlation [0.7]
        cointegration    max_pvalue, the highest Engle-Granger p-value [0.05]
        spread_halflife  min_hl and max_hl, the spread's half-life band in
                         days [5, 60]
        beta_stability   max_cov, how much the hedge ratio may vary, in
                         percent [50]; window, bars [60]
        spread_hurst     max_h, the highest Hurst exponent of the spread [0.45]
        johansen         min_rank, the fewest cointegrating relations [1]

    Args:
        index: 'sp500', 'nasdaq100' or 'dowjones'. Asked for another index (the DAX, the FTSE 100), pass it all
            the same: QuanterLab answers with its note and the same scan on the S&P 500, and nothing runs.
        question: Optional. One sentence restating what the run should answer, not the person's
            message: the title of the report the finished run becomes, and kept only as that.

    When the run has finished, its answer also carries `report_url`: the scan written up as a QuanterLab
    report (the funnel and every pair that passed). The call waits for the run while it is likely to finish
    inside it; the run's card in the chat shows the result or, for a longer run, how far it is, and fills in
    by itself, with the next steps as choices and the report link. A run started here needs no
    `show_report_card`.
    

Inputs: steps (required), index, duration, question, +1 more.

start_paper_tradeA
Destructive
Inspect

Start a strategy live: it runs on live market data, on paper, with a note on it every morning (the lab's paper trade). It is what "start it live, follow it, paper trade it, run it live, watch it" ask for, and what a tap on a run's offer to start it live does. save_trading_config never does this: it keeps a run's settings, and nothing goes live from it.

    A first call starts nothing: its answer carries `ask`, the question for the person, with two offers. The same
    call with confirm=true, made after the person's yes, starts it.

    What it tracks: a finished run of this account (task_id: a ready test, a paper's circuit, a saved lab
    project's run, a backtest or a walk-forward), a published paper (study, from search or fetch) or one of the
    person's saved lab projects (project_id, from list_my_primitives_projects).

    It registers the strategy in the person's saved work, sets it up on paper with 100,000 for 90 days, checks it
    on the last six months and puts it live. Its first update comes after the next US market close. When the
    check takes longer, it goes on on QuanterLab and the strategy goes live by itself when it is done. Nothing
    here places an order or moves money: it is simulated on paper, on the data served each day.

    An account runs one strategy at a time. With one already tracked, a call starts nothing and its `ask`
    offers the swap, with two offers. The same call with replace=true and the replace_id its message names,
    made after the person's yes, stops that one (its record is kept) and tracks this one instead.

    Its card shows what started; `message` and `open_url` say the same for a host without cards. A strategy that
    cannot go live as it is answers with why in `message`, and, for a paper whose data stops at its publication,
    an offer with the exact call of its live version. my_paper_trades says later how it is doing.

    Args:
        task_id: The task_id of one of this account's finished runs.
        study: Instead of task_id, a published paper's id.
        project_id: Instead of task_id, the id of one of the account's saved lab projects.
        live_version: With study, true tracks the paper's live version: the same rule on the data served
            today.
        replace: True once the person has said yes to tracking this one instead of the one the account
            tracks.
        replace_id: With replace, the id of the strategy the account tracks, as the answer that asked names it.
            Another one tracked by then is asked about again.
        confirm: True once the person has said yes to the question the first call asked.
    

Inputs: study, confirm, replace, task_id, +3 more.

start_primitives_runAInspect

Run one of your saved lab projects (a circuit on the canvas, its latest version) and return a task id to poll. The project runs as saved, at its point-in-time anchor, and takes no settings but index. Its card draws the project's own circuit as the lab draws it, lights each card as it runs and shows the result under it. Get a project id from list_my_primitives_projects, then poll get_primitives_run_progress: when the run has finished its answer carries result, each branch of the project under the card name the project gives it, whether it beat simply holding what it trades over the same dates, and, for a branch tested over a year or longer, a few rounded figures.

    Every account runs it within a daily allowance; a refused call does not count, and get_started and
    every run's answer give today's count.
    A paper-trade card runs as a marker in the test; start_paper_trade with the run's task_id tracks the
    project live, on paper, with a note on it every morning.

    The circuit and its settings stay on QuanterLab. This run's curves are in its report
    (`report_url`, below); `result.lab_url` opens the project on the canvas, where the person
    changes it and saves it.

    When the run has finished, its progress answer also carries `report_url`: the run written up
    as a QuanterLab report (the circuit drawn, each branch that trades against simply holding and
    SPY, and what followed each event of an event-study card). The circuit card shows the result
    under the circuit, with the next steps as choices and the report link, so a run started here
    needs no `show_report_card`.

    Args:
        project_id: The `id` of one of your saved lab projects.
        question: Optional. One sentence restating what the run should answer, not the person's message:
            the title of the report, and kept only as that.
        index: Optional. sp500, nasdaq100 or dow30: the project's cards that pick their stocks from an
            index QuanterLab has today's members of only (the DAX, the CAC 40, the FTSE 100, the EURO
            STOXX 50, the Hang Seng, the Nikkei 225) pick from this US index instead, its members as they
            were on each date, for this run only; the saved project is left as it is. QuanterLab's note
            offers it after such a run.
    

Inputs: project_id (required), index, question.

start_regime_analysisAInspect

Analyze one stock, or check one chosen pair of stocks.

    One stock: HMM regime detection, Hurst exponent, Bollinger/Keltner
    squeeze, Monte Carlo forward simulation.

    A pair (`ticker` and `ticker_b`, e.g. KO and PEP): whether the two
    hold together for spread trading. The QuanterLab pairs check rates
    the evidence that the two prices hold together as strong, mixed or
    weak, with a score out of a hundred, from the Engle-Granger and
    Johansen cointegration tests, the spread's half-life, how much the
    hedge ratio moves, and how often the two stocks share a market
    regime. It is the check to run when someone asks "is X / Y a
    tradable pair?" about any two stocks; `start_pairs_scan` searches a
    whole index for pairs instead.

    Every account runs it within a daily allowance; a refused call does not count, and get_started and
    every run's answer give today's count.

    An analysis takes about 30 seconds to 2 minutes. The call returns
    `{task_id, status, kind, dashboard_url}`; `get_regime_analysis_progress`
    reports progress and, when it has finished, carries `result`: for one
    stock, the regime now and how long it has run, volatility against the
    stock's own history, how the stock behaves (trending, mean reverting
    or a random walk), its trend and its drops, rounded; for a pair, how
    strong the evidence is that the two hold together and the check's
    score, the cointegration tests as p-value bands, the spread's
    half-life, the hedge ratio's variation, the correlation, and how often
    the two shared a regime, rounded.

    Unlike `start_regime_optimization`, which uses HMM regimes to
    grid-search trading thresholds, this analysis is descriptive.

    Args:
        ticker: Stock symbol (uppercased). Required.
        ticker_b: Optional second ticker; with it the analysis checks the
            pair (`ticker` / `ticker_b`) for spread trading.
        mode: Optional. `'volatility'` runs only the squeeze module.
        years: Lookback window in years (default 2).
        params: Optional dict overriding module-specific knobs. Most
            useful: `hmm_enabled` / `hurst_enabled` / `squeeze_enabled` /
            `mc_enabled` (disable modules); `hmm_states`; `mc_simulations`.
        question: Optional. One sentence restating what the run should answer, not the person's
            message: the title of the report the finished run becomes, and kept only as that.

    When the run has finished, its progress answer also carries `report_url`: the analysis written up as
    a QuanterLab report (the market states and their spells, or for a pair the checks of whether the two
    hold together). The call waits for the run while it is likely to finish inside it; the run's card in
    the chat shows the result or, for a longer run, how far it is, and fills in by itself, with the next
    steps as choices and the report link. A run started here needs no `show_report_card`.
    

Inputs: ticker (required), mode, years, params, +2 more.

start_regime_optimizationAInspect

Run QuanterLab's regime-aware threshold optimization.

    Adaptive threshold optimization via HMM regime detection plus
    per-regime grid search. Long-running (typically 2-10 min). Returns
    `{task_id, status, kind, dashboard_url}`; `get_regime_optimization_progress`
    reports progress and, when the run has finished, carries `result`.

    Every account runs it within a daily allowance; a refused call does not count, and get_started and
    every run's answer give today's count.

    Args:
        ticker: Asset to analyze.
        base_config: Strategy template, the same shape as
            `start_backtest`'s arguments (entry/exit indicators and
            conditions).
        param_x / param_y: The two settings to grid over, each
            `{"name": ..., "min": ..., "max": ...}` with an optional
            "steps" (2-30; default `grid_steps`). "name" is one of:
              "entry.length"         a setting of the entry, exit or
                                     confirmation indicator ("exit.fast")
              "rsi.length"           the same, found by the indicator's id
                                     when exactly one lane uses it
              "entry.conditions[0]"  the number an entry, exit or
                                     confirmation condition compares against
            Indicator settings move in whole numbers: a decimal setting
            (Bollinger's std) runs at each whole number inside its range
            (a range holding fewer than two answers with QuanterLab's note
            and the nearest version, one tap), and a rule of the same lane
            written against the swept indicator's column runs written the
            other way round, the same rule; the answer's `changed` says so
            in one line. A rule of
            another lane that reads the swept column is refused with what
            to change.
        duration: Historical window (default '5y').
        n_regimes: 0 to pick the number of regimes automatically (default),
            or 2-4.
        mode: 'all' (default) | 'static' | 'per_regime' | 'dynamic_mean' |
            'regression', the optimizers QuanterLab's regime page offers.
        objective: Metric to maximize per regime: 'sharpe' (default) |
            'total_return_pct' | 'profit_factor'.
        question: Optional. One sentence restating what the run should answer, not the person's
            message: the title of the report the finished run becomes, and kept only as that.

    A run of more than 500 backtests (in every outer window, the grid on all its days, the grid again for
    each market state, and one test) runs nothing and answers with QuanterLab's note and the nearest versions
    that run whole, one tap each. The default grid of 4 by 4 runs whole on the default five years.

    When the run has finished, its progress answer also carries `report_url`: the run written up as a
    QuanterLab report (the setting each market state picked, the rules side by side against holding the
    stock). The call waits for the run while it is likely to finish inside it; the run's card in the chat
    shows the result or, for a longer run, how far it is, and fills in by itself, with the next steps as
    choices and the report link. A run started here needs no `show_report_card`.
    

Inputs: ticker (required), param_x (required), param_y (required), base_config (required), +10 more.

start_stochastic_backtestAInspect

Run a Stochastic Methods backtest (OU, Kalman and the like).

    No setting has to be settled before it runs: what the request leaves open (the stock or pair, the
    method, the entry and exit z-scores, the lookback, the history) runs with sensible defaults, which the
    result names in one short line; a change is a new run. `question` titles its report. The call waits for
    the run while it is likely to finish inside it, then answers with the result; the run's card in the chat
    shows the result or, for a longer run, how far it is, and fills in by itself, with the next steps as
    choices. A run started here needs no `show_report_card`.

    A grid, a sweep, "the best setting" or "try these values and apply the best" is ONE call with `sweep`
    (two of the method's settings, each from min to max in up to 10 steps), never many single runs: the
    sweep is one task and one run of the person's allowance, and its answer carries the grid and the best
    cell's backtest as the run of record, so applying the best needs no second call.

    Unlike `start_backtest` (indicator rules), this engine
    fits a stochastic model to the price series and trades from its
    parameters. `primary_method` is `{"id": ..., "params": {...}}` with
    the id ou_zscore (OU mean-reversion z-score), kalman_mr (Kalman
    adaptive OU), kalman_trend (Kalman trend-following) or ou_pairs
    (cointegration-based pairs, with `ticker_b`); everyday names such as
    "ou", "kalman" or "pairs" are read too, and a setting the method does
    not have is refused by name.

    Every account runs it within a daily allowance; a refused call does not count, and get_started and
    every run's answer give today's count.

    A run takes about 30 seconds to 2 minutes. The call returns `{task_id,
    status, kind, dashboard_url}`; `get_stochastic_backtest_progress`
    reports progress and, when the run has finished, carries `result`:
    the verdict and, for a run of a year or longer, a few rounded figures
    (the run's return next to simply holding the stock, Sharpe, worst
    drop, trades). With `oos_pct` above 0 the run tests only the earlier
    part of the history and its result says the held-back part was never
    tested; the same run again with `oos_pct` 0 tests the whole history.

    When the run has finished, its progress answer also carries `report_url`: the run written up as a
    QuanterLab report (the model against simply holding the stock, or for a pair holding both stocks and
    SPY, the model's own checks, the trades), which opens without a login.

    Use `list_stochastic_methods()` to discover valid `primary_method.id`
    values and parameter shapes.

    Args:
        question: Optional. One sentence restating what the run should answer, not the person's
            message: the title of the report the finished run becomes, and kept only as that.
        sweep: Optional. A grid of two of the method's number settings,
            `{"x": {"name": "z_entry", "min": 1.0, "max": 3.0, "steps": 7},
            "y": {"name": "lookback", "min": 20, "max": 140, "steps": 7},
            "objective": "sharpe"}`: each from min to max in 2 to 10 steps,
            the best cell picked by Sharpe (the default) or by "return". It
            runs as one task and counts as one run; its answer carries the
            grid (every cell's Sharpe, the best cell) and the best cell's
            backtest as the run of record.
    

Inputs: ticker (required), primary_method (required), sweep, oos_pct, +18 more.

start_testAInspect

Runs one of QuanterLab's ready tests on a stock or fund as a circuit of the lab's cards: the rule is tuned on past years only, then tested on the last three years, which the tuning never saw, against simply holding the same stock. It takes no settings to start: each test has its own default stock, below, and a test picked from get_started's card or named in words runs as it is.

    Tests: mean_reversion (a fitted model that buys when the price has fallen unusually far below its recent
    level; default KO), trend_following (a model that rides a trend while it lasts; SPY), momentum (holds
    while the last few months were up; QQQ), buy_the_dip (buys after a sharp fall, the 7-day RSI under 30; SPY), famous_rule (the 200-day line: hold above the 200-day average, cash below; SPY), and mvo
    (a book of up to 20 stocks of an index picked each quarter by mean-variance optimisation, from the companies
    in the index on that date; it takes `index`, not a ticker, and is set against holding the index's fund).

    Its card draws the circuit as the lab does and lights each card as it runs, with the result under it.
    get_primitives_run_progress follows it by its task_id; when it has finished it answers with the result,
    report_url and offers, each with its exact call, the first one tracking the test live
    (start_paper_trade). The circuit card shows the result, so a ready test needs no show_report_card.

    Every account runs it within a daily allowance; a refused call does not count, and get_started and
    every run's answer give today's count.

    A run that takes more than two minutes does not start at once: the answer gives its time and why, the
    person is asked ("This one takes about 25 minutes (20 years of the S&P 500). Run it?"), and the same call
    with confirm: true starts it after their yes.

    Args:
        test: mean_reversion, trend_following, momentum, buy_the_dip, famous_rule or mvo.
        ticker: Optional. The stock or fund to test it on, as its symbol ('AAPL', 'SPY'); else the test's own.
        index: Optional, for mvo: nasdaq100 (its own) or dow30. The book on the S&P 500 does not run here
            yet (more than a run here does in full in under a minute), and another index (the DAX, the
            FTSE 100) has no dated members: pass what the person asked all the same, and QuanterLab answers
            with its note and the same book on the Nasdaq 100, one tap away, and nothing runs.
        settings: Optional. The one setting a test lets a person change, by name: mean_reversion
            {"z_entry": 1 to 3.5}, trend_following {"trend_threshold": 0.25 to 3}, momentum {"months": 1 to
            6}, buy_the_dip {"rsi_below": 10 to 40}, famous_rule {"days": 20 to 300}, mvo {"holdings": 5 to
            30}, e.g. {"days": 100} for
            the 100-day line; and on every test {"stop_loss": 0.5 to 30}, the lab's Stop Loss card added
            under the forward test, which sells everything once the run has lost that many percent since the
            start of the month. A test changed by talking ("use the 100-day line instead", "add a stop
            loss") is the same call: the same test and stock and the last run's settings with that one change;
            the card draws the changed circuit and runs it. Without settings the test runs as it stands.
        question: Optional. One sentence restating what the run should answer, not the person's message: the
            title of the report, and kept only as that.
        study: Optional, instead of test. A published paper's id (from search or fetch). Unchanged, it answers
            at once with the paper's registered result: the run its last registered window recorded, from that
            window's date to the day it was recorded, and it uses none of today's runs. Changed (its settings)
            or with to_today, it runs the paper's circuit from that window's date to today. It takes no ticker;
            its `settings` are the settings the paper names (fetch lists them, e.g. {"symbol": "QQQ"} for which
            fund, {"spread_bps": 20} for the trading cost), and a refusal names them.
        to_today: Optional, with study. True runs the paper's circuit unchanged from its last registered window
            to today, a run like any other: what the person asks for with "run it up to today", or a tap on
            that offer after a paper's registered result.
        confirm: Optional. True only after the person said yes to the time a first call of this run gave.
    

Inputs: test, index, study, ticker, +4 more.

start_walkforwardAInspect

Run a walk-forward optimization of an indicator rule.

    A rule the lab's cards hold (as start_backtest says), over five years or more, with its two settings on the
    lab's Signal card (an indicator's setting or a condition's level) and an objective the lab tunes on, runs as
    a circuit of the lab's cards on the lab's engine: the rule tuned window by window on the years before the
    last three, then tested on those three years, which the tuning never saw, and the autopsy deals the test's
    days again in new orders. Its card draws the circuit, lights each card as the run reaches it, and shows the
    surface of the settings each window tried and the fan of the dealt days; its answer's kind is
    primitives_run, and get_primitives_run_progress follows it. Any other runs on the backtester's walk-forward,
    as before.

    No setting has to be settled before it runs: what the request leaves open (the stock or fund, the
    rule, the two settings to search and their ranges, the window lengths) runs with sensible defaults, which
    the result names in one short line; a change is a new run. `question` titles its report. The call waits
    for the run while it is likely to finish inside it, then answers with the result; the run's card in the
    chat shows the result or, for a longer run, how far it is, and fills in by itself, with the next steps as
    choices. A run started here needs no `show_report_card`.

    Walk-forward validates that a backtest's edge is not curve-fit by
    sliding a rolling window: re-fits parameters on `opt_bars` then
    applies them out-of-sample on the next `test_bars` and steps forward.

    Every account runs it within a daily allowance; a refused call does not count, and get_started and
    every run's answer give today's count.

    A run takes about 1 to 5 minutes. The call returns `{task_id, status,
    kind, dashboard_url}`; `get_walkforward_progress(task_id)` reports
    progress and, when the run has finished, carries `result`: the
    verdict on the windows the settings never saw, and for a run of a
    year or longer a few rounded figures (their return and Sharpe next
    to the tuned Sharpe, how many windows made money or never traded,
    and simply holding the stock over the same stretch).

    Args:
        ticker: Stock or ETF symbol (uppercase).
        base_config: The strategy, in the same shape as `start_backtest`'s
            arguments (entry_indicator, entry_conditions, exit_indicator,
            exit_conditions, ...), with conditions written
            `{"column": "MACDh_12_26_9", "operator": ">", "value": 0}`.
            The optimizer substitutes `param_x` and `param_y` into it
            across the grid.
        param_x / param_y: The two settings to grid over, each
            `{"name": ..., "min": ..., "max": ...}` with an optional
            "steps" (2-30; default `grid_steps`). "name" is one of:
              "entry.length"         a setting of the entry, exit or
                                     confirmation indicator ("exit.fast")
              "rsi.length"           the same, found by the indicator's id
                                     when exactly one lane uses it
              "entry.conditions[0]"  the number an entry, exit or
                                     confirmation condition compares against
            Indicator settings move in whole numbers: a decimal setting
            (Bollinger's std) runs at each whole number inside its range
            (a range holding fewer than two answers with QuanterLab's note
            and the nearest version, one tap), and a rule of the same lane
            written against the swept indicator's column (close above
            EMA_20) runs written the other way round, the same rule; the
            answer's `changed` says so in one line. A rule of another lane that reads the swept column is
            refused with what to change.
        opt_bars: In-sample window per fold (default 252 bars ≈ 1y daily),
            at least 30.
        test_bars: Out-of-sample window per fold (default 63 ≈ 3 months),
            at least 30.
        step_bars: Stride between folds. Defaults to `test_bars`.
        objective: Per-fold metric the grid is tuned on:
            'total_return_pct' (default) | 'sharpe' | 'profit_factor' |
            'win_rate'.
        grid_steps: Values per setting (default 3). The engine runs at
            most 250 backtests (every grid point in every window, plus
            a test run per window): five years of daily bars fit a
            3x3 grid, ten years a 2x2 grid or a longer step_bars. A
            larger request runs nothing and answers with QuanterLab's note
            and the nearest walk-forwards that fit (`offers`, each with its
            exact call).
        duration: Total history to walk through (default '5y').
        timeframe: '1d' (daily bars, the only timeframe this connector runs).
        question: Optional. One sentence restating what the run should answer, not the person's
            message: the title of the report the finished run becomes, and kept only as that.

    When the run has finished, its progress answer also carries
    `report_url`: the walk-forward written up as a QuanterLab report (the
    unseen months against holding the stock, window by window, the
    settings each window picked), which opens without a login.
    

Inputs: ticker (required), param_x (required), param_y (required), base_config (required), +8 more.

summarize_workflowA
Read-only
Inspect

The summary of a run: a verdict, a headline, a short narrative and next steps.

    A finished run of a year or longer also carries `figures`, a few
    rounded results of QuanterLab's own analysis (a backtest's return
    next to simply holding the same stock over the same dates, Sharpe,
    worst drop, trades; a walk-forward's results on the windows its
    settings never saw). A finished scan carries `candidates`: each
    filter's rule as applied, and up to ten names, those that passed and
    then the closest misses, with their own statistics rounded. The
    progress tools give the same summary as `result` when a run finishes,
    so this tool reads a run again later.

    Returns:
        ``{task_id, kind, status, verdict, headline, narrative,
           next_steps, dashboard_url, figures, candidates, report_url, _data_policy}``
        (`figures` and `candidates` when they apply; `report_url` for a finished run: the run written up
        as a report, a link that opens without a login)

        `verdict` is one of: `strong`, `promising`, `mixed`, `weak`,
        `failed`, `running`, `incomplete`, `unrated`.

    Args:
        task_id: A task id from any earlier `start_*` call.
    

Inputs: task_id (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      Provides point-in-time financial data access and an honest backtesting engine via MCP, enabling users to research restated fundamentals, run backtests with deflated Sharpe metrics, and benchmark returns against published factors.
      8
      2
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables point-in-time backtesting on daily bars with declarative strategy specs and deterministic simulated runs, offering two tool surfaces without needing API keys or network access.
      10
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI agents to build point-in-time factors from SEC filings and run cross-sectional signal backtests on locally supplied prices, with lookahead blocked in code, costs and market impact charged on real trades, crisis and out-of-sample checks, and every variant logged so the best run is judged against the whole search.
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables validation and backtesting of trading strategies, latest signal evaluation, strategy comparison, and retrieval of market/macro data and indicator catalogs through the Backtest360 engine.
      70 npm
      MIT
    Try in Browser

    Glama MCP Gateway

    Add one secure layer between your agents and this server.

    Resources