@debut/plugin-reinvest
TypeScript icon, indicating that this package has built-in type declarations

1.3.2 • Public • Published

@debut/plugin-reinvest

Debut plugin, for adding profits from trades to your starting capital (re-investment). It is mainly used to increase profits. When enabled, all profits or losses from trades will be subtracted or added to the initial capital.

Install

npm install @debut/plugin-reinvest --save

Initializing the plugin

import { reinvestPlugin } from '@debut/plugin-reinvest';

// ...
// Strategy constructor in the context of Debut...
constructor(transport: BaseTransport, opts: MyStrategyOpts) {
    super(transport, opts);

    this.registerPlugins([
        // ...
        // You can optionally enable it with a custom configuration, or always enable it
        this.opts.reinvest ? reinvestPlugin() : null,
        // ...
    ]);
}

Readme

Keywords

Package Sidebar

Install

npm i @debut/plugin-reinvest

Weekly Downloads

1

Version

1.3.2

License

Apache-2.0

Unpacked Size

30.6 kB

Total Files

6

Last publish

Collaborators

  • businessduck