优化做市引擎、偏移做市引擎和趋势引擎的订单管理逻辑,将待取消订单的类型从数字更改为字符串,确保在处理订单时的类型一致性。同时,增强风险检查逻辑,确保在平仓时使用正确的价格,提升交易策略的稳定性和准确性。

This commit is contained in:
discountry
2025-09-27 17:05:51 +08:00
parent dde7ab71a9
commit 0bb22d891f
9 changed files with 217 additions and 92 deletions
+9 -2
View File
@@ -51,10 +51,17 @@ export interface GrvtOrderLeg {
is_buying_asset?: boolean;
}
export type GrvtTimeInForce =
| "GOOD_TILL_TIME"
| "ALL_OR_NONE"
| "IMMEDIATE_OR_CANCEL"
| "FILL_OR_KILL";
export interface GrvtOrderMetadata {
client_order_id?: string;
create_time?: string;
broker?: string | null;
trigger?: GrvtTriggerMetadata;
}
export interface GrvtOrderState {
@@ -71,7 +78,7 @@ export interface GrvtOrder {
client_order_id?: string;
sub_account_id?: string;
is_market?: boolean;
time_in_force?: string;
time_in_force?: GrvtTimeInForce;
post_only?: boolean;
reduce_only?: boolean;
legs?: GrvtOrderLeg[];
@@ -229,7 +236,7 @@ export interface GrvtOrderMetadataInput {
export interface GrvtUnsignedOrder {
sub_account_id: string;
is_market: boolean;
time_in_force: string;
time_in_force: GrvtTimeInForce;
post_only: boolean;
reduce_only: boolean;
legs: GrvtUnsignedOrderLeg[];