Multi-Condition with TP & SL
MultiCondition
Request Parameter
Parameter | Type | Meaning |
---|---|---|
account | Account | Account |
start_date | string | Condition Start Date |
end_date | string | Condition End Date |
stop_sign | StopSign | Stop Condition : Full Until Fully filled、Partial Once Filled happened 、 UntilEnd Until Expiry |
MultiCondition | Condition List | List of Condition Content |
OrderObject | OrderObject | Order Object |
Result Response
Parameter | Type | Meaning |
---|---|---|
isSuccess | bool | Interface result |
data | Object | ConditionOrderResult is returned |
message | string ? (optional) | isSuccess = false error description is returned |
ConditionOrderResult Parameter
Return type : Object
Parameter | Type | Meaning |
---|---|---|
guid | string | Condition Serial Number |
reply_code | string | Status Code |
advisory | string | Return Content |
Request Example
// 設計條件內容
var condition1 = new Condition(
TradingType.Reference,
"TXO20000E4",
TriggerContent.MatchedPrice,
"100",
Operator.LessThan
);
var condition2 = new Condition(
TradingType.Reference,
"TXO20000E4",
TriggerContent.TotalQuantity,
"30",
Operator.LessThan
);
List<Condition> conditions = new List<Condition>();
conditions.Add(condition1);
conditions.Add(condition2);
var order = new FutOptConditionOrder(
BsAction.Buy,
"TXO20000E4",
"100",
1,
FutOptConditionMarketType.Option,
FutOptConditionPriceType.Limit,
TimeInForce.Rod,
FutOptConditionOrderType.New
);
var tp = new FutOptTpslOrder(
TimeInForce.Rod,
FutOptConditionPriceType.Limit,
FutOptConditionOrderType.Close,
"120",
"120",
null // For version >= 2.2.0, no actual function yet
);
var sl = new FutOptTpslOrder(
TimeInForce.Rod,
FutOptConditionPriceType.Limit,
FutOptConditionOrderType.Close,
"85",
"85",
null // For version >= 2.2.0, no actual function yet
);
var tpsl = new FutOptTpslWrapper(
StopSign.Full,
tp,
sl,
"20240517",
false
);
sdk.FutOpt.MultiCondition(account, "20240426", "20240430", StopSign.Full, conditions, order, tpsl);
Response Example
{
isSuccess = True,
message = ,
data = ConditionOrderResult {
guid = 44150047-8977-40b1-953c-ce2XXXXXX
}
}