Single Condition with TP & SL
singleCondition
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 |
| 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 |
| OrderObject | OrderObject | Order Object |
| TPSL | FutOptTPSLWrapper | TPSL Order 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: "TXO20000E4",
trigger: TriggerContent.MatchedPrice,
triggerValue: "100",
comparison: Operator.LessThan
}
const order = {
buySell: BSAction.Buy,
symbol: "TXO20000E4",
price: "100",
lot: 1,
marketType: FutOptConditionMarketType.Option,
priceType: FutOptConditionPriceType.Limit,
timeInForce: TimeInForce.ROD,
orderType: FutOptConditionOrderType.New
};
const tp = {
timeInForce: TimeInForce.ROD,
priceType: FutOptConditionPriceType.Limit,
orderType: FutOptConditionOrderType.Close,
targetPrice: "120",
price: "120"
}
const sl = {
timeInForce: TimeInForce.ROD,
priceType: FutOptConditionPriceType.Limit,
orderType: FutOptConditionOrderType.Close,
targetPrice: "60",
price: "60"
}
const tpsl = {
stopSign: StopSign.Full,
tp: tp, // optional field
sl: sl, // optional field
endDate: "20240517" // optional field
}
sdk.futopt.singleCondition(account, "20240426", "20240430", StopSign.Full, condition, order, tpsl)
Response Example
{
isSuccess: true,
data : {
guid : "44150047-8977-40b1-953c-ce2XXXXXX"
}
}