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.

Code Examples
- Python
- Node.js
- C#
# 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)
// Define the condition
const trail = {
symbol: "2330",
price: "1000",
direction: Direction.Down,
percentage: 5,
buySell: BSAction.Sell,
quantity: 2000,
priceType: ConditionPriceType.MatchedPrice,
diff: 1,
timeInForce: TimeInForce.ROD,
orderType: ConditionOrderType.Stock
};
sdk.stock.trailProfit(target_account, "20240427","20240516", StopSign.Full, trail)
// Define the condition
var trail = new TrailOrder(
"2330",
"1000",
Direction.Down ,
5, // percentage increase/decrease
BsAction.Sell,
2000,
ConditionPriceType.MatchedPrice,
1, // number of ticks to chase up or down (negative when chasing down)
TimeInForce.Rod,
ConditionOrderType.Stock
);
sdk.Stock.TrailProfit(target_account, "20240427","20240516", StopSign.Full, trail);