@chest-tide/arena
v0.5.6
Published
The engine behind Tide Arena: the bot contract, indicators, market state and the scorer Arena uses.
Maintainers
Readme
@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.tsIt 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. TheStrategyandIntenttypes, indicators (rsi,bollinger,adx,atr,findPivots,vwap,volumeProfile…), the market state Arena handsdecide, 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.
