Skip to main content

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

ParametersCategoryDescription
accountAccountaccount
start_datestringConditional start monitoring time
end_datestringCondition end monitoring time
stop_signStopSignConditional stop conditions: Full until all transactions are completed, Partial until partial transactions are completed, UntilEnd until the validity period ends
conditionConditionTrigger condition
ConditionOrder ObjectConditionOrder ObjectOrder details
TPSLObjectTpslWrapperStop loss and stop profit conditions

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
);

// 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,
}
}