Skip to main content

Single-Condition Order with Take-Profit/Stop-Loss

SingleCondition

Take-profit/stop-loss precautions
  • A take-profit or stop-loss setting only triggers order submission; it does not guarantee a fill. Adjust it as appropriate for market conditions.
  • Make sure the take-profit/stop-loss order type complies with the applicable trading rules.

Request Parameters

ParameterTypeDescription
accountAccountAccount
start_datestringCondition monitoring start time
end_datestringCondition monitoring end time
stop_signStopSignStop condition: Full until fully filled, Partial until partially filled, or UntilEnd until the validity period ends
conditionConditionTrigger condition
OrderObjectOrderObjectOrder details
TPSLObjectFutOptTpslWrapperTake-profit/stop-loss condition

Result

ParameterTypeDescription
isSuccessboolWhether the request succeeded
dataObjectCondition-order result
messagestring ? (optional)Error message returned when isSuccess = false

ConditionOrderResult Fields

Return type: Object

ParameterTypeDescription
guidstringCondition-order ID

Request Example

// Define the condition
var condition = new Condition(
TradingType.Reference,
"TXO20000E4",
TriggerContent.MatchedPrice,
"100",
Operator.LessThan
);

var order = new FutOptConditionOrder(
BsAction.Buy,
"TXO20000E4",
"100",
1,
FutOptConditionMarketType.Option,
FutOptConditionPriceType.Limit,
TimeInForce.Rod,
FutOptConditionOrderType.New
);
var tp = new FutOptTpslOrder(
TimeInForce.Rod,
FutOptConditionPriceType.Limit,
FutOptConditionOrderType.Close,
"120",
"120",
null // Added in v2.2.0; currently reserved with no associated behavior
);

var sl = new FutOptTpslOrder(
TimeInForce.Rod,
FutOptConditionPriceType.Limit,
FutOptConditionOrderType.Close,
"85",
"85",
null // Added in v2.2.0; currently reserved with no associated behavior
);

var tpsl = new FutOptTpslWrapper(
StopSign.Full,
tp,
sl,
"20240517",
false
);


sdk.FutOpt.SingleCondition(account, "20240426", "20240430", StopSign.Full, condition, order, tpsl);

Response Example


{
isSuccess = True,
message = ,
data = ConditionOrderResult {
guid = 44150047-8977-40b1-953c-ce2XXXXXX,
}
}