mirror of
https://github.com/discountry/ritmex-bot.git
synced 2026-09-09 08:18:07 +00:00
fix sl
This commit is contained in:
@@ -169,6 +169,9 @@ export async function placeOrder(
|
|||||||
lockOperating(locks, timers, pendings, type, log);
|
lockOperating(locks, timers, pendings, type, log);
|
||||||
try {
|
try {
|
||||||
const closePosition = reduceOnly ? true : undefined;
|
const closePosition = reduceOnly ? true : undefined;
|
||||||
|
// StandX API: reduce-only 订单不能设置 tp/sl
|
||||||
|
const slPrice = reduceOnly ? undefined : opts?.slPrice;
|
||||||
|
const tpPrice = reduceOnly ? undefined : opts?.tpPrice;
|
||||||
const order = await routeLimitOrder({
|
const order = await routeLimitOrder({
|
||||||
adapter,
|
adapter,
|
||||||
symbol,
|
symbol,
|
||||||
@@ -178,8 +181,8 @@ export async function placeOrder(
|
|||||||
timeInForce: reduceOnly ? "GTC" : "GTX",
|
timeInForce: reduceOnly ? "GTC" : "GTX",
|
||||||
reduceOnly: reduceOnly ? true : undefined,
|
reduceOnly: reduceOnly ? true : undefined,
|
||||||
closePosition,
|
closePosition,
|
||||||
slPrice: opts?.slPrice,
|
slPrice,
|
||||||
tpPrice: opts?.tpPrice,
|
tpPrice,
|
||||||
});
|
});
|
||||||
pendings[type] = String(order.orderId);
|
pendings[type] = String(order.orderId);
|
||||||
log("order", `挂限价单: ${side} @ ${priceNum} 数量 ${quantity} reduceOnly=${reduceOnly}${opts?.slPrice ? ` sl=${opts.slPrice}` : ""}`);
|
log("order", `挂限价单: ${side} @ ${priceNum} 数量 ${quantity} reduceOnly=${reduceOnly}${opts?.slPrice ? ` sl=${opts.slPrice}` : ""}`);
|
||||||
|
|||||||
Reference in New Issue
Block a user