如何使用node-binance-api设置停止损失?

发布于 2025-01-22 08:45:03 字数 210 浏览 1 评论 0原文

我正在使用node-binance-api。我已经下订单了

let adjustLeverage = await binance.futuresLeverage(coin, 2);
let res_2 = await binance.futuresMarketSell(coin, quantity);

。然后,我想设定停止损失。我该怎么做?

I am using node-binance-api. I have placed the order using

let adjustLeverage = await binance.futuresLeverage(coin, 2);
let res_2 = await binance.futuresMarketSell(coin, quantity);

. Then after I want to set stop loss. How can I do that?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

千仐 2025-01-29 08:45:03
all is working, my example:

to place buy limit

ret = await binance.futuresBuy(future_profit_obj.pair, future_profit_obj.bought_coins, current_price, {
  newClientOrderId: my_order_id_market,
  timeInForce: "GTC"
});
to place stop loss market

let ret2 = await binance.futuresMarketSell(future_profit_obj.pair, future_profit_obj.bought_coins, {
  newClientOrderId: my_order_id_sl,
  type: "STOP_MARKET",
  stopPrice: future_profit_obj.stop_loss_price,
  priceProtect: true 
});
to place take profit limit

let ret3 = await binance.futuresSell(future_profit_obj.pair, future_profit_obj.bought_coins, future_profit_obj.take_profit_price, {
    newClientOrderId: my_order_id_tp,
    stopPrice: future_profit_obj.take_profit_price,
    type: "TAKE_PROFIT",
    timeInForce: "GTC",
    priceProtect: true
});
all is working, my example:

to place buy limit

ret = await binance.futuresBuy(future_profit_obj.pair, future_profit_obj.bought_coins, current_price, {
  newClientOrderId: my_order_id_market,
  timeInForce: "GTC"
});
to place stop loss market

let ret2 = await binance.futuresMarketSell(future_profit_obj.pair, future_profit_obj.bought_coins, {
  newClientOrderId: my_order_id_sl,
  type: "STOP_MARKET",
  stopPrice: future_profit_obj.stop_loss_price,
  priceProtect: true 
});
to place take profit limit

let ret3 = await binance.futuresSell(future_profit_obj.pair, future_profit_obj.bought_coins, future_profit_obj.take_profit_price, {
    newClientOrderId: my_order_id_tp,
    stopPrice: future_profit_obj.take_profit_price,
    type: "TAKE_PROFIT",
    timeInForce: "GTC",
    priceProtect: true
});
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文