Single Condition with TP & SL
SingleCondition
info
TP & SL will be activated after the master order has been fully filled.
Stop-loss precautions
- The stop-loss setting is only a trigger for placing an order and does not guarantee a transaction. It is subject to adjustment based on market conditions.
 - Please ensure that the stop-loss order type setting complies with applicable trading rules.
 
Request Parameter
| Parameter | Type | Meaning | 
|---|---|---|
| account | Account | Account | 
| startDate | string | Condition Start Date | 
| endDate | string | Condition End Date | 
| stopSign | StopSign | Stop Condition : Full Until Fully filled、Partial Once Filled happened 、 UntilEnd Until Expiry | 
| MultiCondition | Condition List | List of Condition Content | 
| ConditionOrder Object | ConditionOrder Object | ConditionOrder Object | 
| TPSL | TPSLWrapper | TPSL ConditionOrder 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 | 
Request Example
// 設計條件內容
var condition = new Condition(
    TradingType.Reference,
    "2881",
    TriggerContent.MatchedPrice,
    "66",
    Operator.LessThan
);
var order = new ConditionOrder(
    BsAction.Buy,
    "2881",
    "66",
    2000,
    ConditionMarketType.Common,
    ConditionPriceType.Limit,
    TimeInForce.Rod,
    ConditionOrderType.Stock
);
var tp = new TpslOrder(
    TimeInForce.Rod,
    ConditionPriceType.Limit,
    ConditionOrderType.Stock,
    "85",
    "85",
    null  // For version >= 2.2.0, detail refer to [List of Enumerations] -> [TpslOrder Object]
);
var sl = new TpslOrder(
    TimeInForce.Rod,
    ConditionPriceType.Limit,
    ConditionOrderType.Stock,
    "60",
    "60",
    null  // For version >= 2.2.0, detail refer to [List of Enumerations] -> [TpslOrder Object]
);
var tpsl = new TpslWrapper(
    StopSign.Full,
    tp,
    sl,
    "20240517",
    false
);
sdk.Stock.SingleCondition(account, "20240426", "20240430", StopSign.Full, condition, order, tpsl);
Response Example
{
    isSuccess = True,
    message = ,
    data = ConditionOrderResult {
            guid = 44150047-8977-40b1-953c-ce2XXXXXX
        }
}