Bet on a single conditional order
SingleConditionDayTrade
Notes on stop loss and profit
- The stop loss and profit setting is only for triggering orders. There is no guarantee that the cover will be successful. It needs to be adjusted according to the market conditions.
- Please confirm that the Stop Loss Profit Order Category setting must comply with the day's offsetting transaction rules (for example, credit transactions use mutual offset of securities)
Conditional order query
- To use guid to query the current trading condition order, please use the current trading condition order query function
Input parameters
| Parameters | Category | Description |
|---|---|---|
| account | Account | account |
| stopSign | StopSign | Conditional stop conditions: Full until all transactions are completed, Partial until partial transactions are completed, UntilEnd until the end of the validity period |
| endTime | string | Parent order price validation end time |
| condition | Condition | Trigger condition |
| orderObject | ConditionOrder Object | Order details |
| ConditionDayTrade Object | ConditionDayTrade | Content to be filled when the trade ends |
| TPSLObject | TPSLWrapper | Stop loss and stop profit conditions |
| fixSession | bool | Execute fixing cover |
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
);
var daytrade_obj = new ConditionDayTrade(
"131000", // Offsetting time before closing, the settable range is 130100 ~ 132000
true,
"",
ConditionPriceType.Market
);
var tp = new TpslOrder(
TimeInForce.Rod,
ConditionPriceType.Limit,
ConditionOrderType.Stock,
"85",
"85",
null
);
var sl = new TpslOrder(
TimeInForce.Rod,
ConditionPriceType.Limit,
ConditionOrderType.Stock,
"60",
"60",
null
);
var tpsl = new TpslWrapper(
StopSign.Full,
tp,
sl,
"20240517",
true // **Set true to enable intraday washout
);
sdk.Stock.SingleConditionDayTrade(account, StopSign.Full, "130000", condition, order, daytrade_obj, tpsl, true);
// Do not set stop loss and profit stop
//sdk.Stock.SingleConditionDayTrade(account, StopSign.Full, "130000", condition, order, daytrade_obj, null, true);
// Do not set fixed order compensation
//sdk.Stock.SingleConditionDayTrade(account, StopSign.Full, "130000", condition, order, daytrade_obj, tpsl, false);
Return example
{
isSuccess = True,
message = ,
data = ConditionOrderResult {
guid = 44150047-8977-40b1-953c-ce2XXXXXX,
}
}