Skip to content

API Reference


API Reference / LedgerPosition

Interface: LedgerPosition ​

Defined in: src/execution/PositionLedger.ts:16

Properties ​

exchangeSegment ​

exchangeSegment: string

Defined in: src/execution/PositionLedger.ts:17


securityId ​

securityId: string

Defined in: src/execution/PositionLedger.ts:18


netQuantity ​

netQuantity: number

Defined in: src/execution/PositionLedger.ts:20

Positive for a net long, negative for a net short, 0 when flat.


averagePrice ​

averagePrice: number

Defined in: src/execution/PositionLedger.ts:22

Volume-weighted cost basis of the currently open quantity. 0 when flat.


realizedPnl ​

realizedPnl: number

Defined in: src/execution/PositionLedger.ts:24

Cumulative — survives the position going flat, unlike netQuantity/averagePrice.


fills ​

fills: Fill[]

Defined in: src/execution/PositionLedger.ts:25

Community project — not affiliated with Dhan. MIT License.