Skip to main content

Interface: PositionBase

Broker.PositionBase

Describes a single position.

Hierarchy

Properties

askPrice

Optional

askPrice: number

Best ask price provided by the broker


avgPrice

avgPrice: number

The weighted average price of all positions for a symbol. The library uses this value to draw a position line on the chart and to calculate profit and loss values.


bidPrice

Optional

bidPrice: number

Best bid price provided by the broker


contractExpirationDate

Optional

contractExpirationDate: ContractExpirationDate

Contract expiration date, for futures instruments


currency

Optional

currency: string

Instrument currency displayed in the Account Manager


exitLevels

Optional

exitLevels: ExitLevel[]

Exit levels associated with the position. Used when BrokerConfigFlags.supportMultipleExitLevels is enabled.


guaranteedStop

Optional

guaranteedStop: number

Guaranteed stop loss price. Available when Brackets are enabled


id

id: string

Position ID. Usually id should be equal to brokerSymbol


lastPrice

Optional

lastPrice: number

Last price provided by the broker


longQty

Optional

longQty: number

Long position quantity


marketValue

Optional

marketValue: number

Market value of the position


message

Optional

message: OrderOrPositionMessage

Message describing the state of the position


qty

qty: number

Position Quantity (positive number)


shortQty

Optional

shortQty: number

Short position quantity


side

side: Side

Position Side


stopLoss

Optional

stopLoss: number

Stop loss price. Available when Brackets are enabled


stopType

Optional

stopType: StopType

Stop Loss type


symbol

symbol: string

Symbol name


takeProfit

Optional

takeProfit: number

Take profit price. Available when Brackets are enabled


trailingStopPips

Optional

trailingStopPips: number

Trailing stop Pips value. Available when Brackets are enabled


trailingStopPrice

Optional

trailingStopPrice: number

Trailing stop price. Available when Brackets are enabled


unrealizedPl

Optional

unrealizedPl: number

Unrealized profit/loss


unrealizedPlPercent

Optional

unrealizedPlPercent: number

Unrealized profit/loss in percent


unrealizedPlQty

Optional

unrealizedPlQty: number

Unrealized profit/loss per quantity unit


updateTime

Optional

updateTime: number

Last update time (unix timestamp in milliseconds)