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
| Parameter | Type | Description |
|---|---|---|
| account | Account | Account |
| stopSign | StopSign | Condition stop condition : Full Until fully filled、PartialUntil partially filled、UntilEndUntil expiry |
| endTime | string | parentorderspriceEnd time |
| condition | Condition | Trigger condition |
| orderObject | ConditionOrder Object | Order Details |
| ConditionDayTrade Object | ConditionDayTrade | Day-trading offset details |
| TPSLObject | TPSLWrapper | Take-Profit/Stop-Loss |
| fixSession | bool | Execute fixing offset |
Result
| Parameter | Type | Description |
|---|---|---|
| isSuccess | bool | Whether successful |
| data | Object | Conditional order response information |
| message | string ? (optional) | When isSuccess = false Returns an error message |
Order Information ConditionOrderResult Fields
Return type : Object
| Parameter | Type | Description |
|---|---|---|
| guid | string | Conditional 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"
}
}