debut-plugin-bridge
TypeScript icon, indicating that this package has built-in type declarations

1.5.12 • Public • Published

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
//       },
// ]

Dependents (0)

Package Sidebar

Install

npm i debut-plugin-bridge

Weekly Downloads

0

Version

1.5.12

License

MIT

Unpacked Size

15.2 kB

Total Files

9

Last publish

Collaborators

  • voqse