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);
}- manifest.name is the strategy name on the instance. version marks later edits.
- ccxtIds lists exchange ids such as binance. markets is spot, swap, or both.
- With symbolMode single, you pick one symbol when you create the instance.
- permissions contains only market, so the strategy can read quotes. Add order to trade, and account to read balances or positions.
- 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.
