Multi-Condition with TP & SL
MultiCondition
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.
info
TP & SL will be activated after the master order has been fully filled.
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 |
| reply_code | string | Status Code |
| advisory | string | Return Content |
Request Example
var condition1 = new Condition(
TradingType.Reference,
"2881",
TriggerContent.MatchedPrice,
"66",
Operator.LessThan
);
var condition2 = new Condition(
TradingType.Reference,
"2881",
TriggerContent.TotalQuantity,
"8000",
Operator.LessThan
);
List<Condition> conditions = new List<Condition>();
conditions.Add(condition1);
conditions.Add(condition2);
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.MultiCondition(account, "20240426", "20240430", StopSign.Full, conditions, order, tpsl);
Response Example
{
isSuccess = True,
message = ,
data = ConditionOrderResult {
guid = 44150047-8977-40b1-953c-ce2XXXXXX
}
}