Single Conditional Order
single_condition
Input Parameters
| Parameter | Type | Description |
|---|---|---|
| account | Account | Account |
| start_date | string | Condition monitoring start time |
| end_date | string | Condition monitoring end time |
| stop_sign | StopSign | Condition stop condition : Full Until fully filled、PartialUntil partially filled、UntilEndUntil expiry |
| condition | Condition | Trigger condition |
| ConditionOrder Object | ConditionOrder Object | Order Details |
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
condition = Condition(
market_type = TradingType.Reference,
symbol = "2881",
trigger = TriggerContent.MatchedPrice,
trigger_value = "80",
comparison = Operator.LessThan
)
order = ConditionOrder(
buy_sell= BSAction.Sell,
symbol = "2881",
quantity = 1000,
price = "60",
market_type = ConditionMarketType.Common,
price_type = ConditionPriceType.Limit,
time_in_force = TimeInForce.ROD,
order_type = ConditionOrderType.Stock
)
res = sdk.stock.single_condition(account, "20240427","20240516", StopSign.Full , condition, order)
Response Example
Result {
is_success: True,
message: None,
data : ConditionOrderResult {
guid : "44150047-8977-40b1-953c-ce270f36150"
}
}