Skip to main content

Trailing-profit conditional order

TrailProfit

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 end of the validity period
TrailOrderTrailOrderOrder splitting conditions
caution

The base price (price) in TrailOrder can only be entered to two decimal places. If it exceeds the price, the system will fail to validate the price.

info

When the current stock price reaches the trigger price (the percentage increase or decrease calculated based on the base price), place an order immediately

Example: If the initial base price is set to 100, and a stop loss/profit order is placed 5% lower, the initial trigger price is 95. If the price does not rise above 100 (that is, the base price is not adjusted), the order will be triggered when the market price is 95.

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 trail = new TrailOrder(
"2330",
"860",
Direction.Up ,
5, // % increase or decrease
BsAction.Buy,
2000,
ConditionPriceType.MatchedPrice,
5, // The number of ticks to buy upward or downward (negative value when downward)
TimeInForce.Rod,
ConditionOrderType.Stock
);


sdk.Stock.TrailProfit(target_account, "20240427","20240516", StopSign.Full, trail);

Return example


{
isSuccess = True,
message = ,
data = ConditionOrderResult {
guid = 44150047-8977-40b1-953c-ce2XXXXXX,
}
}