Hello good, my name Juan
I am working with the node-binance-api-ext and I am creating orders like this:
// create limit buy order
binance.futures.buy(“BELUSDT”, 10, 1.127);
// take profit limit sell order (but if price reach faster it will be short limit sell)
// so better to create it afte position created
binance.futures.sell(“BELUSDT”, 10, 1.13);
// create stop loss
binance.futures.stopMarketSell(“BELUSDT”, 10, 1.12);
I create the orders with its stop and take profit, the problem is that if the entire take profit price closes the order and the take profit well but the stop loss is not closed and vice versa if the stop is touched, the take does not close.
I have tried with the One-way position mode and nothing, I have tried with the hedge mode and neither.
I have tried switching to Hedge Mode mode like this by saying the order direction:
// or in case you have enabled hedge mode you need directly use positionSide
binance.futures.buy(“BTCUSDT”, 0.001, 18000, { positionSide: “LONG” });
binance.futures.sell(“BTCUSDT”, 0.001, 18000, { positionSide: “LONG” });
binance.futures.stopMarketSell(“BTCUSDT”, 0.001, 17000, { positionSide: “LONG” });
Using the Hedge Mode and the positionSide but in the same way it does not close the positions when it reaches the price, again it closes the take or stop well if it touches but the opposite does not always leave an open position.
Does anyone have a solution to this problem.
Thank you all in advance, I’ve been trying and trying a thousand things for hours and I can’t.
Thanks and best regards.
Sorry for my English, I use a translator, but I don’t speak English
Hola buenas, mi nombre Juan
Estoy trabajando con la node-binance-api-ext y estoy creado ordenes de esta forma:
// create limit buy order
binance.futures.buy(“BELUSDT”, 10, 1.127);
// take profit limit sell order (but if price reach faster it will be short limit sell)
// so better to create it afte position created
binance.futures.sell(“BELUSDT”, 10, 1.13);
// create stop loss
binance.futures.stopMarketSell(“BELUSDT”, 10, 1.12);
Creo las ordenes perfecto con su stop y take profit, el problema es que si el precio toda take profit se cierra bien la orden y el take profit pero no se cierra el stop lossy al revés si toca stop no cierra el take.
He probado con el modo de posición unilateral y nada, he probado con el modo de cobertura y tampoco.
He probado a cambiar al modo de cobertura de esta manera diciendo la dirección de la compra:
// or in case you have enabled hedge mode you need directly use positionSide
binance.futures.buy(“BTCUSDT”, 0.001, 18000, { positionSide: “LONG” });
binance.futures.sell(“BTCUSDT”, 0.001, 18000, { positionSide: “LONG” });
binance.futures.stopMarketSell(“BTCUSDT”, 0.001, 17000, { positionSide: “LONG” });
Usando el modo de cobertura y el positionSide pero de igual manera no cierra las posiciones cuando cuando alcanza el precio, de nuevo cierra bien el take o stop si toca pero la contraria no dejando siempre una posición abierta.
Alguien tienen una solución a este problema.
Muchas gracias de antemano a todos, llevo horas intentando y probando mil cosas y no lo consigo.
Gracias y un saludo.