Skip to main content

Interface: Position

Charting Library.Position

Describes a single position.

Hierarchy

Properties

askPrice

Optional

askPrice: number

Best ask price provided by the broker

Inherited from

PositionBase.askPrice


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.

Inherited from

PositionBase.avgPrice


bidPrice

Optional

bidPrice: number

Best bid price provided by the broker

Inherited from

PositionBase.bidPrice


contractExpirationDate

Optional

contractExpirationDate: ContractExpirationDate

Contract expiration date, for futures instruments

Inherited from

PositionBase.contractExpirationDate


currency

Optional

currency: string

Instrument currency displayed in the Account Manager

Inherited from

PositionBase.currency


exitLevels

Optional

exitLevels: ExitLevel[]

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

Inherited from

PositionBase.exitLevels


extra

Optional

extra: ExtraData

Inherited from

WithExtraData.extra


guaranteedStop

Optional

guaranteedStop: number

Guaranteed stop loss price. Available when Brackets are enabled

Inherited from

PositionBase.guaranteedStop


id

id: string

Position ID. Usually id should be equal to brokerSymbol

Inherited from

PositionBase.id


lastPrice

Optional

lastPrice: number

Last price provided by the broker

Inherited from

PositionBase.lastPrice


longQty

Optional

longQty: number

Long position quantity

Inherited from

PositionBase.longQty


marketValue

Optional

marketValue: number

Market value of the position

Inherited from

PositionBase.marketValue


message

Optional

message: OrderOrPositionMessage

Message describing the state of the position

Inherited from

PositionBase.message


qty

qty: number

Position Quantity (positive number)

Inherited from

PositionBase.qty


shortQty

Optional

shortQty: number

Short position quantity

Inherited from

PositionBase.shortQty


side

side: Side

Position Side

Inherited from

PositionBase.side


stopLoss

Optional

stopLoss: number

Stop loss price. Available when Brackets are enabled

Inherited from

PositionBase.stopLoss


stopType

Optional

stopType: StopType

Stop Loss type

Inherited from

PositionBase.stopType


symbol

symbol: string

Symbol name

Inherited from

PositionBase.symbol


takeProfit

Optional

takeProfit: number

Take profit price. Available when Brackets are enabled

Inherited from

PositionBase.takeProfit


trailingStopPips

Optional

trailingStopPips: number

Trailing stop Pips value. Available when Brackets are enabled

Inherited from

PositionBase.trailingStopPips


trailingStopPrice

Optional

trailingStopPrice: number

Trailing stop price. Available when Brackets are enabled

Inherited from

PositionBase.trailingStopPrice


unrealizedPl

Optional

unrealizedPl: number

Unrealized profit/loss

Inherited from

PositionBase.unrealizedPl


unrealizedPlPercent

Optional

unrealizedPlPercent: number

Unrealized profit/loss in percent

Inherited from

PositionBase.unrealizedPlPercent


unrealizedPlQty

Optional

unrealizedPlQty: number

Unrealized profit/loss per quantity unit

Inherited from

PositionBase.unrealizedPlQty


updateTime

Optional

updateTime: number

Last update time (unix timestamp in milliseconds)

Inherited from

PositionBase.updateTime