Single Condition with TP & SL
single_condition
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 |
Condition Object | Condition Object | 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 |
Request Example
# Condition COntent
condition = Condition(
market_type = TradingType.Reference,
symbol = "TXO20000E4",
trigger = TriggerContent.MatchedPrice,
trigger_value = "100",
comparison = Operator.LessThan
)
order = FutOptConditionOrder(
buy_sell = BSAction.Buy,
symbol = "TXO20000E4",
price = "100",
lot = 1,
market_type = FutOptConditionMarketType.Option,
price_type = FutOptConditionPriceType.Limit,
time_in_force = TimeInForce.ROD,
order_type = FutOptConditionOrderType.New
)
tp = FutOptTPSLOrder(
time_in_force=TimeInForce.ROD,
price_type=FutOptConditionPriceType.Limit,
order_type=FutOptConditionOrderType.Close,
target_price="120",
price="120"
)
sl = FutOptTPSLOrder(
time_in_force=TimeInForce.ROD,
price_type=FutOptConditionPriceType.Limit,
order_type=FutOptConditionOrderType.Close,
target_price="60",
price="60"
)
tpsl = FutOptTPSLWrapper(
stop_sign= StopSign.Full,
tp=tp, # optional field
sl=sl, # optional field
end_date="20240517" # optional field
)
sdk.futopt.single_condition(account, "20240426", "20240430", StopSign.Full, condition, order, tpsl)
Response Example
Result {
is_success: True,
message: None,
data : ConditionOrderResult {
guid : "44150047-8977-40b1-953c-ce2XXXXXX"
}
}