DoQuant
English
Back to handbook

Harbor SDK

Quick start

A strategy that can run needs a manifest and at least one of onBar, onTick, or onTimer. This one only writes each bar's close to the instance log. It does not place an order.

const manifest = {
  name: "最小策略",
  version: "1.0.0",
  ccxtIds: ["binance"],
  markets: ["spot"],
  symbolMode: "single",
  params: {},
  permissions: ["market"],
};

async function onBar(rt, bar) {
  rt.log("info", bar.close);
}
  1. manifest.name is the strategy name on the instance. version marks later edits.
  2. ccxtIds lists exchange ids such as binance. markets is spot, swap, or both.
  3. With symbolMode single, you pick one symbol when you create the instance.
  4. permissions contains only market, so the strategy can read quotes. Add order to trade, and account to read balances or positions.
  5. Create a paper instance and run it. The instance log shows each close.

After the log looks right, add market data, orders, and the later examples. Run it on a paper account before live.