Backtestport

io.github.CloudCorpRecords由 GitHub 帳號 CloudCorpRecords 發布v0.1.0更新於 Nov 7, 2026

回測引擎客戶端:指標、策略驗證、回測、訊號和市場資料。

AI 翻譯由 AI 模型根據下方的原文描述翻譯,可能有誤。

原文描述

Backtesting engine client: indicators, strategy validation, backtests, signals and market data.

已驗證STDIO僅桌面金融

概覽

Backtestport 的本機 MCP 服務;無需登入;STDIO;19 個工具。

暫無 AI 概覽:以下資訊來自註冊中心條目和服務本身。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Backtestport,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

backtestport

Backtest a trading strategy without standing up your own engine. backtestport is a small client for the Backtest360 hosted backtesting engine: you hand it a strategy document and it validates the document, runs the backtest, evaluates the latest signal, compares several strategies on the same data, and fetches the market and macroeconomic data the engine can work with — plus the indicator catalog, templates and reference data you need to write the strategy in the first place.

This is a backtesting client only. It has no live-trading, order-placement or account tools, and nothing it does moves money.

Responses come back exactly as the engine returned them: nothing is trimmed, renamed or summarised on the way through, apart from the output byte cap described below.

Configuration

Four environment variables control the client:

  • BACKTEST360_API_KEY (required) — sent on every request as the X-API-Key header. When it is not set, every tool fails with BACKTEST360_API_KEY is not set before any request is made.
  • BACKTEST360_ENGINE_URL (optional) — engine base URL. Defaults to https://api.backtest360.com.
  • BACKTEST360_MCP_TIMEOUT (optional) — per-request timeout in seconds, default 300. A request that runs past it fails with backtest360 request timed out.
  • BACKTEST360_MCP_MAX_OUTPUT_BYTES (optional) — response size cap in bytes, default 100000. A longer body is truncated to the cap and a final line {"truncated_by_mcp": true} is appended, so a huge equity curve cannot flood the caller.

Reading the results

Two engine answers that look like failures are not:

  • Strategy validation returns {valid: false, errors: [...]} when the document has problems. That is a normal result — the errors are structured and locatable so you can fix the document.
  • A backtest the engine declines returns {accepted: false}. That is also a normal result.

Actual failures are errors: HTTP 429 fails with backtest360 rate limited (HTTP 429); retry after <value> when the engine sends a Retry-After header (without the suffix when it does not), any other non-2xx reply fails with backtest360 error: HTTP <status>, and an unreachable engine fails with backtest360 unreachable.

Strategy arguments (strategy, and each item of strategies) accept either a JSON object or a JSON string, which is parsed before sending; a string that does not parse fails with strategy is not valid JSON.

Three arguments shape a backtest run:

  • response_detail — summary (default), stats or full: how much of the verdict comes back.
  • max_series_points — cap on returned series length, default 500; it must be an integer of at least 2, checked locally before any request (max_series_points must be an integer >= 2).
  • include — any of trades, equity_curve, monthly_returns, yearly_returns and signal_diagnostics, each adding its series to the verdict.

Tools

Discovery and account:

  • engine_info — engine version, API contract, health.
  • get_me — what the configured key can do: permission scopes, limits, current usage, capability flags.
  • get_catalog — the reference catalogs (operators, execution modes, stop types, sizing methods, bar frequencies, metric sections); pass catalog to fetch just one.
  • list_indicators — indicator discovery with per-indicator parameter schemas; search narrows the list.
  • list_templates — predesigned strategy templates, listed compactly, or one in full when id is given.
  • get_strategy_schema — the JSON Schema for strategy documents.

Strategies and runs:

  • validate_strategy — check a strategy document without running it.
  • run_backtest — run a backtest; symbol, start, end, the shaping arguments above, and data (inline bars as an object) are all optional.
  • get_latest_signal — evaluate the most recent bar only; no P&L.
  • compare_backtests — run several strategies on the same data, side by side.
  • compute_stats — compute the metric set from an externally produced returns series.

Market and macro data:

  • search_tickers / list_tickers — the fetchable symbol universe.
  • get_data_range — available history and a bar-count estimate for a symbol.
  • get_ticker_info — symbol identity and data coverage in a single call.
  • get_quote — latest available price for a symbol.
  • get_price_history — OHLCV history over a date range (start, end, frequency; with server-side data the engine fixes bars at 1d — the argument is accepted and forwarded).
  • list_macro_series / get_macro_series — the macroeconomic series catalog, and one series' observations over an optional date range.

Endpoint provenance

The original project's README pins the 19 tools, the shaping-argument semantics, the four environment variables with their defaults, the X-API-Key header and the rule that validation results and engine rejections are data. The wire paths below are reconstructions, labelled as such: GET /engine/info, GET /me, GET /catalogs, GET /indicators, GET /templates[/{id}], GET /strategy/schema, POST /strategy/validate, POST /backtests, POST /signals/latest, POST /backtests/compare, POST /stats, GET /tickers/search, GET /tickers, GET /tickers/{symbol}/data-range, GET /tickers/{symbol}, GET /tickers/{symbol}/quote, GET /tickers/{symbol}/history, GET /macro, GET /macro/{series} — all under the configured base URL, with path segments and query values URL-encoded.

CLI

Each tool is a subcommand taking one JSON argument string:

bash
npx @reneturcios/backtestport engine_info '{}'npx @reneturcios/backtestport validate_strategy '{"strategy":{"name":"sma-cross","rules":[]}}'npx @reneturcios/backtestport run_backtest '{"strategy":{"name":"sma-cross"},"symbol":"AAPL","include":["equity_curve"]}'npx @reneturcios/backtestport get_quote '{"symbol":"AAPL"}'npx @reneturcios/backtestport --version

Output is the tool's result text (the upstream JSON on success). Exit codes: 0 on success, 1 on a runtime error (including a missing key, a validation failure or an upstream failure), 2 on a usage error.

MCP server

bash
npx -y @reneturcios/backtestport mcp

MCP client config:

json
{  "mcpServers": {    "backtestport": {      "command": "npx",      "args": ["-y", "@reneturcios/backtestport", "mcp"],      "env": {        "BACKTEST360_API_KEY": "<your key>"      }    }  }}

Docker

bash
docker run -i ghcr.io/cloudcorprecords/backtestportdocker run --rm ghcr.io/cloudcorprecords/backtestport get_quote '{"symbol":"AAPL"}'

Development

bash
npm installnpm run build   # tsc -> dist/npm test        # tsx --test test/*.test.ts (fake fetch only, no network)npm run dev     # run the CLI from source

License

MIT — Copyright (c) 2026 Rene Turcios

來源:README.md,提交 b788b1b

工具

19

engine_info

Engine version, API contract, health.

無需輸入參數。

get_me

What the configured key can do: permission scopes, limits, current usage, capability flags.

無需輸入參數。

get_catalog

Reference catalogs: operators, execution modes, stop types, sizing methods, bar frequencies, metric sections.

輸入參數catalog

list_indicators

Indicator discovery; per-indicator parameter schemas.

輸入參數search

list_templates

Predesigned strategy templates — discover compactly, fetch one in full, ready to validate and run.

輸入參數id

get_strategy_schema

JSON Schema for strategy documents.

無需輸入參數。

validate_strategy

Validate a strategy without running it — returns structured, locatable errors.

輸入參數strategy必填

run_backtest

Run a backtest of a strategy over historical data for the given symbol and date range.

輸入參數enddatastartsymbolincludestrategy必填response_detailmax_series_points

get_latest_signal

Evaluate the most recent bar only (no P&L).

輸入參數symbolstrategy必填

compare_backtests

Run several strategies on the same data, side by side.

輸入參數includestrategies必填response_detailmax_series_points

compute_stats

Compute the metric set from an externally produced returns series.

輸入參數returns必填

search_tickers

Search the fetchable symbol universe.

輸入參數query必填

list_tickers

List the fetchable symbol universe.

無需輸入參數。

get_data_range

Available history and bar-count estimate for a symbol.

輸入參數symbol必填

get_ticker_info

Symbol identity and data coverage in a single call.

輸入參數symbol必填

get_quote

Latest available price for a symbol.

輸入參數symbol必填

get_price_history

OHLCV price history over a date range.

輸入參數endstartsymbol必填frequency

list_macro_series

List the macroeconomic series catalog.

無需輸入參數。

get_macro_series

Fetch one macro series' observations.

輸入參數endstartseries必填

版本歷史

1
  1. v0.1.0最新Nov 3, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分