Files
QTradeProgram/include/Proto/Trd_PlaceOrder.proto
2025-08-15 15:57:31 +08:00

52 lines
2.7 KiB
Protocol Buffer
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

syntax = "proto2";
package Trd_PlaceOrder;
option java_package = "com.futu.openapi.pb";
option go_package = "github.com/futuopen/ftapi4go/pb/trdplaceorder";
import "Common.proto";
import "Trd_Common.proto";
message C2S
{
required Common.PacketID packetID = 1; //交易写操作防重放攻击
required Trd_Common.TrdHeader header = 2; //交易公共参数头
required int32 trdSide = 3; //交易方向, 参见Trd_Common.TrdSide的枚举定义
required int32 orderType = 4; //订单类型, 参见Trd_Common.OrderType的枚举定义
required string code = 5; //代码港股必须是5位数字A股必须是6位数字美股没限制
required double qty = 6; //数量,期权单位是"张"(精确到小数点后 0 位,超出部分会被舍弃。期权期货单位是"张"
optional double price = 7; //价格,(证券账户精确到小数点后 3 位,期货账户精确到小数点后 9 位,超出部分会被舍弃)
//以下2个为调整价格使用都传才有效对港、A股有意义因为港股有价位A股2位精度美股可不传
optional bool adjustPrice = 8; //是否调整价格如果价格不合法是否调整到合法价位true调整false不调整
optional double adjustSideAndLimit = 9; //调整方向和调整幅度百分比限制正数代表向上调整负数代表向下调整具体值代表调整幅度限制0.015代表向上调整且幅度不超过1.5%-0.01代表向下调整且幅度不超过1%
optional int32 secMarket = 10; //证券所属市场参见TrdSecMarket的枚举定义
optional string remark = 11; //用户备注字符串最多只能传64字节。可用于标识订单唯一信息等下单填上订单结构就会带上。
optional int32 timeInForce = 12; //订单有效期限参见TrdCommon_TimeInForce的枚举定义
optional bool fillOutsideRTH = 13; //是否允许盘前盘后成交。仅适用于美股限价单。默认false
optional double auxPrice = 14; //触发价格
optional int32 trailType = 15; //跟踪类型, 参见Trd_Common.TrailType的枚举定义
optional double trailValue = 16; //跟踪金额/百分比
optional double trailSpread = 17; //指定价差
}
message S2C
{
required Trd_Common.TrdHeader header = 1; //交易公共参数头
optional uint64 orderID = 2; //订单号
optional string orderIDEx = 3; //表示服务器订单id可以用来代替orderID和orderID二选一
}
message Request
{
required C2S c2s = 1;
}
message Response
{
//以下3个字段每条协议都有注释说明在InitConnect.proto中
required int32 retType = 1 [default = -400];
optional string retMsg = 2;
optional int32 errCode = 3;
optional S2C s2c = 4;
}