mirror of
https://github.com/discountry/ritmex-bot.git
synced 2026-09-12 01:38:07 +00:00
feat: 更新订单协调器和 GRVT 适配器,添加触发类型支持,优化趋势引擎的损益计算逻辑
This commit is contained in:
@@ -1337,7 +1337,7 @@ function buildUnsignedOrder(params: {
|
||||
|
||||
function buildTriggerMetadata(params: CreateOrderParams): GrvtUnsignedOrder["metadata"]["trigger"] | undefined {
|
||||
if (params.type === "STOP_MARKET") {
|
||||
const triggerType = params.side === "BUY" ? "TAKE_PROFIT" : "STOP_LOSS";
|
||||
const triggerType = params.triggerType ?? (params.side === "BUY" ? "TAKE_PROFIT" : "STOP_LOSS");
|
||||
const stopPrice = params.stopPrice ?? params.activationPrice;
|
||||
if (!stopPrice) {
|
||||
throw new Error("GRVT stop orders require a stopPrice or activationPrice");
|
||||
|
||||
@@ -21,6 +21,7 @@ export interface CreateOrderParams {
|
||||
timeInForce?: TimeInForce;
|
||||
reduceOnly?: StringBoolean;
|
||||
closePosition?: StringBoolean;
|
||||
triggerType?: "UNSPECIFIED" | "TAKE_PROFIT" | "STOP_LOSS";
|
||||
}
|
||||
|
||||
export interface AsterAccountPosition {
|
||||
|
||||
Reference in New Issue
Block a user