Quant Research

ai.avasis由 avasis.ai 發布官方發布者v0.2.0更新於 Oct 26, 2026

Crypto backtest statistics: the server owns the trial count, so it cannot be understated.

已驗證Streamable HTTP可網頁執行金融資料與分析AI 與機器學習

概覽

AI 產生的概覽

遠端 MCP 伺服器,對加密貨幣回測做統計完整性檢定,並由伺服器自行保存試驗次數,以辨識過度擬合。

可以做什麼
  • 對報酬序列執行緊縮夏普(DSR)與機率夏普(PSR)檢定,試驗次數由伺服器保存而非手動填寫。
  • 檢定選擇流程是否帶有資訊,以及相關標的組合實際包含多少個獨立檢定。
  • 產生含清洗與禁運的交叉驗證切分、平穩自助法信賴區間,以及對基準的現實檢定。
  • 檢查最小回測長度,使用三重障礙或美元柱標註,並對策略規格做雜湊。
  • 以發行方公鑰驗證簽章研究紀錄及其鏈條。
適用情境
當你已有回測結果、想知道它能否承受所嘗試的設定數量時,或需要核驗他人簽章的研究紀錄時適用。它是拒絕工具,不是尋找策略的工具。
執行需求
遠端 streamable HTTP 端點,無需本機安裝。需在 Authorization 標頭提供 bearer API 金鑰,金鑰須向提供方申請。免費 Python 套件可在本機完成相同的統計。
安裝前請注意
API 金鑰屬於憑證,透過 Authorization 標頭傳送。簽發證明是付費服務,驗證則公開。伺服器會記錄並保存你的試驗次數,研究活動對提供方可見。它不提供訊號、價格或部位建議。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Quant Research,將其新增到工作區。
  2. 連接 Authorization token 憑證。它們會被私密儲存,絕不會在公開頁面上展示。
  3. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/ai.avasis%2Fquant-research/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "quant-research": {
      "type": "http",
      "url": "https://quant-mcp.avasis.ai/mcp",
      "headers": {
        "Authorization": "Bearer <YOUR_TOKEN>"
      }
    }
  }
}

README

quant-integrity

Statistical tests for whether a backtest means anything.

[PyPI] [Python] [Licence] [CI] [Typed]

This library will not find you a profitable strategy. Its function is to reject them. Everything here exists to answer one question: given how many configurations you tried before reporting this one, does the result survive?

bash
pip install quant-integrity

The problem, in one picture

A moving-average crossover on BTC-USD hourly bars. After sweeping parameters, the best configuration returned an annualised Sharpe of 0.95 — and a Probabilistic Sharpe of 0.86, which reads as "probably beats zero".

That is where most backtests stop. Here is the same result next to the bar that 28 attempts actually sets:

[Observed Sharpe against the bar set by the trial count]

The best of 28 tries is large even when every underlying edge is exactly zero. Against that bar the deflated Sharpe is 0.157. The observed result is not marginal; it is below half of what luck alone produces.

A high PSR with a low DSR is the signature of an overfit search, not a borderline edge.

What the search was actually selecting on

The cause was visible in the trials themselves. Sorting the 28 recorded runs by trade count against Sharpe:

[Sharpe against trade count across every trial]

Every configuration that traded less looked better, at ρ = −0.96. That is not a signal being discovered — it is cost drag being measured, plus a slow moving average approximating buy-and-hold in a rising market. The search was not finding an edge. It was finding the configuration that traded least.

And the interval was never tight to begin with

[Bootstrap confidence interval on Sharpe]

Reported alone, Sharpe = 0.95 implies a precision the data does not support.

Every number above is reproducible

bash
git clone https://github.com/abhayjnayakk/quant-integritycd quant-integrity && pip install -e .python docs/make_figures.py        # regenerates all three figures and prints the values
Trials evaluated28
Sharpe (annualised, after costs)0.9500
Probabilistic Sharpe (PSR)0.8556
E[max Sharpe] under the null, 28 trials1.8525
Deflated Sharpe (DSR)0.1568
Bootstrap 95% CI on Sharpe[−0.93, 2.69] — straddles zero
Excess kurtosis18.61
Spearman ρ(Sharpe, trades)−0.9618 (p = 3.8e−16)
Minimum backtest length1.94 years required, 1.25 available

The trial count is taken from the recorded runs rather than typed in. An earlier version of this page hardcoded 29 while the file recorded 28, and quoted a deflated Sharpe from one and a minimum backtest length from the other.

The figures and this table are generated by the same script from examples/btc_ma_runs.npz (24 KB, the actual return series and per-trial results). No server and no account. There is also a longer walkthrough in examples/btc_ma_postmortem.ipynb.

On one number that is not in this repo. The same specification was later run across a basket rather than a single asset, and pooled to a Sharpe of −1.376 over 10 assets with 3 of them positive. That result lives in the hosted server's ledger, not in this repository — the example file here carries only the single-asset trials, so you cannot reproduce the basket figure from it. It is quoted here because it is the strongest part of the story, and flagged because a number you cannot check should always be labelled as one.


What's in it

FunctionQuestion it answers
deflated_sharpe(returns, n_trials)Does this Sharpe beat what the best of N trials produces by luck?
probability_backtest_overfitting(matrix)Does your selection procedure carry information at all?
combinatorial_purged_cv(...)Cross-validation splits with purging AND embargo
stationary_bootstrap_ci(returns)How wide is the interval really?
reality_check(family, benchmark)Is the family's best member better than the benchmark it was chosen over?
effective_tests(matrix)How many INDEPENDENT tests does a correlated basket give?
min_backtest_length(n_trials, ...)Is your sample even long enough for the search you ran?
triple_barrier_labels(...), dollar_bars(...)Labelling and activity-based sampling
spec_hash(spec)Content-addressed strategy identity
verify_attestation(record, key)Independently check a signed research record
python
import quant_integrity as qi
out = qi.deflated_sharpe(returns, n_trials=28)print(out["dsr"], out["psr"])

n_trials means every configuration you evaluated, including the ones you discarded. Understating it produces a flattering answer. Nothing in this library can check it — which is exactly the problem the next section is about.


Commercial intent, stated on day one

The statistics in this repository are AGPL-3.0 and free forever. Every method here is published academic work. There is no moat in the arithmetic and no version of this library is crippled to sell you an upgrade — a teaser would fail as a funnel and would forfeit the only thing an integrity tool has.

Hosted attestation is a paid service. Verification is public and lives here. Issuance is not, for the reason below. Saying this up front so nobody can later claim a rug-pull.

Why self-hosting can't attest

A trial count is only meaningful if it cannot be revised downward. But if you run your own ledger, you can edit it. Not through malice, usually — through the ordinary temptation to restart the count after a rewrite, or to not record the sweep that went nowhere. A self-attested integrity record certifies nothing, because the person attesting is the person who benefits.

Verification is public. Issuance is the service.

Anyone can check an attestation with this library and an issuer's public key. No cooperation from the issuer is required, and none of the checking code is withheld. What you cannot do is make one, because a signature is only worth something when the signer is not the beneficiary.

The property that does the work is not any single signature — it is the chain. verify_chain confirms that, across a sequence of attestations:

  • sequence numbers are consecutive, so no record was removed from the middle;
  • each references the previous record's digest, so none was altered afterwards;
  • n_trials never decreases.

An outside party can establish all of that without ever seeing the ledger. Someone who edits their own records cannot reproduce it, because they would have to re-sign every subsequent record with a key they do not hold.

That is the whole business: not the arithmetic, which is here and free, but operating an instance that has no stake in the answer. That instance is quant.avasis.ai — an MCP server, so the research runs inside Claude, Cursor, VS Code or any MCP client, and the trial count is kept by the server rather than by the conversation.


Scope

This is a statistical instrument. Deliberately absent, and staying absent:

  • No buy, sell or hold signals. No target prices, position sizes or stop levels.
  • No model portfolios or allocations.
  • No claims about returns, and no examples implying any.

The library takes return series and trial counts and returns statistics about them. It does not know what you are trading and does not offer an opinion on it.


Install and contribute

bash
pip install quant-integrity                 # statisticspip install "quant-integrity[attestation]"  # + signature verification

Python 3.10+. Depends on numpy, scipy and pandas. Fully typed (py.typed).

Contributions require a CLA and a DCO sign-off — see CONTRIBUTING.md, which explains why without apology.

Licence

AGPL-3.0-or-later. See LICENSE and NOTICE.

The network-use clause is deliberate: it means a competitor cannot run a closed hosted fork of this code. It does not restrict you from using the library in your own research, hosted or otherwise, without publishing anything.

來源:README.md,提交 85696d7

工具

0
該伺服器需要 API 金鑰等憑證,因此 SourceWeft 無法在沒有憑證的情況下讀取其工具,也未收錄。

版本歷史

1
  1. v0.2.0最新Sep 16, 2026

評分

已滿足適用檢查項的 85%

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

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分