Skip to main content

Trailing Profit Conditional Order

trailProfit

Input Parameters

ParameterTypeDescription
accountAccountAccount
start_datestringCondition monitoring start time
end_datestringCondition monitoring end time
stop_signStopSignCondition stop condition : Full Until fully filled、PartialUntil partially filled、UntilEndUntil expiry
trailOrderTrailOrderTrailing Profit
caution

TrailOrder withinof Base price (price) accepts at most two decimal places,additional decimal places cause price refreshing to fail

info

When the current stock price reaches the trigger price(based on the percentage change from the base price) Place order

Example: If the initial base price is 100, downward 5% Place order/,the initial trigger price is 95,if the price does not rise above 100(so the base price is not adjusted), then when the market price is 95 Trigger conditionPlace order

Result

ParameterTypeDescription
isSuccessboolWhether successful
dataObjectConditional order response information
messagestring ? (optional)When isSuccess = false Returns an error message

Order Information ConditionOrderResult Fields

Return type : Object

ParameterTypeDescription
guidstringConditional Order ID
reply_codestringResponse status code
advisorystringResponse status content

Request Example

// Define the condition
const trail = {
symbol: "2330",
price: "860",
direction: Direction.Down,
percentage: 5,
buySell: BSAction.Sell,
quantity: 2000,
priceType: ConditionPriceType.MatchedPrice,
diff: 5,
timeInForce: TimeInForce.ROD,
orderType: ConditionOrderType.Stock

};

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

Response Example


{
isSuccess: true,
data : {
guid : "44150047-8977-40b1-953c-ce2XXXXXX"
}
}