A plugin that provides additional candles of specified tickers for Debut platform.
@debut/community-core should be installed. If you are using Strategies repository just type:
npm install debut-plugin-extra-candles
- Extend strategy options with
ExtraCandlesPluginOptions
:
// bot.ts
export interface CCIDynamicBotOptions
extends ExtraCandlesPluginOptions {
//...
}
// cfgs.ts
export const ETHUSDT: CCIDynamicBotOptions = {
corrTopLevel: 0.4,
corrLowLevel: -0.4,
corrPeriod: 20,
extraTickers: ['BTCUSDT'],
//...
- Declare
ExtraCandlesPluginAPI
:
// bot.ts
export class CCIDynamic extends Debut {
declare opts: ExtraCandlesPluginAPI;
//...
}
- Register
extraCandles()
plugin
// bot.ts
this.registerPlugins([extraCandles(this.opts)]);
- Get candles:
// bot.ts
this.plugins.extraCandles.getCandles();
// will return:
// {
// BTCUSDT: [
// {
// time: 1662240600000,
// o: 1552.42,
// c: 1552.42,
// h: 1552.42,
// l: 1552.42,
// v: 2456
// },
// {
// time: 1662239700000,
// o: 1554.6,
// c: 1554.6,
// h: 1554.6,
// l: 1554.6,
// v: 3274
// }
// ]
// }