debut-plugin-bridge

Debut plugin that provides additional candles for specified tickers.


Keywords
debut, plugin, api
License
MIT
Install
npm install debut-plugin-bridge@1.5.12

Documentation

debut-plugin-bridge

CI npm

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

Install

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

npm install debut-plugin-bridge

Usage

  1. Extend strategy options with BridgePluginOptions:
// bot.ts
export interface CCIDynamicBotOptions
    extends BridgePluginOptions {
    //...
}

// cfgs.ts
export const ETHUSDT: CCIDynamicBotOptions = {
    tickers: ['BTCUSDT'],
    //...
  1. Declare BridgePluginAPI:
// bot.ts
export class CCIDynamic extends Debut {
    declare opts: BridgePluginAPI;

    //...

}
  1. Register bridgePlugin() plugin
// bot.ts
this.registerPlugins([bridgePlugin(this.opts, env?)]);
  1. Get candles:
// bot.ts
this.plugins.bridge.get();

// will return:
// [
//       {
//             time: 1662240600000,
//             o: 1552.42,
//             c: 1552.42,
//             h: 1552.42,
//             l: 1552.42,
//             v: 2456
//       },
// ]