Class TrailingStopOrder

Represents a trailing-stop order.

Hierarchy

  • TrailingStopOrder

Constructors

  • Create a trailing-stop order.

    Parameters

    • action: OrderAction

      The order action (buy or sell)

    • totalQuantity: number

      The number of positions being bought/sold.

    • Optional auxPrice: number

      Generic field to contain the stop price for STP LMT orders, trailing amount, etc.

    • Optional trailingPercent: number

      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

    • Optional transmit: boolean

      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.

    • Optional parentId: number

      The order ID of the parent order, used for bracket and auto trailing stop orders..

    • Optional tif: TimeInForce

      The time in force. Valid values are:

      • DAY - Valid for the day only.
      • GTC - Good until canceled.

    Returns TrailingStopOrder

Properties

action: OrderAction

The order action (buy or sell)

auxPrice?: number

Generic field to contain the stop price for STP LMT orders, trailing amount, etc.

orderType: TRAIL = OrderType.TRAIL

The order's type (must be [[OrderType.TRAIL]]).

parentId?: number

The order ID of the parent order, used for bracket and auto trailing stop orders..

The time in force. Valid values are:

  • DAY - Valid for the day only.
  • GTC - Good until canceled.
totalQuantity: number

The number of positions being bought/sold.

trailingPercent?: number

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

transmit?: boolean

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.

Generated using TypeDoc