How to use the node-binance-api.sell function in node-binance-api

To help you get started, we’ve selected a few node-binance-api examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github andresilvasantos / bitprophet / exchange_utils.js View on Github external
createLimitOrder: function(pairName, sideBuy, price, quantity, next) {
        quantity = this.normalizeAmount(pairName, quantity, price)
        price = this.fixPrice(pairName, price)

        //BUY
        if(sideBuy) {
            binance.buy(pairName, quantity, price, {type:'LIMIT'}, function(error, response) {
                next(error, response.orderId, quantity, response.status == "FILLED")
            });
        }
        //SELL
        else {
            binance.sell(pairName, quantity, price, {type:'LIMIT'}, function(error, response) {
                next(error, response.orderId, quantity, response.status == "FILLED")
            });
        }
    },
    createStopLimitOrder: function(pairName, sideBuy, price, stopPrice, quantity, next) {
github gmverdon / TradingBot / src / scenes / TradeHub / index.js View on Github external
sell = (price) => {
    binance.sell(this.state.selectedCrypto.symbol, this.state.quantity, price);

    const alert = Object.assign({}, this.state.alert);
    alert.isOpen = true;
    alert.message = `Trading bot sold ${this.state.quantity} ${this.state.selectedCrypto.baseAsset}
                    at ${price} ${this.state.selectedCrypto.symbol}. Refresh the page for a new strategy.`
    alert.color = 'success';

    this.setState({
      sold: true,
      alert,
    });
  };