Single Condition with DayTrade
singleConditionDayTrade
Stop-loss Take Precautions
- The stop-loss take pre-order setting is only a trigger for the order and does not guarantee a successful cover. It must be adjusted based on market conditions.
 - Please ensure that the stop-loss take pre-order order type setting complies with day trading rules.
 
Day Trading Order Query
- To query day trading orders using a GUID, please use the Day Trading Order Query function.
 
Request Parameter
| Parameter | Type | Meaning | 
|---|---|---|
| account | Account | Account | 
| stopSign | StopSign | Stop Condition : Full Until Fully filled、Partial Once Filled happened 、 UntilEnd Until Expiry | 
| endTime | string | End time of parent order | 
| condition | Condition | Condition Content | 
| ConditionDayTrade Object | ConditionDayTrade | DayTrade Content | 
| orderObject | ConditionOrder Object | ConditionOrder Object | 
| TPSL | TPSLWrapper | TPSL ConditionOrder Object | 
| fixSession | bool | Fix Session Covering | 
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 daytrade_obj = {
    dayTradeEndTime : "131000", // Position covering time, valid range between 130100 ~ 132000
    autoCancel : true,        
    price : "",
    priceType : ConditionPriceType.Market 
}
const tp = {
    timeInForce: TimeInForce.ROD,
    priceType: ConditionPriceType.Limit,
    orderType: ConditionOrderType.Stock,
    targetPrice: "85",
    price: "85",
}
const sl  = {
    timeInForce: TimeInForce.ROD,
    priceType: ConditionPriceType.Limit,
    orderType: ConditionOrderType.Stock,
    target_price: "60",
    price: "60",
}
const tpsl = {
    stopSign: StopSign.Full,
    endDate: "20240517", 
    tp: tp,           
    sl: sl,           
    intraday: true  // ** Must set true to enable daytrade
}
sdk.stock.singleConditionDayTrade(account, StopSign.Full, "130000", condition, order, daytrade_obj, tpsl, true)
// Not Setting TPSL
// sdk.stock.singleConditionDayTrade(account, StopSign.Full, "130000", condition, order, daytrade_obj, null, true)
// Not Setting Fix Session Covering
// sdk.stock.singleConditionDayTrade(account, StopSign.Full, "130000", condition, order, daytrade_obj, null, false)
Response Example
{
    isSuccess: true,
    data : {
            guid : "44150047-8977-40b1-953c-ce2XXXXXX"
    }
}