New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@debut/plugin-dynamic-takes

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@debut/plugin-dynamic-takes

Dynamic takes plugin for Debut

latest
Source
npmnpm
Version
1.6.0-beta.4
Version published
Weekly downloads
31
138.46%
Maintainers
1
Weekly downloads
 
Created
Source

@debut/plugin-dynamic-takes

The Debut plugin for setting take and stop prices in manual mode. Allows you to set or change stop and take prices for open positions at any time using their identifier. It also allows you to optionally make fill-ups instead of closing unprofitable positions.

Install

npm install @debut/plugin-dynamic-takes --save

Settings

NameTypeDefault valueDescription
trailingbooleanfalsetrailing a stop position after setting the takes and stops
ignoreTicksbooleanfalseignore ticks, because it often happens that stops can be knocked out by the shadow but not the body of the candle
maxRetryOrdersnumber0Sets the number of buybacks

Plugin API

NameDescription
setTrailingForOrderstart trailing for a single target order
setForOrdersetup stop and take prices for signle order, setting up by passed options parameters
getTakesget take and stop price for order from plugin state

* The rebates are always of the same size as the original position. They are executed when the stop of the last created trade reaches the stop. Stop levels will be copied from the original trade.

*** If the number of pending orders is not set, the position will be closed when the stop is reached.

When the maximum number of pending orders is reached, the system will set takeovers to the breakeven level on all trades, and if the price does not turn around, all previously created trades will be closed at a loss.

Takeaway setting

// in context of Debut...
async onCandle({ c }) {
    // some entry conditions
    const order = await this.createOrder(target);
    let take = c + c * 0.15; // Assume 15%
    let stop = c - c * 0.10; // And the stop is 10%

    // If the trade is of the SELL type, swap the stop and take positions
    if (target === OrderType.SELL) {
        [take, stop] = [stop, take];
    }

    // Hand over the cid (client-id) to the price plugin.
    // Then it will monitor when it reaches a take or stop
    // after which it will automatically close the trade
    this.plugins.dynamicTakes.setForOrder(order.cid, take, stop);

    return order;
}

Screenshots (plugin Report)

Order with zero loose levelProfitable close with support order
Deal with withdrawal at 0Profitable deal with docup

Keywords

Debut

FAQs

Package last updated on 17 Jul 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts