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 | 
| condition object | Condition | List of Condition Content | 
| orderObject | 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 | 
Requst Example
// Condition Content
const condition = {
    marketType: TradingType.Reference,
    symbol: "2881",
    trigger: TriggerContent.MatchedPrice,
    triggerValue: "80",
    comparison: Operator.LessThan
}
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.Stock,
    targetPrice: "85",
    price: "85",
    // trigger: TriggerContent.MatchPrice  // Added since v2.2.0
}
const sl  = {
    timeInForce: TimeInForce.ROD,
    priceType: ConditionPriceType.Limit,
    orderType: ConditionOrderType.Stock,
    target_price: "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.singleCondition(account, "20240426", "20240430", StopSign.Full, condition, order, tpsl)
Response Example
{
    isSuccess: true,
    data : {
            guid : "44150047-8977-40b1-953c-ce2XXXXXX"
    }
}