@chest-tide/arena

中文文档
0.5.15发布于 2026/10/23PolyForm-Noncommercial-1.0.0TypeScriptES Module近 30 天下载 2396

The engine behind Tide Arena: the bot contract, indicators, market state and the scorer Arena uses.

原始使用文档
文档目录4 节
  1. A bot
  2. What it exports
  3. Versions
  4. Licence

@chest-tide/arena

The engine behind Tide Arena, a benchmark for trading bots written in TypeScript. It holds the bot contract, the indicators and market state a bot reads, and the scorer Arena uses.

Start from the starter kit, which ships in this package:

npx @chest-tide/arena init my-bots
cd my-bots
npm run score -- bots/breakout-bot.ts

It writes the bot contract (GUIDE.md), five starter bots, the dev data pack and the npm run score, npm run submit and npm run fetch commands, on this version of the engine.

A bot

A bot is one TypeScript file that imports from @chest-tide/arena and default-exports a Strategy:

import { atr, type Strategy } from "@chest-tide/arena";

const bot: Strategy = {
  name: "my-first-bot",
  markets: ["BTC 4h", "ETH 4h"], // optional: the only pairs it runs on
  lookback: 50,
  decide({ candles }) {
    const last = candles[candles.length - 1];
    const range = atr(candles, 14);
    if (range === null || last.close <= candles[0].close) return null;
    return { side: "long", stop: last.close - 2 * range, target: null, maxBars: 12 };
  },
};

export default bot;

@chest-tide/arena is the only import Arena accepts in a bot. The kit's GUIDE.md (also at template/GUIDE.md) is the full contract: what decide receives, how trades are simulated, the rules and the checks.

What it exports

  • @chest-tide/arena: everything a bot may use. The Strategy and Intent types, indicators (rsi, bollinger, adx, atr, findPivots, vwap, volumeProfile…), the market state Arena hands decide, and the scoring functions.
  • @chest-tide/arena/checks: the source checks Arena runs on every submission.
  • @chest-tide/arena/report: scoring with decisions, and the report Arena accepts.
  • @chest-tide/arena/references: the starter bots' reference scores.

The TypeScript source ships in src/, so you and your coding agent can read exactly how a trade is filled and scored.

Versions

Arena always scores with Tide's current engine, and this package is that engine. When Arena changes how it scores, a new version is published here and CHANGELOG.md says what changed; run npm update @chest-tide/arena to score the same way locally.

Licence

PolyForm Noncommercial 1.0.0: free for personal, research, educational and hobby use, including entering Tide competitions. Commercial use needs a separate licence from us.

版本与发布记录

@chest-tide/arena 共发布 28 个版本,首次发布于 2026/10/01;过去 12 个月发布了 28 个版本。

版本发布日期距今
0.5.15latest2026/10/2317 天前
0.5.132026/10/1921 天前
0.5.122026/10/1921 天前
0.5.112026/10/1921 天前
0.5.102026/10/1921 天前
0.5.92026/10/1624 天前

关于 @chest-tide/arena 的常见问题

@chest-tide/arena 是什么?

The engine behind Tide Arena: the bot contract, indicators, market state and the scorer Arena uses.

如何安装 @chest-tide/arena?

在项目目录运行 npm install @chest-tide/arena,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 arena,可以用 npx arena 直接运行。

@chest-tide/arena 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@chest-tide/arena 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@chest-tide/arena 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22.13。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@chest-tide/arena 可以商用吗?

@chest-tide/arena 使用 PolyForm-Noncommercial-1.0.0 许可。声明的许可为 PolyForm-Noncommercial-1.0.0,请阅读许可原文确认使用条件。以上为概括,不构成法律意见,请以许可原文为准。

@chest-tide/arena 的下载量有多少?

根据 npm 官方下载统计,@chest-tide/arena 在 2026/10/10 – 2026/11/08 这 30 天内被下载 2,396 次,日均约 80 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@chest-tide/arena 还在维护吗?

最新版本 0.5.15 发布于 2026/10/23(17 天前);至今共发布 28 个版本,其中过去 12 个月发布了 28 个;首次发布于 2026/10/01。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。