Skip to main content

Trailing-Profit Condition Orders

Fubon Neo API supports trailing-profit orders.

Trailing-profit mechanism: after the activation condition is met, the order does not trigger until the configured pullback is reached. If the stock price continues to rise, the new price becomes the reference. The order is submitted when the price then pulls back by the configured amount.

trailProfit

Code Examples

# Define the condition
trail = TrailOrder(
symbol = "2330",
price = "1000",
direction = Direction.Down ,
percentage = 5, # percentage increase/decrease
buy_sell = BSAction.Sell,
quantity = 2000,
price_type = ConditionPriceType.MatchedPrice,
diff = 1, # number of ticks to chase up or down (negative when chasing down)
time_in_force = TimeInForce.ROD,
order_type = ConditionOrderType.Stock
)

sdk.stock.trail_profit(target_account, "20240427","20240516", StopSign.Full, trail)