Skip to main content

Single Condition with TP & SL

SingleCondition

Request Parameter

ParameterTypeMeaning
accountAccountAccount
start_datestringCondition Start Date
end_datestringCondition End Date
stop_signStopSignStop Condition : Full Until Fully filled、Partial Once Filled happened 、 UntilEnd Until Expiry
ConditionConditionList of Condition Content
OrderObjectOrderObjectOrder Object

Result Response

ParameterTypeMeaning
isSuccessboolInterface result
dataObjectConditionOrderResult is returned
messagestring ? (optional)isSuccess = false error description is returned

ConditionOrderResult Parameter

Return type : Object

ParameterTypeMeaning
guidstringCondition Serial Number

Request Example

// 設計條件內容
var condition = new Condition(
TradingType.Reference,
"TXO20000E4",
TriggerContent.MatchedPrice,
"100",
Operator.LessThan
);

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.SingleCondition(account, "20240426", "20240430", StopSign.Full, condition, order, tpsl);

Response Example


{
isSuccess = True,
message = ,
data = ConditionOrderResult {
guid = 44150047-8977-40b1-953c-ce2XXXXXX
}
}