Trailing-profit conditional order
TrailProfit
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 end of the validity period |
| TrailOrder | TrailOrder | Order 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
| 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 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,
}
}