Comments (10)
https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#new-order--trade scroll down to "type"
from node-binance-api.
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.
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
from node-binance-api.
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.
Thank you for your suggestions
These were all addressed in jaggedsoft@000ddec and commited in release v0.3.1
from node-binance-api.
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.
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.
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.
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.
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)
- specify commission asset
- Reqest futuresHistoricalTrades and get status code: 401 Unauthorized HOT 1
- request historicalTrades and got status 401 Unauthorized
- Subscribe to several user streams with one websocket connection
- is there some API to simply convert e.g. USDT to BTC HOT 1
- Problem with await when getting balances HOT 3
- call return price of a symbol
- variable of binance.websockets.bookTickers
- Lack support for Binance mining pool. label:feature-request
- Close futures positions
- Withdraw error not documented -4009
- quoteOrderQty request sometimes not working on 100% buy market
- Custom indicators with websockets
- Timestamp for this request is outside of the recvWindow.
- binance.websockets.trades()
- how to know the change of status of an order?
- support for userFutureData HOT 1
- Support for avgPrice of VESUSDT/VESBUSD/VESUSDC/VESETH/VESBTC HOT 1
- Method to retrieve cross / isolated margin pairs
- Binance
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-binance-api.