binance-api-node icon indicating copy to clipboard operation
binance-api-node copied to clipboard

Cannot create STOP_MARKET order for spot trading

Open akrolasik opened this issue 3 years ago • 4 comments

Cannot create STOP_MARKET order for spot trading

Error TS2322 (TS) Type 'OrderType.STOP_MARKET' is not assignable to type 'OrderType.LIMIT | OrderType.MARKET | OrderType.STOP_LOSS_LIMIT | OrderType.TAKE_PROFIT_LIMIT'

version: "binance-api-node": "^0.11.28"

In general, OrderType types description doesn't match with the API. Any working solution to create price activated market order will be appreciated.

akrolasik avatar Dec 27 '21 20:12 akrolasik

Confirmed, the market stop order on Binance is called 'STOP_LOSS'.

binance-api-node has STOP and STOP_MARKET instead.

It appears we have two redundant strings, both incorrect.

subos2008 avatar Jan 24 '22 21:01 subos2008

I fixed the naming bug - however STOP_LOSS orders aren't supported for any of the listed symbols on the spot markets.

You can check orderTypes for all the symbols listed here: https://api.binance.com/api/v1/exchangeInfo

No (spot) symbols as of now support STOP_LOSS or TAKE_PROFIT (market) orderTypes.

subos2008 avatar Jan 25 '22 03:01 subos2008

Just use the _LIMIT equivalents instead

subos2008 avatar Jan 25 '22 03:01 subos2008

@subos2008 I am facing the same issue while creating a spot order with the type MARKET. I am using version 0.12.0 but getting the same error.

mohammadobaid1 avatar Nov 06 '22 16:11 mohammadobaid1