Multi-Condition with TP & SL
multiCondition
info
TP & SL will be activated after the master order has been fully filled.
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 |
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
const condition = {
marketType: TradingType.Reference,
symbol: "2881",
trigger: TriggerContent.MatchedPrice,
triggerValue: "80",
comparison: Operator.LessThan
}
const condition2 = {
marketType: TradingType.Reference,
symbol: "2881",
trigger: TriggerContent.TotalQuantity,
triggerValue: "8000",
comparison: Operator.GreaterThan
}
const order = {
buySell: BSAction.Buy,
symbol: "2881",
price: "66",
quantity: 2000,
marketType: ConditionMarketType.Common,
priceType: ConditionPriceType.Limit,
timeInForce: TimeInForce.ROD,
orderType: ConditionOrderType.Stock
};
const tp = {
timeInForce: TimeInForce.ROD,
priceType: ConditionPriceType.Limit,
orderType: ConditionOrderType.Close,
targetPrice: "120",
price: "120",
// trigger: TriggerContent.MatchPrice // Added since v2.2.0
}
const sl = {
timeInForce: TimeInForce.ROD,
priceType: ConditionPriceType.Limit,
orderType: ConditionOrderType.Close,
targetPrice: "60",
price: "60",
// trigger: TriggerContent.MatchPrice // Added since v2.2.0
}
const tpsl = {
stopSign: StopSign.Full,
tp: tp, // optional field
sl: sl, // optional field
endDate: "20240517", // optional field
intraday: false // optional field
}
sdk.stock.multiCondition(account, "20240426", "20240430", StopSign.Full, [condition,condition2], order, tpsl)