Skip to main content

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

ParametersCategoryDescription
accountAccountaccount
stopSignStopSignConditional stop conditions: Full until all transactions are completed, Partial until partial transactions are completed, UntilEnd until the end of the validity period
endTimestringParent order price validation end time
conditionConditionTrigger condition
orderObjectConditionOrder ObjectOrder details
ConditionDayTrade ObjectConditionDayTradeContent to be filled when the trade ends
TPSLObjectTPSLWrapperStop loss and stop profit conditions
fixSessionboolExecute fixing cover

Result return

ParametersCategoryDescription
isSuccessboolWhether it was successful
dataObjectConditional order return information
messagestring ? (optional)Return error message when isSuccess = false

Order information ConditionOrderResult field

Return type : Object

ParametersCategoryDescription
guidstringcondition 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,
}
}