把整个 repo 变成策略代码,复制粘贴进 就能运行 👀
感谢
@coolish 开源 🙏
---
const { ta, strategy, close } = context;
strategy("BTC Cycle Trend", { leverage: 10, pyramiding: 1, initial_capital: 10000 });
const ema = ta.ema(close, 150);
if (+ema == null || isNaN(+ema)) return;
const qty = 10 * strategy.leverage;
if (strategy.position_size <= 0 && +close > +ema)
strategy.entry("L", "long", { qty, qty_type: 'percent_of_equity' });
if (strategy.position_size > 0 && +close < +ema)
strategy.close("L");
---