Git Product home page Git Product logo

Comments (10)

jaggedsoft avatar jaggedsoft commented on September 26, 2024 3

https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#new-order--trade scroll down to "type"

image
image

from node-binance-api.

gravemaker avatar gravemaker commented on September 26, 2024 1

You should change node-binance-api.js line 97 to include the price in any kind of LIMIT order.

-if ( opt.type == "LIMIT" ) {
+if ( opt.type.includes("LIMIT") ) {

Therefore you can call the function with:
binance.sell("ETHBTC", quantity, price, {type: "STOP_LOSS_LIMIT", stopPrice: stopPrice});

from node-binance-api.

jaggedsoft avatar jaggedsoft commented on September 26, 2024 1

@jemhoward

Yes I believe you are correct. STOP_LOSS_LIMIT and TAKE_PROFIT_LIMIT appear to be the only order types working. I think those are the only types you can set from within the binance official webpage
image

from node-binance-api.

jaggedsoft avatar jaggedsoft commented on September 26, 2024

Yes that is how it's supposed to work

sell: function(symbol, quantity, price, flags = {}, callback = false)
The 5th parameter is a callback function that will return the JSON response

Unfortunately stop orders mysteriously stopped working the other day and I haven't had the time to figure out exactly why this is happening

from node-binance-api.

jaggedsoft avatar jaggedsoft commented on September 26, 2024

Thank you for your suggestions
These were all addressed in jaggedsoft@000ddec and commited in release v0.3.1

from node-binance-api.

iBasit avatar iBasit commented on September 26, 2024

Unfortunately stop orders mysteriously stopped working the other day and I haven't had the time to figure out exactly why this is happening

is it safe to say, that it is working now?

binance.sell("ETHBTC", quantity, price, {type: "STOP_LOSS_LIMIT", stopPrice: stopPrice});

binance.buy("ETHBTC", quantity, price, {type: "TAKE_PROFIT_LIMIT", stopPrice: stopPrice});

TAKE_PROFIT_LIMIT?

from node-binance-api.

jaggedsoft avatar jaggedsoft commented on September 26, 2024

Yes just make sure you are on the latest version
And then you have to tell it what type of stop loss you want

Placing a STOP LOSS order

// When the stop is reached, a stop order becomes a market order
// Note: You must also pass one of these type parameters:
// STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT, TAKE_PROFIT_LIMIT
let type = "STOP_LOSS";
let quantity = 1;
let price = 0.069;
let stopPrice = 0.068;
binance.sell("ETHBTC", quantity, price, {stopPrice: stopPrice, type: type});

from node-binance-api.

iBasit avatar iBasit commented on September 26, 2024

Thank you, is there any documentation link for these parameters? So I can and also others can understand what they mean.

from node-binance-api.

jemhoward avatar jemhoward commented on September 26, 2024

I don't see that this works as intended. When using the parameters as

// STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT, TAKE_PROFIT_LIMIT
let type = "STOP_LOSS";
let quantity = 1000;
let price = 0.00000100;
let stopPrice = 0.00000100;
binance.sell("BCNBTC", quantity, price, {stopPrice: stopPrice, type: type});

I get the output:

[ 'SELL(BCNBTC,1000,0.000001) ', {} ]

No order is placed. If I instead use STOP_LOSS_LIMIT the order is created as expected. This leads me to think STOP_LOSS is not fully implemented in the binance api and only limit orders are successful.

Please can you clarify.

from node-binance-api.

jemhoward avatar jemhoward commented on September 26, 2024

Thanks @jaggedsoft, let's hope they implement that for use some time soon and thanks for all your work with binance api and node.js

from node-binance-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.