GetOrderStopLoss
Syntax
GetOrderStopLoss(): numberReturn Value
Description
Example
// Select an order by ticket number
if (this.api.SelectOrder(12345, EOrderSelectMode.SELECT_ORDER_BY_TICKET)) {
// Get the order details
const symbol = this.api.GetOrderSymbol();
const type = this.api.GetOrderType();
const openPrice = this.api.GetOrderOpenPrice();
const stopLoss = this.api.GetOrderStopLoss();
const takeProfit = this.api.GetOrderTakeProfit();
console.log(`Order #12345 on ${symbol}:`);
console.log(`- Type: ${type === TTradePositionType.BUY ? "Buy" : "Sell"}`);
console.log(`- Open Price: ${openPrice}`);
console.log(`- Stop Loss: ${stopLoss}`);
console.log(`- Take Profit: ${takeProfit}`);
}Notes
Last updated