Skip to main content

Day Trading Single Conditional Order

singleConditionDayTrade

Take-Profit/Stop-LossNotes
  • Take-Profit/Stop-LossSetistrigger order submission,does not guarantee successful offsetting,adjust as market conditions require
  • Confirm thatTake-Profit/Stop-LossOrder typeSetmustwhendaythen(Examplesuch as margin/short offsetting for credit trades)
Day Trading Conditional Order Query
  • guid QueryDay Trading Conditional OrdersDay Trading Conditional Order Query

Input Parameters

ParameterTypeDescription
accountAccountAccount
stopSignStopSignCondition stop condition : Full Until fully filled、PartialUntil partially filled、UntilEndUntil expiry
endTimestringparentorderspriceEnd time
conditionConditionTrigger condition
orderObjectConditionOrder ObjectOrder Details
ConditionDayTrade ObjectConditionDayTradeDay-trading offset details
TPSLObjectTPSLWrapperTake-Profit/Stop-Loss
fixSessionboolExecute fixing offset

Result

ParameterTypeDescription
isSuccessboolWhether successful
dataObjectConditional order response information
messagestring ? (optional)When isSuccess = false Returns an error message

Order Information ConditionOrderResult Fields

Return type : Object

ParameterTypeDescription
guidstringConditional Order ID

Request Example

// Define the condition
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", // Pre-close offset time,The allowed range is 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,
targetPrice: "60",
price: "60",
}

const tpsl = {
stopSign: StopSign.Full,
endDate: "20240517",
tp: tp,
sl: sl,
intraday: true // ** Set true withsame-day offset price refreshing
}


sdk.stock.singleConditionDayTrade(account, StopSign.Full, "130000", condition, order, daytrade_obj, tpsl, true)

// SetTake-Profit/Stop-Loss
// sdk.stock.singleConditionDayTrade(account, StopSign.Full, "130000", condition, order, daytrade_obj, null, true)

// SetFixing
// sdk.stock.singleConditionDayTrade(account, StopSign.Full, "130000", condition, order, daytrade_obj, null, false)

Response Example


{
isSuccess: true,
data : {
guid : "44150047-8977-40b1-953c-ce2XXXXXX"
}
}