交易定义
账户风控状态
CltRiskLevel
NONE
未知
SAFE
安全
WARNING
预警
DANGER
危险
ABSOLUTE_SAFE
绝对安全
OPT_DANGER
危险
CltRiskLevel
enum CltRiskLevel
{
CltRiskLevel_Unknown = -1;
CltRiskLevel_Safe = 0;
CltRiskLevel_Warning = 1;
CltRiskLevel_Danger = 2;
CltRiskLevel_AbsoluteSafe = 3;
CltRiskLevel_OptDanger = 4;
}
1
2
3
4
5
6
7
8
9
CltRiskLevel
enum CltRiskLevel
{
CltRiskLevel_Unknown = -1;
CltRiskLevel_Safe = 0;
CltRiskLevel_Warning = 1;
CltRiskLevel_Danger = 2;
CltRiskLevel_AbsoluteSafe = 3;
CltRiskLevel_OptDanger = 4;
}
1
2
3
4
5
6
7
8
9
CltRiskLevel
enum CltRiskLevel
{
CltRiskLevel_Unknown = -1;
CltRiskLevel_Safe = 0;
CltRiskLevel_Warning = 1;
CltRiskLevel_Danger = 2;
CltRiskLevel_AbsoluteSafe = 3;
CltRiskLevel_OptDanger = 4;
}
1
2
3
4
5
6
7
8
9
CltRiskLevel
enum CltRiskLevel
{
CltRiskLevel_Unknown = -1;
CltRiskLevel_Safe = 0;
CltRiskLevel_Warning = 1;
CltRiskLevel_Danger = 2;
CltRiskLevel_AbsoluteSafe = 3;
CltRiskLevel_OptDanger = 4;
}
1
2
3
4
5
6
7
8
9
CltRiskLevel
enum CltRiskLevel
{
CltRiskLevel_Unknown = -1;
CltRiskLevel_Safe = 0;
CltRiskLevel_Warning = 1;
CltRiskLevel_Danger = 2;
CltRiskLevel_AbsoluteSafe = 3;
CltRiskLevel_OptDanger = 4;
}
1
2
3
4
5
6
7
8
9
货币类型
Currency
NONE
未知货币
HKD
港元
USD
美元
CNH
离岸人民币
JPY
日元
SGD
新元
AUD
澳元
Currency
enum Currency
{
Currency_Unknown = 0;
Currency_HKD = 1;
Currency_USD = 2;
Currency_CNH = 3;
Currency_JPY = 4;
Currency_SGD = 5;
Currency_AUD = 6;
}
1
2
3
4
5
6
7
8
9
10
Currency
enum Currency
{
Currency_Unknown = 0;
Currency_HKD = 1;
Currency_USD = 2;
Currency_CNH = 3;
Currency_JPY = 4;
Currency_SGD = 5;
Currency_AUD = 6;
}
1
2
3
4
5
6
7
8
9
10
Currency
enum Currency
{
Currency_Unknown = 0;
Currency_HKD = 1;
Currency_USD = 2;
Currency_CNH = 3;
Currency_JPY = 4;
Currency_SGD = 5;
Currency_AUD = 6;
}
1
2
3
4
5
6
7
8
9
10
Currency
enum Currency
{
Currency_Unknown = 0;
Currency_HKD = 1;
Currency_USD = 2;
Currency_CNH = 3;
Currency_JPY = 4;
Currency_SGD = 5;
Currency_AUD = 6;
}
1
2
3
4
5
6
7
8
9
10
Currency
enum Currency
{
Currency_Unknown = 0;
Currency_HKD = 1;
Currency_USD = 2;
Currency_CNH = 3;
Currency_JPY = 4;
Currency_SGD = 5;
Currency_AUD = 6;
}
1
2
3
4
5
6
7
8
9
10
跟踪类型
TrailType
NONE
未知
RATIO
比例
AMOUNT
金额
enum TrailType
{
TrailType_Unknown = 0;
TrailType_Ratio = 1;
TrailType_Amount = 2;
}
1
2
3
4
5
6
enum TrailType
{
TrailType_Unknown = 0;
TrailType_Ratio = 1;
TrailType_Amount = 2;
}
1
2
3
4
5
6
enum TrailType
{
TrailType_Unknown = 0;
TrailType_Ratio = 1;
TrailType_Amount = 2;
}
1
2
3
4
5
6
enum TrailType
{
TrailType_Unknown = 0;
TrailType_Ratio = 1;
TrailType_Amount = 2;
}
1
2
3
4
5
6
enum TrailType
{
TrailType_Unknown = 0;
TrailType_Ratio = 1;
TrailType_Amount = 2;
}
1
2
3
4
5
6
修改订单操作
ModifyOrderOp
NONE
未知操作
NORMAL
修改订单
CANCEL
撤单
DISABLE
使失效
- 指让订单失效,对交易所来说,DISABLE 的效果等同于 CANCEL。
- 订单「失效」后,未成交订单将直接从交易所撮合队列中撤出,但订单信息(如价格和数量)会继续保留在富途服务器,您随时可以重新 ENABLE 它。
ENABLE
使生效
- 指让处于失效状态的订单重新生效。对交易所来说,ENABLE 等同于下一笔新订单。
- 订单重新「生效」后,将按照原来的价格数量重新提交到交易所,并按照价格优先、时间优先顺序重新排队。
DELETE
删除
ModifyOrderOp
enum ModifyOrderOp
{
ModifyOrderOp_Unknown = 0;
ModifyOrderOp_Normal = 1;
ModifyOrderOp_Cancel = 2;
ModifyOrderOp_Disable = 3;
ModifyOrderOp_Enable = 4;
ModifyOrderOp_Delete = 5;
}
1
2
3
4
5
6
7
8
9
10
ModifyOrderOp
enum ModifyOrderOp
{
ModifyOrderOp_Unknown = 0;
ModifyOrderOp_Normal = 1;
ModifyOrderOp_Cancel = 2;
ModifyOrderOp_Disable = 3;
ModifyOrderOp_Enable = 4;
ModifyOrderOp_Delete = 5;
}
1
2
3
4
5
6
7
8
9
10
ModifyOrderOp
enum ModifyOrderOp
{
ModifyOrderOp_Unknown = 0;
ModifyOrderOp_Normal = 1;
ModifyOrderOp_Cancel = 2;
ModifyOrderOp_Disable = 3;
ModifyOrderOp_Enable = 4;
ModifyOrderOp_Delete = 5;
}
1
2
3
4
5
6
7
8
9
10
ModifyOrderOp
enum ModifyOrderOp
{
ModifyOrderOp_Unknown = 0;
ModifyOrderOp_Normal = 1;
ModifyOrderOp_Cancel = 2;
ModifyOrderOp_Disable = 3;
ModifyOrderOp_Enable = 4;
ModifyOrderOp_Delete = 5;
}
1
2
3
4
5
6
7
8
9
10
ModifyOrderOp
enum ModifyOrderOp
{
ModifyOrderOp_Unknown = 0;
ModifyOrderOp_Normal = 1;
ModifyOrderOp_Cancel = 2;
ModifyOrderOp_Disable = 3;
ModifyOrderOp_Enable = 4;
ModifyOrderOp_Delete = 5;
}
1
2
3
4
5
6
7
8
9
10
成交状态
DealStatus
OK
正常
CANCELLED
成交被取消
CHANGED
成交被更改
OrderFillStatus
enum OrderFillStatus
{
OrderFillStatus_OK = 0;
OrderFillStatus_Cancelled = 1;
OrderFillStatus_Changed = 2;
}
1
2
3
4
5
6
OrderFillStatus
enum OrderFillStatus
{
OrderFillStatus_OK = 0;
OrderFillStatus_Cancelled = 1;
OrderFillStatus_Changed = 2;
}
1
2
3
4
5
6
OrderFillStatus
enum OrderFillStatus
{
OrderFillStatus_OK = 0;
OrderFillStatus_Cancelled = 1;
OrderFillStatus_Changed = 2;
}
1
2
3
4
5
6
OrderFillStatus
enum OrderFillStatus
{
OrderFillStatus_OK = 0;
OrderFillStatus_Cancelled = 1;
OrderFillStatus_Changed = 2;
}
1
2
3
4
5
6
OrderFillStatus
enum OrderFillStatus
{
OrderFillStatus_OK = 0;
OrderFillStatus_Cancelled = 1;
OrderFillStatus_Changed = 2;
}
1
2
3
4
5
6
订单状态
OrderStatus
NONE
未知状态
WAITING_SUBMIT
待提交
SUBMITTING
提交中
富途服务器已将指令发送给上游交易所,上游交易所处理中
SUBMITTED
已提交,等待成交
FILLED_PART
部分成交
剩余部分仍未撤单。您可选择执行撤单,或者继续等待全部成交
FILLED_ALL
全部已成交
CANCELLED_PART
部分成交,剩余部分已撤单
CANCELLED_ALL
全部已撤单,无成交
FAILED
下单失败,服务拒绝
DISABLED
已失效
您主动执行失效操作后的订单状态,失效订单不会提交到上游交易所
DELETED
已删除,无成交的订单才能删除
OrderStatus
enum OrderStatus
{
OrderStatus_Unknown = -1;
OrderStatus_WaitingSubmit = 1;
OrderStatus_Submitting = 2;
OrderStatus_Submitted = 5;
OrderStatus_Filled_Part = 10;
OrderStatus_Filled_All = 11;
OrderStatus_Cancelled_Part = 14;
OrderStatus_Cancelled_All = 15;
OrderStatus_Failed = 21;
OrderStatus_Disabled = 22;
OrderStatus_Deleted = 23;
OrderStatus_FillCancelled = 24;
};
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
OrderStatus
enum OrderStatus
{
OrderStatus_Unknown = -1;
OrderStatus_WaitingSubmit = 1;
OrderStatus_Submitting = 2;
OrderStatus_Submitted = 5;
OrderStatus_Filled_Part = 10;
OrderStatus_Filled_All = 11;
OrderStatus_Cancelled_Part = 14;
OrderStatus_Cancelled_All = 15;
OrderStatus_Failed = 21;
OrderStatus_Disabled = 22;
OrderStatus_Deleted = 23;
OrderStatus_FillCancelled = 24;
};
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
OrderStatus
enum OrderStatus
{
OrderStatus_Unknown = -1;
OrderStatus_WaitingSubmit = 1;
OrderStatus_Submitting = 2;
OrderStatus_Submitted = 5;
OrderStatus_Filled_Part = 10;
OrderStatus_Filled_All = 11;
OrderStatus_Cancelled_Part = 14;
OrderStatus_Cancelled_All = 15;
OrderStatus_Failed = 21;
OrderStatus_Disabled = 22;
OrderStatus_Deleted = 23;
OrderStatus_FillCancelled = 24;
};
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
OrderStatus
enum OrderStatus
{
OrderStatus_Unknown = -1;
OrderStatus_WaitingSubmit = 1;
OrderStatus_Submitting = 2;
OrderStatus_Submitted = 5;
OrderStatus_Filled_Part = 10;
OrderStatus_Filled_All = 11;
OrderStatus_Cancelled_Part = 14;
OrderStatus_Cancelled_All = 15;
OrderStatus_Failed = 21;
OrderStatus_Disabled = 22;
OrderStatus_Deleted = 23;
OrderStatus_FillCancelled = 24;
};
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
OrderStatus
enum OrderStatus
{
OrderStatus_Unknown = -1;
OrderStatus_WaitingSubmit = 1;
OrderStatus_Submitting = 2;
OrderStatus_Submitted = 5;
OrderStatus_Filled_Part = 10;
OrderStatus_Filled_All = 11;
OrderStatus_Cancelled_Part = 14;
OrderStatus_Cancelled_All = 15;
OrderStatus_Failed = 21;
OrderStatus_Disabled = 22;
OrderStatus_Deleted = 23;
OrderStatus_FillCancelled = 24;
};
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
订单类型
OrderType
NONE
未知类型
NORMAL
限价单
MARKET
市价单
ABSOLUTE_LIMIT
绝对限价订单
只有价格完全匹配才成交,否则下单失败
- 举例:下一笔价格为 5 元的绝对限价买单,卖方的价格必须也是 5 元才能成交,卖方即使低于 5 元也不能成交,下单失败。卖出同理
AUCTION
竞价市价单
AUCTION_LIMIT
竞价限价单
仅早盘竞价和收盘竞价有效,参与竞价,且要求满足指定价格才会成交
SPECIAL_LIMIT
特别限价单
成交规则同增强限价订单,且部分成交后,交易所自动撤销订单
SPECIAL_LIMIT_ALL
特别限价且要求全部成交订单
STOP
止损市价单
STOP_LIMIT
止损限价单
MARKET_IF_TOUCHED
触及市价单(止盈)
LIMIT_IF_TOUCHED
触及限价单(止盈)
TRAILING_STOP
跟踪止损市价单
TRAILING_STOP_LIMIT
跟踪止损限价单
TWAP_LIMIT
时间加权限价算法单(港股和美股)
TWAP
时间加权市价算法单(仅美股)
VWAP_LIMIT
成交量加权限价算法单(港股和美股)
VWAP
成交量加权市价算法单(仅美股)
OrderType
enum OrderType
{
OrderType_Unknown = 0;
OrderType_Normal = 1;
OrderType_Market = 2;
OrderType_AbsoluteLimit = 5;
OrderType_Auction = 6;
OrderType_AuctionLimit = 7;
OrderType_SpecialLimit = 8;
OrderType_SpecialLimit_All = 9;
OrderType_Stop = 10;
OrderType_StopLimit = 11;
OrderType_MarketifTouched = 12;
OrderType_LimitifTouched = 13;
OrderType_TrailingStop = 14;
OrderType_TrailingStopLimit = 15;
OrderType_TWAP = 16;
OrderType_TWAP_LIMIT = 17;
OrderType_VWAP = 18;
OrderType_VWAP_LIMIT = 19;
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
OrderType
enum OrderType
{
OrderType_Unknown = 0;
OrderType_Normal = 1;
OrderType_Market = 2;
OrderType_AbsoluteLimit = 5;
OrderType_Auction = 6;
OrderType_AuctionLimit = 7;
OrderType_SpecialLimit = 8;
OrderType_SpecialLimit_All = 9;
OrderType_Stop = 10;
OrderType_StopLimit = 11;
OrderType_MarketifTouched = 12;
OrderType_LimitifTouched = 13;
OrderType_TrailingStop = 14;
OrderType_TrailingStopLimit = 15;
OrderType_TWAP = 16;
OrderType_TWAP_LIMIT = 17;
OrderType_VWAP = 18;
OrderType_VWAP_LIMIT = 19;
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
OrderType
enum OrderType
{
OrderType_Unknown = 0;
OrderType_Normal = 1;
OrderType_Market = 2;
OrderType_AbsoluteLimit = 5;
OrderType_Auction = 6;
OrderType_AuctionLimit = 7;
OrderType_SpecialLimit = 8;
OrderType_SpecialLimit_All = 9;
OrderType_Stop = 10;
OrderType_StopLimit = 11;
OrderType_MarketifTouched = 12;
OrderType_LimitifTouched = 13;
OrderType_TrailingStop = 14;
OrderType_TrailingStopLimit = 15;
OrderType_TWAP = 16;
OrderType_TWAP_LIMIT = 17;
OrderType_VWAP = 18;
OrderType_VWAP_LIMIT = 19;
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
OrderType
enum OrderType
{
OrderType_Unknown = 0;
OrderType_Normal = 1;
OrderType_Market = 2;
OrderType_AbsoluteLimit = 5;
OrderType_Auction = 6;
OrderType_AuctionLimit = 7;
OrderType_SpecialLimit = 8;
OrderType_SpecialLimit_All = 9;
OrderType_Stop = 10;
OrderType_StopLimit = 11;
OrderType_MarketifTouched = 12;
OrderType_LimitifTouched = 13;
OrderType_TrailingStop = 14;
OrderType_TrailingStopLimit = 15;
OrderType_TWAP = 16;
OrderType_TWAP_LIMIT = 17;
OrderType_VWAP = 18;
OrderType_VWAP_LIMIT = 19;
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
OrderType
enum OrderType
{
OrderType_Unknown = 0;
OrderType_Normal = 1;
OrderType_Market = 2;
OrderType_AbsoluteLimit = 5;
OrderType_Auction = 6;
OrderType_AuctionLimit = 7;
OrderType_SpecialLimit = 8;
OrderType_SpecialLimit_All = 9;
OrderType_Stop = 10;
OrderType_StopLimit = 11;
OrderType_MarketifTouched = 12;
OrderType_LimitifTouched = 13;
OrderType_TrailingStop = 14;
OrderType_TrailingStopLimit = 15;
OrderType_TWAP = 16;
OrderType_TWAP_LIMIT = 17;
OrderType_VWAP = 18;
OrderType_VWAP_LIMIT = 19;
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
持仓方向
PositionSide
NONE
未知方向
LONG
多仓
SHORT
空仓
PositionSide
enum PositionSide
{
PositionSide_Long = 0;
PositionSide_Unknown = -1;
PositionSide_Short = 1;
};
1
2
3
4
5
6
PositionSide
enum PositionSide
{
PositionSide_Long = 0;
PositionSide_Unknown = -1;
PositionSide_Short = 1;
};
1
2
3
4
5
6
PositionSide
enum PositionSide
{
PositionSide_Long = 0;
PositionSide_Unknown = -1;
PositionSide_Short = 1;
};
1
2
3
4
5
6
PositionSide
enum PositionSide
{
PositionSide_Long = 0;
PositionSide_Unknown = -1;
PositionSide_Short = 1;
};
1
2
3
4
5
6
PositionSide
enum PositionSide
{
PositionSide_Long = 0;
PositionSide_Unknown = -1;
PositionSide_Short = 1;
};
1
2
3
4
5
6
账户类型
TrdAccType
NONE
未知类型
CASH
现金账户
MARGIN
保证金账户
TrdAccType
enum TrdAccType
{
TrdAccType_Unknown = 0;
TrdAccType_Cash = 1;
TrdAccType_Margin = 2;
};
1
2
3
4
5
6
TrdAccType
enum TrdAccType
{
TrdAccType_Unknown = 0;
TrdAccType_Cash = 1;
TrdAccType_Margin = 2;
};
1
2
3
4
5
6
TrdAccType
enum TrdAccType
{
TrdAccType_Unknown = 0;
TrdAccType_Cash = 1;
TrdAccType_Margin = 2;
};
1
2
3
4
5
6
TrdAccType
enum TrdAccType
{
TrdAccType_Unknown = 0;
TrdAccType_Cash = 1;
TrdAccType_Margin = 2;
};
1
2
3
4
5
6
TrdAccType
enum TrdAccType
{
TrdAccType_Unknown = 0;
TrdAccType_Cash = 1;
TrdAccType_Margin = 2;
};
1
2
3
4
5
6
交易环境
TrdEnv
enum TrdEnv
{
TrdEnv_Simulate = 0;
TrdEnv_Real = 1;
}
1
2
3
4
5
TrdEnv
enum TrdEnv
{
TrdEnv_Simulate = 0;
TrdEnv_Real = 1;
}
1
2
3
4
5
TrdEnv
enum TrdEnv
{
TrdEnv_Simulate = 0;
TrdEnv_Real = 1;
}
1
2
3
4
5
TrdEnv
enum TrdEnv
{
TrdEnv_Simulate = 0;
TrdEnv_Real = 1;
}
1
2
3
4
5
TrdEnv
enum TrdEnv
{
TrdEnv_Simulate = 0;
TrdEnv_Real = 1;
}
1
2
3
4
5
交易市场
TrdMarket
NONE
未知市场
HK
香港市场
US
美国市场
CN
A 股市场
HKCC
香港 A 股通市场
- A 股通市场仅支持实盘交易,不支持模拟交易
- A 股通只能交易沪股通、深股通股票,具体以港交所 A 股通名单 为准
FUTURES
期货市场
FUTURES_SIMULATE_US
美国期货模拟市场
FUTURES_SIMULATE_HK
香港期货模拟市场
FUTURES_SIMULATE_SG
新加坡期货模拟市场
FUTURES_SIMULATE_JP
日本期货模拟市场
HKFUND
香港基金市场
USFUND
美国基金市场
TrdMarket
enum TrdMarket
{
TrdMarket_Unknown = 0;
TrdMarket_HK = 1;
TrdMarket_US = 2;
TrdMarket_CN = 3;
TrdMarket_HKCC = 4;
TrdMarket_Futures = 5;
TrdMarket_Futures_Simulate_HK = 10;
TrdMarket_Futures_Simulate_US = 11;
TrdMarket_Futures_Simulate_SG = 12;
TrdMarket_Futures_Simulate_JP = 13;
TrdMarket_HK_Fund = 113;
TrdMarket_US_Fund = 123;
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
TrdMarket
enum TrdMarket
{
TrdMarket_Unknown = 0;
TrdMarket_HK = 1;
TrdMarket_US = 2;
TrdMarket_CN = 3;
TrdMarket_HKCC = 4;
TrdMarket_Futures = 5;
TrdMarket_Futures_Simulate_HK = 10;
TrdMarket_Futures_Simulate_US = 11;
TrdMarket_Futures_Simulate_SG = 12;
TrdMarket_Futures_Simulate_JP = 13;
TrdMarket_HK_Fund = 113;
TrdMarket_US_Fund = 123;
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
TrdMarket
enum TrdMarket
{
TrdMarket_Unknown = 0;
TrdMarket_HK = 1;
TrdMarket_US = 2;
TrdMarket_CN = 3;
TrdMarket_HKCC = 4;
TrdMarket_Futures = 5;
TrdMarket_Futures_Simulate_HK = 10;
TrdMarket_Futures_Simulate_US = 11;
TrdMarket_Futures_Simulate_SG = 12;
TrdMarket_Futures_Simulate_JP = 13;
TrdMarket_HK_Fund = 113;
TrdMarket_US_Fund = 123;
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
TrdMarket
enum TrdMarket
{
TrdMarket_Unknown = 0;
TrdMarket_HK = 1;
TrdMarket_US = 2;
TrdMarket_CN = 3;
TrdMarket_HKCC = 4;
TrdMarket_Futures = 5;
TrdMarket_Futures_Simulate_HK = 10;
TrdMarket_Futures_Simulate_US = 11;
TrdMarket_Futures_Simulate_SG = 12;
TrdMarket_Futures_Simulate_JP = 13;
TrdMarket_HK_Fund = 113;
TrdMarket_US_Fund = 123;
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
TrdMarket
enum TrdMarket
{
TrdMarket_Unknown = 0;
TrdMarket_HK = 1;
TrdMarket_US = 2;
TrdMarket_CN = 3;
TrdMarket_HKCC = 4;
TrdMarket_Futures = 5;
TrdMarket_Futures_Simulate_HK = 10;
TrdMarket_Futures_Simulate_US = 11;
TrdMarket_Futures_Simulate_SG = 12;
TrdMarket_Futures_Simulate_JP = 13;
TrdMarket_HK_Fund = 113;
TrdMarket_US_Fund = 123;
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
账户状态
AccStatus
ACTIVE
生效账户
DISABLED
失效账户
TrdAccStatus
enum TrdAccStatus
{
TrdAccStatus_Active = 0;
TrdAccStatus_Disabled = 1;
}
1
2
3
4
5
TrdAccStatus
enum TrdAccStatus
{
TrdAccStatus_Active = 0;
TrdAccStatus_Disabled = 1;
}
1
2
3
4
5
TrdAccStatus
enum TrdAccStatus
{
TrdAccStatus_Active = 0;
TrdAccStatus_Disabled = 1;
}
1
2
3
4
5
TrdAccStatus
enum TrdAccStatus
{
TrdAccStatus_Active = 0;
TrdAccStatus_Disabled = 1;
}
1
2
3
4
5
TrdAccStatus
enum TrdAccStatus
{
TrdAccStatus_Active = 0;
TrdAccStatus_Disabled = 1;
}
1
2
3
4
5
交易证券市场
TrdSecMarket
enum TrdSecMarket
{
TrdSecMarket_Unknown = 0;
TrdSecMarket_HK = 1;
TrdSecMarket_US = 2;
TrdSecMarket_CN_SH = 31;
TrdSecMarket_CN_SZ = 32;
TrdSecMarket_SG = 41;
TrdSecMarket_JP = 51;
}
1
2
3
4
5
6
7
8
9
10
TrdSecMarket
enum TrdSecMarket
{
TrdSecMarket_Unknown = 0;
TrdSecMarket_HK = 1;
TrdSecMarket_US = 2;
TrdSecMarket_CN_SH = 31;
TrdSecMarket_CN_SZ = 32;
TrdSecMarket_SG = 41;
TrdSecMarket_JP = 51;
}
1
2
3
4
5
6
7
8
9
10
TrdSecMarket
enum TrdSecMarket
{
TrdSecMarket_Unknown = 0;
TrdSecMarket_HK = 1;
TrdSecMarket_US = 2;
TrdSecMarket_CN_SH = 31;
TrdSecMarket_CN_SZ = 32;
TrdSecMarket_SG = 41;
TrdSecMarket_JP = 51;
}
1
2
3
4
5
6
7
8
9
10
TrdSecMarket
enum TrdSecMarket
{
TrdSecMarket_Unknown = 0;
TrdSecMarket_HK = 1;
TrdSecMarket_US = 2;
TrdSecMarket_CN_SH = 31;
TrdSecMarket_CN_SZ = 32;
TrdSecMarket_SG = 41;
TrdSecMarket_JP = 51;
}
1
2
3
4
5
6
7
8
9
10
TrdSecMarket
enum TrdSecMarket
{
TrdSecMarket_Unknown = 0;
TrdSecMarket_HK = 1;
TrdSecMarket_US = 2;
TrdSecMarket_CN_SH = 31;
TrdSecMarket_CN_SZ = 32;
TrdSecMarket_SG = 41;
TrdSecMarket_JP = 51;
}
1
2
3
4
5
6
7
8
9
10
交易方向
TrdSide
NONE
未知方向
BUY
买入
SELL
卖出
SELL_SHORT
卖空
BUY_BACK
买回
TrdSide
enum TrdSide
{
TrdSide_Unknown = 0;
TrdSide_Buy = 1;
TrdSide_Sell = 2;
TrdSide_SellShort = 3;
TrdSide_BuyBack = 4;
}
1
2
3
4
5
6
7
8
9
TrdSide
enum TrdSide
{
TrdSide_Unknown = 0;
TrdSide_Buy = 1;
TrdSide_Sell = 2;
TrdSide_SellShort = 3;
TrdSide_BuyBack = 4;
}
1
2
3
4
5
6
7
8
9
TrdSide
enum TrdSide
{
TrdSide_Unknown = 0;
TrdSide_Buy = 1;
TrdSide_Sell = 2;
TrdSide_SellShort = 3;
TrdSide_BuyBack = 4;
}
1
2
3
4
5
6
7
8
9
TrdSide
enum TrdSide
{
TrdSide_Unknown = 0;
TrdSide_Buy = 1;
TrdSide_Sell = 2;
TrdSide_SellShort = 3;
TrdSide_BuyBack = 4;
}
1
2
3
4
5
6
7
8
9
TrdSide
enum TrdSide
{
TrdSide_Unknown = 0;
TrdSide_Buy = 1;
TrdSide_Sell = 2;
TrdSide_SellShort = 3;
TrdSide_BuyBack = 4;
}
1
2
3
4
5
6
7
8
9
提示
下单 接口的交易方向 ,建议仅使用 买入
和 卖出
两个方向作为入参。
卖空
和 买回
仅用于 查询今日订单 ,查询历史订单 ,响应订单推送回调 ,查询当日成交 ,查询历史成交 ,响应成交推送回调 接口的返回字段展示。
订单有效期
TimeInForce
enum TimeInForce
{
TimeInForce_DAY = 0;
TimeInForce_GTC = 1;
}
1
2
3
4
5
TimeInForce
enum TimeInForce
{
TimeInForce_DAY = 0;
TimeInForce_GTC = 1;
}
1
2
3
4
5
TimeInForce
enum TimeInForce
{
TimeInForce_DAY = 0;
TimeInForce_GTC = 1;
}
1
2
3
4
5
TimeInForce
enum TimeInForce
{
TimeInForce_DAY = 0;
TimeInForce_GTC = 1;
}
1
2
3
4
5
TimeInForce
enum TimeInForce
{
TimeInForce_DAY = 0;
TimeInForce_GTC = 1;
}
1
2
3
4
5
账户所属券商
SecurityFirm
NONE
未知
FUTUSECURITIES
富途证券(香港)
FUTUINC
moomoo证券(美国)
FUTUSG
moomoo证券(新加坡)
FUTUAU
moomoo证券(澳大利亚)
SecurityFirm
enum SecurityFirm
{
SecurityFirm_Unknown = 0;
SecurityFirm_FutuSecurities = 1;
SecurityFirm_FutuInc = 2;
SecurityFirm_FutuSG = 3;
SecurityFirm_FutuAU = 4;
}
1
2
3
4
5
6
7
8
SecurityFirm
enum SecurityFirm
{
SecurityFirm_Unknown = 0;
SecurityFirm_FutuSecurities = 1;
SecurityFirm_FutuInc = 2;
SecurityFirm_FutuSG = 3;
SecurityFirm_FutuAU = 4;
}
1
2
3
4
5
6
7
8
SecurityFirm
enum SecurityFirm
{
SecurityFirm_Unknown = 0;
SecurityFirm_FutuSecurities = 1;
SecurityFirm_FutuInc = 2;
SecurityFirm_FutuSG = 3;
SecurityFirm_FutuAU = 4;
}
1
2
3
4
5
6
7
8
SecurityFirm
enum SecurityFirm
{
SecurityFirm_Unknown = 0;
SecurityFirm_FutuSecurities = 1;
SecurityFirm_FutuInc = 2;
SecurityFirm_FutuSG = 3;
SecurityFirm_FutuAU = 4;
}
1
2
3
4
5
6
7
8
SecurityFirm
enum SecurityFirm
{
SecurityFirm_Unknown = 0;
SecurityFirm_FutuSecurities = 1;
SecurityFirm_FutuInc = 2;
SecurityFirm_FutuSG = 3;
SecurityFirm_FutuAU = 4;
}
1
2
3
4
5
6
7
8
模拟交易账户类型
SimAccType
NONE
未知
STOCK
股票模拟账户
OPTION
期权模拟账户
FUTURES
期货模拟账户
SimAccType
enum SimAccType
{
SimAccType_Unknown = 0;
SimAccType_Stock = 1;
SimAccType_Option = 2;
SimAccType_Futures = 3;
}
1
2
3
4
5
6
7
SimAccType
enum SimAccType
{
SimAccType_Unknown = 0;
SimAccType_Stock = 1;
SimAccType_Option = 2;
SimAccType_Futures = 3;
}
1
2
3
4
5
6
7
SimAccType
enum SimAccType
{
SimAccType_Unknown = 0;
SimAccType_Stock = 1;
SimAccType_Option = 2;
SimAccType_Futures = 3;
}
1
2
3
4
5
6
7
SimAccType
enum SimAccType
{
SimAccType_Unknown = 0;
SimAccType_Stock = 1;
SimAccType_Option = 2;
SimAccType_Futures = 3;
}
1
2
3
4
5
6
7
SimAccType
enum SimAccType
{
SimAccType_Unknown = 0;
SimAccType_Stock = 1;
SimAccType_Option = 2;
SimAccType_Futures = 3;
}
1
2
3
4
5
6
7
风险状态
CltRiskStatus
NONE
未知
LEVEL1
非常安全
LEVEL2
安全
LEVEL3
较安全
LEVEL4
较低风险
LEVEL5
中等风险
LEVEL6
偏高风险
LEVEL7
预警
LEVEL8
危险
LEVEL9
危险
CltRiskStatus
enum CltRiskStatus
{
CltRiskStatus_Level1 = 0;
CltRiskStatus_Level2 = 1;
CltRiskStatus_Level3 = 2;
CltRiskStatus_Level4 = 3;
CltRiskStatus_Level5 = 4;
CltRiskStatus_Level6 = 5;
CltRiskStatus_Level7 = 6;
CltRiskStatus_Level8 = 7;
CltRiskStatus_Level9 = 8;
}
1
2
3
4
5
6
7
8
9
10
11
12
CltRiskStatus
enum CltRiskStatus
{
CltRiskStatus_Level1 = 0;
CltRiskStatus_Level2 = 1;
CltRiskStatus_Level3 = 2;
CltRiskStatus_Level4 = 3;
CltRiskStatus_Level5 = 4;
CltRiskStatus_Level6 = 5;
CltRiskStatus_Level7 = 6;
CltRiskStatus_Level8 = 7;
CltRiskStatus_Level9 = 8;
}
1
2
3
4
5
6
7
8
9
10
11
12
CltRiskStatus
enum CltRiskStatus
{
CltRiskStatus_Level1 = 0;
CltRiskStatus_Level2 = 1;
CltRiskStatus_Level3 = 2;
CltRiskStatus_Level4 = 3;
CltRiskStatus_Level5 = 4;
CltRiskStatus_Level6 = 5;
CltRiskStatus_Level7 = 6;
CltRiskStatus_Level8 = 7;
CltRiskStatus_Level9 = 8;
}
1
2
3
4
5
6
7
8
9
10
11
12
CltRiskStatus
enum CltRiskStatus
{
CltRiskStatus_Level1 = 0;
CltRiskStatus_Level2 = 1;
CltRiskStatus_Level3 = 2;
CltRiskStatus_Level4 = 3;
CltRiskStatus_Level5 = 4;
CltRiskStatus_Level6 = 5;
CltRiskStatus_Level7 = 6;
CltRiskStatus_Level8 = 7;
CltRiskStatus_Level9 = 8;
}
1
2
3
4
5
6
7
8
9
10
11
12
CltRiskStatus
enum CltRiskStatus
{
CltRiskStatus_Level1 = 0;
CltRiskStatus_Level2 = 1;
CltRiskStatus_Level3 = 2;
CltRiskStatus_Level4 = 3;
CltRiskStatus_Level5 = 4;
CltRiskStatus_Level6 = 5;
CltRiskStatus_Level7 = 6;
CltRiskStatus_Level8 = 7;
CltRiskStatus_Level9 = 8;
}
1
2
3
4
5
6
7
8
9
10
11
12
日内交易限制情况
DtStatus
NONE
未知
Unlimited
无限次
当前可以无限次日内交易,注意留意剩余日内交易购买力
EM_Call
EM-Call
当前状态不能新建仓位,需要补充资产净值至$25000以上,否则会被禁止新建仓位90天
DT_Call
DT-Call
当前状态有未补平的日内交易追缴金额(DT Call),需要在5个交易日内足额入金来补平 DT Call,否则会被禁止新建仓位,直到足额存入资金才会解禁
DTStatus
enum DTStatus
{
DTStatus_Unknown = 0;
DTStatus_Unlimited = 1;
DTStatus_EMCall = 2;
DTStatus_DTCall = 3;
}
1
2
3
4
5
6
7
DTStatus
enum DTStatus
{
DTStatus_Unknown = 0;
DTStatus_Unlimited = 1;
DTStatus_EMCall = 2;
DTStatus_DTCall = 3;
}
1
2
3
4
5
6
7
DTStatus
enum DTStatus
{
DTStatus_Unknown = 0;
DTStatus_Unlimited = 1;
DTStatus_EMCall = 2;
DTStatus_DTCall = 3;
}
1
2
3
4
5
6
7
DTStatus
enum DTStatus
{
DTStatus_Unknown = 0;
DTStatus_Unlimited = 1;
DTStatus_EMCall = 2;
DTStatus_DTCall = 3;
}
1
2
3
4
5
6
7
DTStatus
enum DTStatus
{
DTStatus_Unknown = 0;
DTStatus_Unlimited = 1;
DTStatus_EMCall = 2;
DTStatus_DTCall = 3;
}
1
2
3
4
5
6
7
交易品类
TrdCategory
enum TrdCategory
{
TrdCategory_Unknown = 0;
TrdCategory_Security = 1;
TrdCategory_Future = 2;
}
1
2
3
4
5
6
账户现金信息
AccCashInfo
message AccCashInfo
{
optional int32 currency = 1;
optional double cash = 2;
optional double availableBalance = 3;
optional double netCashPower = 4;
}
1
2
3
4
5
6
7
交易协议公共参数头
TrdHeader
message TrdHeader
{
required int32 trdEnv = 1;
required uint64 accID = 2;
required int32 trdMarket = 3;
}
1
2
3
4
5
6
交易业务账户
TrdAcc
message TrdAcc
{
required int32 trdEnv = 1;
required uint64 accID = 2;
repeated int32 trdMarketAuthList = 3;
optional int32 accType = 4;
optional string cardNum = 5;
optional int32 securityFirm = 6;
optional int32 simAccType = 7;
optional string uniCardNum = 8;
optional int32 accStatus = 9;
}
1
2
3
4
5
6
7
8
9
10
11
12
账户资金
Funds
message Funds
{
required double power = 1;
required double totalAssets = 2;
required double cash = 3;
required double marketVal = 4;
required double frozenCash = 5;
required double debtCash = 6;
required double avlWithdrawalCash = 7;
optional int32 currency = 8;
optional double availableFunds = 9;
optional double unrealizedPL = 10;
optional double realizedPL = 11;
optional int32 riskLevel = 12;
optional double initialMargin = 13;
optional double maintenanceMargin = 14;
repeated AccCashInfo cashInfoList = 15;
optional double maxPowerShort = 16;
optional double netCashPower = 17;
optional double longMv = 18;
optional double shortMv = 19;
optional double pendingAsset = 20;
optional double maxWithdrawal = 21;
optional int32 riskStatus = 22;
optional double marginCallMargin = 23;
optional bool isPdt = 24;
optional string pdtSeq = 25;
optional double beginningDTBP = 26;
optional double remainingDTBP = 27;
optional double dtCallAmount = 28;
optional int32 dtStatus = 29;
optional double securitiesAssets = 30;
optional double fundAssets = 31;
optional double bondAssets = 32;
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
账户持仓
Position
message Position
{
required uint64 positionID = 1;
required int32 positionSide = 2;
required string code = 3;
required string name = 4;
required double qty = 5;
required double canSellQty = 6;
required double price = 7;
optional double costPrice = 8;
required double val = 9;
required double plVal = 10;
optional double plRatio = 11;
optional int32 secMarket = 12;
optional double td_plVal = 21;
optional double td_trdVal = 22;
optional double td_buyVal = 23;
optional double td_buyQty = 24;
optional double td_sellVal = 25;
optional double td_sellQty = 26;
optional double unrealizedPL = 28;
optional double realizedPL = 29;
optional int32 currency = 30;
optional int32 trdMarket = 31;
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
订单
Order
message Order
{
required int32 trdSide = 1;
required int32 orderType = 2;
required int32 orderStatus = 3;
required uint64 orderID = 4;
required string orderIDEx = 5;
required string code = 6;
required string name = 7;
required double qty = 8;
optional double price = 9;
required string createTime = 10;
required string updateTime = 11;
optional double fillQty = 12;
optional double fillAvgPrice = 13;
optional string lastErrMsg = 14;
optional int32 secMarket = 15;
optional double createTimestamp = 16;
optional double updateTimestamp = 17;
optional string remark = 18;
optional double auxPrice = 21;
optional int32 trailType = 22;
optional double trailValue = 23;
optional double trailSpread = 24;
optional int32 currency = 25;
optional int32 trdMarket = 26;
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
订单费用条目
OrderFeeItem
message OrderFeeItem
{
optional string title = 1;
optional double value = 2;
}
1
2
3
4
5
订单费用
OrderFee
message OrderFee
{
required string orderIDEx = 1;
optional double feeAmount = 2;
repeated OrderFeeItem feeList = 3;
}
1
2
3
4
5
6
成交
OrderFill
message OrderFill
{
required int32 trdSide = 1;
required uint64 fillID = 2;
required string fillIDEx = 3;
optional uint64 orderID = 4;
optional string orderIDEx = 5;
required string code = 6;
required string name = 7;
required double qty = 8;
required double price = 9;
required string createTime = 10;
optional int32 counterBrokerID = 11;
optional string counterBrokerName = 12;
optional int32 secMarket = 13;
optional double createTimestamp = 14;
optional double updateTimestamp = 15;
optional int32 status = 16;
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
最大可交易数量
MaxTrdQtys
message MaxTrdQtys
{
required double maxCashBuy = 1;
optional double maxCashAndMarginBuy = 2;
required double maxPositionSell = 3;
optional double maxSellShort = 4;
optional double maxBuyBack = 5;
optional double longRequiredIM = 6;
optional double shortRequiredIM = 7;
}
1
2
3
4
5
6
7
8
9
10
11
过滤条件
TrdFilterConditions
message TrdFilterConditions
{
repeated string codeList = 1;
repeated uint64 idList = 2;
optional string beginTime = 3;
optional string endTime = 4;
repeated string orderIDExList = 5;
}
1
2
3
4
5
6
7
8