Trail Profit Condition
trail_profit
Request Parameter
Parameter | Type | Meaning |
---|---|---|
account | Account | Account |
start_date | string | Condition Start Date |
end_date | string | Condition End Date |
stop_sign | StopSign | Stop Condition : Full Until Fully filled、Partial Once Filled happened 、 UntilEnd Until Expiry |
TrailOrder | Trail Order | Trail Order Condition |
caution
The activate price in TrailOrder can only take up to two decimal places, otherwise it will fail to be activated.
info
The order will be placed when the current price hit the trigger price (the activate price up/down to the setting percentage)
Example. If the activate price is set to 100, and the stop loss/gain condiition is set as 5% down, so the initial trigger price is 95. Assuming that the price never go above 100 (so that the activate price does not move upward), then the stop loss/gain order will be placed when the market price hit 95.
Result Response
Parameter | Type | Meaning |
---|---|---|
isSuccess | bool | Interface result |
data | Object | ConditionOrderResult is returned |
message | string ? (optional) | isSuccess = false error description is returned |
ConditionOrderResult Parameter
Return type : Object
Parameter | Type | Meaning |
---|---|---|
guid | string | Condition Serial Number |
Request Example
# Condition Content
trail = TrailOrder(
symbol ="2330",
baseprice = "860",
direction = Direction.Up,
percentage = 5, # Up or Down Percent
buy_sell = BSAction.Buy,
quantity = 2000,
price_type = ConditionPriceType.MatchedPrice,
diff = 5, # base price ticker (negative represent down)
time_in_force = TimeInForce.ROD,
order_type = ConditionOrderType.Stock,
)
sdk.stock.trail_profit(target_account, "20240427","20240516", StopSign.Full, trail)
Response Example
{
is_success : True,
message : None,
data : ConditionOrderResult {
guid : 44150047-8977-40b1-953c-ce2XXXXXX
}
}