下单交易
创建订单
对应的请求类:TigerRequest(TradeApiService.PLACE_ORDER)
说明
交易下单接口。关于如何选择标的、订单类型、方向数量等,请见下方说明。请在运行程序前结合本文档的概述部分及FAQ-交易-支持的订单列表部分,检查您的账户是否支持所请求的订单,并检查交易规则是否允许在程序运行时段对特定标的下单。若下单失败,可首先阅读文档FAQ-交易部分排查
平仓:查持仓信息,如果持仓数量(position)为正则下相同数量的卖单(action=SELL),为负则下相同数量的买单(action=BUY)
CAUTION
1、市价单(MKT)和止损单(STP)不支持盘前盘后阶段交易,在调用下单接口时,需要把 outside_rth 设置为 false
2、对于可做空标的,暂不支持锁仓功能,因此无法同时持有相同标的多头和空头持仓
3、附加订单的主订单类型暂时仅支持限价单
4、限价价格不匹配tickSize,可以参考合约返回tickSizes字段,利用StockPriceUtils工具类判断是否匹配,修复价格符合tickSize要求
5、市价单(MKT)和模拟账号,对'time_in_force'参数都不支持GTC
6、模拟账号暂不支持窝轮和牛熊证的订单
订单状态说明
如何判断综合和模拟账号的部分成交状态?
当订单状态不是Initial和Filled(有可能是PendingSubmit,Cancelled,Invalid,Inactive其中一种)时,都有可能是部分成交的状态,可以通过订单成交数量是否大于0来判断
如何判断环球账号部分成交状态?
订单状态是 Filled,且订单成交数量大于0
订单状态变化流程
其他说明
- 只支持以【IWM/SPY/QQQ】这三只 ETF 为底层标的的周中到期美股 ETF 期权的交易,其他指数的非周五到期的期权不支持交易
- 不可以直接开反向仓位,如持仓100股,直接卖出200股是不允许的,需先平仓
参数
参数 | 类型 | 描述 | 市价单 | 限价单 | 止损单 | 止损限价单 | 跟踪止损单 |
---|---|---|---|---|---|---|---|
account | string | 用户授权账户:402901 | |||||
order_id | int | 订单编号,作用是防止重复下单。可以通过订单号接口获取。如果传0,则服务器端会自动生成订单编号,传0时无法防止重复下单,请谨慎选择 | 选填 | 选填 | 选填 | 选填 | 选填 |
symbol | string | 股票代码 如:AAPL;(sec_typ为窝轮牛熊证时,在app窝轮/牛熊证列表中名称下面的5位数字) | |||||
sec_type | string | 合约类型 (STK 股票 OPT 美股期权 WAR 港股窝轮 IOPT 港股牛熊证 FUT 期货; FUND 基金) | |||||
action | string | 交易方向 BUY/SELL | |||||
order_type | string | 订单类型. MKT(市价单), LMT(限价单), STP(止损单), STP_LMT(止损限价单), TRAIL(跟踪止损单) | MKT | LMT | STP | STP_LMT | TRAIL |
total_quantity | long | 下单数量(港股,沪港通,窝轮,牛熊证有最小数量限制) | |||||
total_quantity_scale | int | 下单数量的偏移量,默认为0。碎股单的total_quantity 和 total_quantity_scale 结合起来代表真实下单数量,如 total_quantity=111 total_quantity_scale=2,那么真实 quantity=111*10^(-2)=1.11 | 选填 | 选填 | 选填 | 选填 | 选填 |
cash_amount | Double | 订单金额(基金等金额订单) | 选填 | ||||
limit_price | double | 限价,当 order_type 为LMT,STP_LMT时该参数必需 | |||||
aux_price | double | 股票订单止损触发价。含义为价差,与trailing_percent同时存在时被trailing_percent覆盖。当 order_type 为STP,STP_LMT时该参数必需,当 order_type 为 TRAIL时,为跟踪额 | 选填 | ||||
trailing_percent | double | 跟踪止损单-止损百分比 。当 order_type 为 TRAIL时,aux_price和trailing_percent两者互斥,优先使用trailing_percent | 选填 | ||||
outside_rth | boolean | true: 允许盘前盘后交易(美股专属), false: 不允许,默认为允许。(市价单、止损单、跟踪止损单只在盘中有效,将忽略outside_rth参数) | 选填 | 选填 | 选填 | ||
trading_session_type | TradeSession | OverNight: 美股夜盘订单。(仅限价单) | 选填 | 选填 | |||
adjust_limit | double | 价格微调幅度(默认为0表示不调整,正数为向上调整,负数向下调整),对传入价格自动调整到合法价位上。例如:0.001 代表向上调整且幅度不超过 0.1%;-0.001 代表向下调整且幅度不超过 0.1%。默认 0 表示不调整 | 选填 | 选填 | 选填 | 选填 | |
market | string | 市场 (美股 US 港股 HK 沪港通 CN) | 选填 | 选填 | 选填 | 选填 | 选填 |
currency | string | 货币(美股 USD 港股 HKD 沪港通 CNH) | 选填 | 选填 | 选填 | 选填 | 选填 |
time_in_force | string | 订单有效期,只能是 DAY(当日有效)、GTC(取消前有效,最长有效时间180天)、GTD(在指定时间前有效),默认为DAY | 选填 | 选填 | 选填 | 选填 | 选填 |
expire_time | long | 订单有效的截止时间, 13位的时间戳,精确到秒(time_in_force为GTD时为必填,其他类型时无效) | 选填 | 选填 | 选填 | ||
exchange | string | 交易所 (美股 SMART 港股 SEHK 沪港通 SEHKNTL 深港通 SEHKSZSE)否 | 选填 | 选填 | 选填 | 选填 | 选填 |
expiry | string | 过期日(期权、窝轮、牛熊证专属) | 选填 | 选填 | 选填 | 选填 | 选填 |
strike | string | 底层价格(期权、窝轮、牛熊证专属) | 选填 | 选填 | 选填 | 选填 | 选填 |
right | string | 期权方向 PUT/CALL(期权、窝轮、牛熊证专属) | 选填 | 选填 | 选填 | 选填 | 选填 |
multiplier | float | 1手单位(期权、窝轮、牛熊证专属) | 选填 | 选填 | 选填 | 选填 | 选填 |
local_symbol | string | 窝轮牛熊证该字段必填,在app窝轮/牛熊证列表中名称下面的5位数字 | 选填 | 选填 | 选填 | 选填 | 选填 |
secret_key | string | 机构用户专用,交易员密钥 | 选填 | 选填 | 选填 | 选填 | 选填 |
user_mark | String | 下单备注信息,下单后不能修改,查询订单时返回userMark信息 | 选填 | 选填 | 选填 | 选填 | 选填 |
- 附加订单参数
附加订单(Attached Order )是指能通过附加的子订单对主订单起到止盈或止损效果的订单,可以附加的子订单类型有限价单(可用于止盈)、止损限价单/止损单(可用于止损)。通过增加以下参数可以实现附加订单
参数 | 类型 | 描述 | 附加止损 | 附加止盈 | 附加跟踪止损 | 附加括号 |
---|---|---|---|---|---|---|
attach_type | string | 附加订单类型,下附加订单时必填。(order_type应为LMT): PROFIT-止盈单,LOSS-止损单,BRACKETS-括号订单(包含附加止盈单和附加止损单) | ||||
profit_taker_orderId | int | 止盈单编号,可以通过订单号接口获取。如果传0,则服务器端会自动生成止盈单编号 | 选填 | 选填 | 选填 | |
profit_taker_price | double | 止盈单价格,下止盈单时必填 | ||||
profit_taker_tif | string | 同time_in_force字段,订单有效期,只能是 DAY(当日有效)和GTC(取消前有效),下止盈单时必填 | ||||
profit_taker_rth | boolean | 同outside_rth字段 | ||||
stop_loss_orderId | int | 止损单编号,可以通过订单号接口获取。如果传0,则服务器端会自动生成止损单编号 | ||||
stop_loss_price | double | 止损单价格(止损单的触发价),下止损单时必填 | ||||
stop_loss_limit_price | double | 止损单的执行限价(暂只对综合账号有效)。止损单的限价没有填写时,为附加止损市价单 | 选填 | 选填 | ||
stop_loss_tif | string | 同time_in_force字段,订单有效期,只能是 DAY(当日有效)和GTC(取消前有效),下止损单时必填 | ||||
stop_loss_trailing_percent | double | 跟踪止损单-止损百分比,当下跟踪止损单时,止损百分比(stopLossTrailingPercent)和止损额(stopLossTrailingAmount)其中一项必填,如果都填时,会使用止损百分比作为参数。 | 选填 | 选填 | ||
stop_loss_trailing_amount | double | 跟踪止损单-止损额,当下跟踪止损单时,止损百分比(stopLossTrailingPercent)和止损额(stopLossTrailingAmount)其中一项必填,如果都填时,会使用止损百分比作为参数。 | 选填 | 选填 |
- TWAP/VWAP订单参数
TWAP/VWAP订单,只支持美股股票标的,只能在盘中下单,不支持预挂单
参数 | 类型 | 算法参数 | 描述 | TWAP | VWAP |
---|---|---|---|---|---|
order_type | string | 订单类型,TWAP/VWAP | |||
account | string | 资金账号 | |||
symbol | string | 股票代码 如:AAPL | |||
sec_type | string | 只支持STK | |||
total_quantity | boolean | 订单数量 | |||
algo_params | List<TagValue> | 算法参数 | 选填 | 选填 | |
- | long | start_time | 策略开始时间(时间戳) | 选填 | 选填 |
- | long | end_time | 策略结束时间(时间戳) | 选填 | 选填 |
- | string | participation_rate | 最大参与率(成交量为日均成交量的最大比例,0.01-0.5) | 选填 |
返回
名称 | 类型 | 说明 |
---|---|---|
id | long | 唯一单号ID,可用于查询订单/修改订单/取消订单 |
subIds | List<Long> | 附加单时,返回子订单号ID列表 |
orders | List<TradeOrder> | 返回订单详细信息 |
构建合约对象
// 美股股票合约
ContractItem contract = ContractItem.BuildStockContract("AAPL", Currency.USD.ToString());
// 港股股票合约
ContractItem contract = ContractItem.BuildStockContract("00700", Currency.HKD.ToString());
// 港股窝轮合约(需要注意同一个symbol,环球账号和综合账号的expiry可能不同)
ContractItem contract = ContractItem.BuildWarrantContract("13745", "20211217", 719.38D, Right.CALL.ToString());
// 港股牛熊证合约
ContractItem contract = ContractItem.BuildCbbcContract("50296", "20220331", 457D, Right.CALL.ToString());
// 美股期权合约
ContractItem contract = ContractItem.BuildOptionContract("AAPL 190118P00160000");
ContractItem contract = ContractItem.BuildOptionContract("AAPL", "20211119", 150.0D, "CALL");
// 期货合约
// 环球账户
ContractItem contract = ContractItem.BuildFutureContract("CL", "USD", "SGX", "20190328", 1.0D);
// 综合账户
ContractItem contract = ContractItem.BuildFutureContract("CL2112", "USD");
市价单(MKT)
static async Task<PlaceOrderResponse?> PlaceMarketOrderAsync(TradeClient tradeClient)
{
ContractItem contract = ContractItem.BuildStockContract("01810", Currency.HKD.ToString());
TigerRequest<PlaceOrderResponse> request = new TigerRequest<PlaceOrderResponse>()
{
ApiMethodName = TradeApiService.PLACE_ORDER,
ModelValue = PlaceOrderModel.BuildMarketOrder(
"20200821144442583", // tradeClient.GetDefaultAccount,
contract,
ActionType.BUY,
200
)
};
return await tradeClient.ExecuteAsync(request);
}
限价单(LMT)
static async Task<PlaceOrderResponse?> PlaceLimitOrderAsync(TradeClient tradeClient)
{
ContractItem contract = ContractItem.BuildStockContract("AAPL", Currency.USD.ToString());
TigerRequest<PlaceOrderResponse> request = new TigerRequest<PlaceOrderResponse>()
{
ApiMethodName = TradeApiService.PLACE_ORDER,
ModelValue = PlaceOrderModel.BuildLimitOrder(
"20200821144442583", // tradeClient.GetDefaultAccount,
contract,
ActionType.BUY,
1, 120.0
)
};
// set user_mark
((PlaceOrderModel)request.ModelValue).UserMark = "test-lmt";
// set GTD order's expire_time
((PlaceOrderModel)request.ModelValue).TimeInForce = TimeInForce.GTD;
((PlaceOrderModel)request.ModelValue).ExpireTime = DateUtil.ConvertTimestamp("2023-03-08 23:59:59", SymbolUtil.getZoneIdBySymbol("AAPL", tradeClient.GetConfigTimeZone));
return await tradeClient.ExecuteAsync(request);
}
// place overnight order in the US market
static async Task<PlaceOrderResponse?> PlaceOvernightLimitOrderAsync(TradeClient tradeClient)
{
ContractItem contract = ContractItem.BuildStockContract("AAPL", Currency.USD.ToString());
TigerRequest<PlaceOrderResponse> request = new TigerRequest<PlaceOrderResponse>()
{
ApiMethodName = TradeApiService.PLACE_ORDER,
ModelValue = PlaceOrderModel.BuildLimitOrder(
"402901", // tradeClient.GetDefaultAccount,
contract,
ActionType.BUY,
1, 120.0
)
};
// set place overnight order in the US market
((PlaceOrderModel)request.ModelValue).TradingSessionType = TradeSession.OverNight;
return await tradeClient.ExecuteAsync(request);
}
竞价单(AM/AL)
static async Task<PlaceOrderResponse?> PlaceAuctionOrderAsync(TradeClient tradeClient)
{
ContractItem contract = ContractItem.BuildStockContract("00700", Currency.HKD.ToString());
TigerRequest<PlaceOrderResponse> request = new TigerRequest<PlaceOrderResponse>()
{
ApiMethodName = TradeApiService.PLACE_ORDER,
ModelValue = PlaceOrderModel.BuildAuctionOrder(
"20200821144442583", // tradeClient.GetDefaultAccount,
contract,
ActionType.BUY,
100,
350.0,
// 盘前竞价: AM or AL + OPG, 如果未成交参与盘中交易; 盘后竞价: AM or AL + DAY
OrderType.AL, // AL(auction limit order) or AM(auction market order)
TimeInForce.OPG // participate in the pre-market auction
)
};
return await tradeClient.ExecuteAsync(request);
}
止损单(STP)
static async Task<PlaceOrderResponse?> PlaceStopOrderAsync(TradeClient tradeClient)
{
ContractItem contract = ContractItem.BuildStockContract("01810", Currency.HKD.ToString());
TigerRequest<PlaceOrderResponse> request = new TigerRequest<PlaceOrderResponse>()
{
ApiMethodName = TradeApiService.PLACE_ORDER,
ModelValue = PlaceOrderModel.BuildStopOrder(
"20200821144442583", // tradeClient.GetDefaultAccount,
contract,
ActionType.SELL,
200, 10.0
)
};
return await tradeClient.ExecuteAsync(request);
}
止损限价单(STP_LMT)
static async Task<PlaceOrderResponse?> PlaceStopLimitOrderAsync(TradeClient tradeClient)
{
ContractItem contract = ContractItem.BuildStockContract("01810", Currency.HKD.ToString());
TigerRequest<PlaceOrderResponse> request = new TigerRequest<PlaceOrderResponse>()
{
ApiMethodName = TradeApiService.PLACE_ORDER,
ModelValue = PlaceOrderModel.BuildStopLimitOrder(
"20200821144442583", // tradeClient.GetDefaultAccount,
contract,
ActionType.SELL,
200, 10.0, 10.3
)
};
return await tradeClient.ExecuteAsync(request);
}
跟踪止损单(TRAIL)
static async Task<PlaceOrderResponse?> PlaceTrailOrderAsync(TradeClient tradeClient)
{
ContractItem contract = ContractItem.BuildStockContract("01810", Currency.HKD.ToString());
TigerRequest<PlaceOrderResponse> request = new TigerRequest<PlaceOrderResponse>()
{
ApiMethodName = TradeApiService.PLACE_ORDER,
ModelValue = PlaceOrderModel.BuildTrailOrder(
"20200821144442583", // tradeClient.GetDefaultAccount,
contract,
ActionType.SELL,
200, 10.0, 0 // use 'trailing_percent' = 10%
)
};
return await tradeClient.ExecuteAsync(request);
}
主订单+附加止盈单
static async Task<PlaceOrderResponse?> PlaceProfitTakerOrderAsync(TradeClient tradeClient)
{
ContractItem contract = ContractItem.BuildStockContract("01810", Currency.HKD.ToString());
TigerRequest<PlaceOrderResponse> request = new TigerRequest<PlaceOrderResponse>()
{
ApiMethodName = TradeApiService.PLACE_ORDER,
ModelValue = PlaceOrderModel.BuildLimitOrder(
"20200821144442583", // tradeClient.GetDefaultAccount,
contract,
ActionType.BUY,
200, 11.0
).addProfitTakerOrder(13.0, TimeInForce.DAY, true) // addProfitTakerOrder
};
return await tradeClient.ExecuteAsync(request);
}
主订单+附加止损单
static async Task<PlaceOrderResponse?> PlaceStopLossOrderAsync(TradeClient tradeClient)
{
ContractItem contract = ContractItem.BuildStockContract("01810", Currency.HKD.ToString());
TigerRequest<PlaceOrderResponse> request = new TigerRequest<PlaceOrderResponse>()
{
ApiMethodName = TradeApiService.PLACE_ORDER,
ModelValue = PlaceOrderModel.BuildLimitOrder(
"20200821144442583", // tradeClient.GetDefaultAccount,
contract,
ActionType.BUY,
200, 11.0
// addStopLossOrder(not support options)
).addStopLossOrder(10.0, TimeInForce.DAY)
// addStopLossLimitOrder, the first price-1.0 is the activation price, the second price-0.9 is the limit price(Only available for prime account)
// ).placeOrder.addStopLossLimitOrder(1.0, 0.9, TimeInForce.DAY)
};
// set other parameter
((PlaceOrderModel)request.ModelValue).UserMark = "test001";
return await tradeClient.ExecuteAsync(request);
}
主订单+附加跟踪止损单
static async Task<PlaceOrderResponse?> PlaceStopLossTrailOrderAsync(TradeClient tradeClient)
{
ContractItem contract = ContractItem.BuildStockContract("01810", Currency.HKD.ToString());
PlaceOrderModel placeOrder = PlaceOrderModel.BuildLimitOrder(
"20200821144442583", // tradeClient.GetDefaultAccount,
contract,
ActionType.BUY,
200, 11.0
);
// addStopLossTrailOrder ('stopLossTrailingPercent' = 10%)
placeOrder.addStopLossTrailOrder(10.0, 0, TimeInForce.DAY);
// set other parameter
placeOrder.UserMark = "test-attach-stoplosstrail";
TigerRequest<PlaceOrderResponse> request = new TigerRequest<PlaceOrderResponse>()
{
ApiMethodName = TradeApiService.PLACE_ORDER,
ModelValue = placeOrder
};
return await tradeClient.ExecuteAsync(request);
}
主订单+附加括号订单
static async Task<PlaceOrderResponse?> PlaceBracketsOrderAsync(TradeClient tradeClient)
{
ContractItem contract = ContractItem.BuildStockContract("01810", Currency.HKD.ToString());
PlaceOrderModel placeOrder = PlaceOrderModel.BuildLimitOrder(
"13810712",
contract,
ActionType.BUY,
200, 11.0
);
// addBracketsOrder
placeOrder.addBracketsOrder(13.0, TimeInForce.DAY, true, 10.0, TimeInForce.DAY);
TigerRequest<PlaceOrderResponse> request = new TigerRequest<PlaceOrderResponse>()
{
ApiMethodName = TradeApiService.PLACE_ORDER,
ModelValue = placeOrder
};
return await tradeClient.ExecuteAsync(request);
}
换汇单
static async Task<ForexTradeOrderResponse?> PlaceForexOrderAsync(TradeClient tradeClient)
{
TigerRequest<ForexTradeOrderResponse> request = new TigerRequest<ForexTradeOrderResponse>()
{
ApiMethodName = TradeApiService.PLACE_FOREX_ORDER,
ModelValue = new ForexTradeOrderModel()
{
Account = "20200821144442583",
SegType = SegmentType.SEC,
SourceCurrency = Currency.HKD,
SourceAmount = 10000.0,
TargetCurrency = Currency.USD,
TimeInForce = TimeInForce.DAY,
}
};
return await tradeClient.ExecuteAsync(request);
}
基金金额单
static async Task<PlaceOrderResponse?> PlaceFundOrderAsync(TradeClient tradeClient)
{
ContractItem contract = ContractItem.BuildFundContract("IE00B464Q616.USD", Currency.USD.ToString());
TigerRequest<PlaceOrderResponse> request = new TigerRequest<PlaceOrderResponse>()
{
ApiMethodName = TradeApiService.PLACE_ORDER,
ModelValue = PlaceOrderModel.BuildAmountOrder(
"13810712", // tradeClient.GetDefaultAccount,
contract,
ActionType.BUY,
180.0
)
};
return await tradeClient.ExecuteAsync(request);
}
TWAP/VWAP订单
只支持美股股票,只支持盘中下单。不能改单,可以撤单
static async Task<PlaceOrderResponse?> PlaceVWAPOrderAsync(TradeClient tradeClient)
{
// place VWAP order
PlaceOrderModel placeOrder = PlaceOrderModel.BuildVWAPOrder(
"13810712", "AAPL", ActionType.BUY, 1000,
DateUtil.ConvertTimestamp("2023-06-20 10:30:00", CustomTimeZone.NY_ZONE),
DateUtil.ConvertTimestamp("2023-06-20 12:30:00", CustomTimeZone.NY_ZONE),
0.5, 160.0);
TigerRequest<PlaceOrderResponse> request = new TigerRequest<PlaceOrderResponse>()
{
ApiMethodName = TradeApiService.PLACE_ORDER,
ModelValue = placeOrder
};
return await tradeClient.ExecuteAsync(request);
}
static async Task<PlaceOrderResponse?> PlaceTWAPOrderAsync(TradeClient tradeClient)
{
// place TWAP order
PlaceOrderModel placeOrder = PlaceOrderModel.BuildTWAPOrder(
"13810712", "AAPL", ActionType.BUY, 1000,
DateUtil.ConvertTimestamp("2023-06-20 10:30:00", CustomTimeZone.NY_ZONE),
DateUtil.ConvertTimestamp("2023-06-20 12:30:00", CustomTimeZone.NY_ZONE),
160.0);
TigerRequest<PlaceOrderResponse> request = new TigerRequest<PlaceOrderResponse>()
{
ApiMethodName = TradeApiService.PLACE_ORDER,
ModelValue = placeOrder
};
return await tradeClient.ExecuteAsync(request);
}
期权多腿订单
只支持盘中下单
static async Task<PlaceOrderResponse?> PlaceMultiLegOrderAsync(TradeClient tradeClient)
{
// place option multi-leg order
ContractLeg leg1 = new ContractLeg()
{
SecType = SecType.OPT.ToString(),
Symbol = "AAPL",
Strike = "175.0",
Expiry = "20231013",
Right = Right.CALL.ToString(),
Action = ActionType.BUY.ToString(),
Ratio = 1
};
ContractLeg leg2 = new ContractLeg()
{
SecType = SecType.OPT.ToString(),
Symbol = "AAPL",
Strike = "180.0",
Expiry = "20231013",
Right = Right.CALL.ToString(),
Action = ActionType.SELL.ToString(),
Ratio = 1
};
List<ContractLeg> legs = new List<ContractLeg>() { leg1, leg2 };
PlaceOrderModel placeOrder = PlaceOrderModel.BuildMultiLegOrder(
"13810712", legs, ComboType.VERTICAL, ActionType.BUY, 1,
OrderType.LMT, 0.6, null, null);
TigerRequest<PlaceOrderResponse> request = new TigerRequest<PlaceOrderResponse>()
{
ApiMethodName = TradeApiService.PLACE_ORDER,
ModelValue = placeOrder
};
return await tradeClient.ExecuteAsync(request);
}
OCA括号单
OCA括号订单内的两个订单标的相同,一个止盈限价单,另一个为止损单或者止损限价单。其中一个成交时,自动取消另一个订单。下单后返回两个order对象,订单中的'ocaGroupId'相同的为一个组合。 不支持模拟盘
static async Task<PlaceOrderResponse?> PlaceOCABracketsOrderAsync(TradeClient tradeClient)
{
// place OCA Brackets order
ContractItem contract = ContractItem.BuildStockContract("BILI", Currency.USD.ToString());
PlaceOrderModel placeOrder = PlaceOrderModel.BuildOCABracketsOrder(
"13810712", contract, ActionType.SELL, 1,
17.0, TimeInForce.DAY, true,
12.0, TimeInForce.DAY, false);
placeOrder.Lang = Language.en_US;
placeOrder.UserMark = "test-oca";
TigerRequest<PlaceOrderResponse> request = new TigerRequest<PlaceOrderResponse>()
{
ApiMethodName = TradeApiService.PLACE_ORDER,
ModelValue = placeOrder
};
return await tradeClient.ExecuteAsync(request);
}
返回示例 附加括号单
{
"id":30325712346546176,
"orderId":0,
"subIds":[
30325712346546177,
30325712346677250
],
"orders":[
{
"account":"13810712",
"action":"BUY",
"algoStrategy":"LMT",
"attrDesc":"",
"avgFillPrice":0,
"canCancel":true,
"canModify":true,
"commission":0,
"currency":"HKD",
"discount":0,
"filledQuantity":0,
"id":30325712346546176,
"identifier":"00700",
"latestPrice":385.8,
"latestTime":1680266023000,
"limitPrice":295,
"liquidation":false,
"market":"HK",
"name":"腾讯控股",
"openTime":1680266023000,
"orderId":91,
"orderType":"LMT",
"outsideRth":true,
"realizedPnl":0,
"remark":"",
"secType":"STK",
"source":"OpenApi",
"status":"Initial",
"symbol":"00700",
"timeInForce":"DAY",
"totalQuantity":100,
"updateTime":1680266023000,
"userMark":"test_bracket"
},
{
"account":"13810712",
"action":"SELL",
"algoStrategy":"LMT",
"attrDesc":"",
"avgFillPrice":0,
"canCancel":true,
"canModify":true,
"commission":0,
"currency":"HKD",
"discount":0,
"filledQuantity":0,
"id":30325712346546177,
"identifier":"00700",
"latestPrice":385.8,
"latestTime":1680266023000,
"limitPrice":320,
"liquidation":false,
"market":"HK",
"name":"腾讯控股",
"ocaGroupId":87055,
"openTime":1680266023000,
"orderId":92,
"orderType":"LMT",
"outsideRth":true,
"parentId":30325712346546176,
"realizedPnl":0,
"remark":"",
"secType":"STK",
"source":"OpenApi",
"status":"Initial",
"symbol":"00700",
"timeInForce":"DAY",
"totalQuantity":100,
"updateTime":1680266023000,
"userMark":"test_bracket"
},
{
"account":"13810712",
"action":"SELL",
"algoStrategy":"STP_LMT",
"attrDesc":"",
"auxPrice":280,
"avgFillPrice":0,
"canCancel":true,
"canModify":true,
"commission":0,
"currency":"HKD",
"discount":0,
"filledQuantity":0,
"id":30325712346677248,
"identifier":"00700",
"latestPrice":385.8,
"latestTime":1680266023000,
"limitPrice":278,
"liquidation":false,
"market":"HK",
"name":"腾讯控股",
"ocaGroupId":87055,
"openTime":1680266023000,
"orderId":93,
"orderType":"STP_LMT",
"outsideRth":true,
"parentId":30325712346546176,
"realizedPnl":0,
"remark":"",
"secType":"STK",
"source":"OpenApi",
"status":"Initial",
"symbol":"00700",
"timeInForce":"DAY",
"totalQuantity":100,
"updateTime":1680266023000,
"userMark":"test_bracket"
}
]
}