UNPKG

@stoqey/ib

Version:

Interactive Brokers TWS/IB Gateway API client library for Node.js (TS)

40 lines (39 loc) 1.99 kB
import { OrderAction } from "./enum/order-action"; import { OrderType } from "./enum/orderType"; import { TimeInForce } from "./enum/tif"; /** * Represents a trailing-stop order. */ export declare class TrailingStopOrder { action: OrderAction; totalQuantity: number; auxPrice?: number; trailingPercent?: number; transmit?: boolean; parentId?: number; tif?: TimeInForce; /** * Create a trailing-stop order. * * @param action The order action (buy or sell) * @param totalQuantity The number of positions being bought/sold. * @param auxPrice Generic field to contain the stop price for STP LMT orders, trailing amount, etc. * @param trailingPercent Specifies the trailing amount of a trailing stop order as a percentage. * This field is mutually exclusive with the existing trailing amount. * That is, the API client can send one or the other but not both. * This field is read AFTER the stop price (barrier price) as follows: deltaNeutralAuxPrice stopPrice, trailingPercent, scale order attributes. * The field will also be sent to the API in the openOrder message if the API client version is >= 56. * It is sent after the stopPrice field as follows: stopPrice, trailingPct, basisPoint * @param transmit Specifies whether the order will be transmitted by TWS. If set to false`, * the order will be created at TWS but will not be sent. * @param parentId The order ID of the parent order, used for bracket and auto trailing stop orders.. * @param tif The time in force. * Valid values are: * - DAY - Valid for the day only. * - GTC - Good until canceled. */ constructor(action: OrderAction, totalQuantity: number, auxPrice?: number, trailingPercent?: number, transmit?: boolean, parentId?: number, tif?: TimeInForce); /** The order's type (must be [[OrderType.TRAIL]]). */ readonly orderType = OrderType.TRAIL; } export default TrailingStopOrder;