A single conditional order includes stop loss and profit stop
SingleCondition
Notes on stop loss and profit
- The stop loss and profit setting is only to trigger the order, and does not guarantee that the transaction will be completed. It needs to be adjusted according to the market conditions.
- Please confirm that the stop loss and profit order type setting must comply with the appropriate trading rules (such as credit trading, asset buying and selling, etc.)
info
The stop loss and stop profit part will not be activated until the main order is fully executed.
Input parameters
| Parameters | Category | Description |
|---|---|---|
| account | Account | account |
| start_date | string | Conditional start monitoring time |
| end_date | string | Condition end monitoring time |
| stop_sign | StopSign | Conditional stop conditions: Full until all transactions are completed, Partial until partial transactions are completed, UntilEnd until the validity period ends |
| condition | Condition | Trigger condition |
| ConditionOrder Object | ConditionOrder Object | Order details |
| TPSLObject | TpslWrapper | Stop loss and stop profit conditions |
Result return
| Parameters | Category | Description |
|---|---|---|
| isSuccess | bool | Whether it was successful |
| data | Object | Conditional order return information |
| message | string ? (optional) | Return error message when isSuccess = false |
Order information ConditionOrderResult field
Return type : Object
| Parameters | Category | Description |
|---|---|---|
| guid | string | condition order number |
Request example
//Design condition content
var condition = new Condition(
TradingType.Reference,
"2881",
TriggerContent.MatchedPrice,
"66",
Operator.LessThan
);
var order = new ConditionOrder(
BsAction.Buy,
"2881",
"66",
2000,
ConditionMarketType.Common,
ConditionPriceType.Limit,
TimeInForce.Rod,
ConditionOrderType.Stock
);
// If the stop loss and stop profit is Market, price, fill in the blank value ""
var tp = new TpslOrder(
TimeInForce.Rod,
ConditionPriceType.Limit,
ConditionOrderType.Stock,
"85",
"85",
null // Used in versions 2.2.0 and later, please see [Parameter Comparison Table] -> [TpslOrder Object] for details
);
var sl = new TpslOrder(
TimeInForce.Rod,
ConditionPriceType.Limit,
ConditionOrderType.Stock,
"60",
"60",
null // Used in versions 2.2.0 and later, please see [Parameter Comparison Table] -> [TpslOrder Object] for details
);
var tpsl = new TpslWrapper(
StopSign.Full,
tp,
sl,
"20240517",
false
);
sdk.Stock.SingleCondition(account, "20240426", "20240430", StopSign.Full, condition, order, tpsl)
Return example
{
isSuccess = True,
message = ,
data = ConditionOrderResult {
guid = 44150047-8977-40b1-953c-ce2XXXXXX,
}
}