ospectreo / debut-plugin-extra-candles

Debut plugin that provides additional candles of specified tickers to strategy.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

debut-plugin-extra-candles

CI npm

A plugin that provides additional candles of specified tickers for Debut platform.

Install

@debut/community-core should be installed. If you are using Strategies repository just type:

npm install debut-plugin-extra-candles

Usage

  1. 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'],
    //...
  1. Declare ExtraCandlesPluginAPI:
// bot.ts
export class CCIDynamic extends Debut {
    declare opts: ExtraCandlesPluginAPI;

    //...

}
  1. Register extraCandles() plugin
// bot.ts
this.registerPlugins([extraCandles(this.opts)]);
  1. 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
//         }
//     ]
// }

About

Debut plugin that provides additional candles of specified tickers to strategy.

License:MIT License


Languages

Language:TypeScript 97.1%Language:Shell 2.9%