A plugin for Debut platform that provides additional candles of specified tickers to strategy.
@debut/community-core should be installed. If you are using Strategies repository just type:
npm install debut-plugin-candles
- Extend strategy options with
CandlesPluginOptions
:
// bot.ts
export interface CCIDynamicBotOptions
extends CandlesPluginOptions {
//...
}
// cfgs.ts
export const ETHUSDT: CCIDynamicBotOptions = {
candles: ['BTCUSDT'],
//...
- Declare
CandlesPluginAPI
:
// bot.ts
export class CCIDynamic extends Debut {
declare opts: CandlesPluginAPI;
//...
}
- Register
candlesPlugin()
plugin
// bot.ts
this.registerPlugins([candlesPlugin(this.opts, env?)]);
- Get candles:
// bot.ts
this.plugins.candles.get();
// will return ([0] last, [1] prev):
// {
// BTCUSDT: {
// time: 1662240600000,
// o: 1552.42,
// c: 1552.42,
// h: 1552.42,
// l: 1552.42,
// v: 2456
// },
// }