xtb-api-unofficial - v0.1.0
    Preparing search index...

    Interface Position

    Open trading position information.

    Represents a currently open position with profit/loss calculations, stop loss/take profit levels, and other position details.

    const position: Position = {
    symbol: 'AAPL.US',
    volume: 100,
    side: 'buy',
    openPrice: 150.25,
    currentPrice: 152.80,
    profitNet: 255.00,
    stopLoss: 148.00,
    takeProfit: 160.00
    };
    interface Position {
        commission?: number;
        currentPrice: number;
        instrumentId?: number;
        margin?: number;
        openPrice: number;
        openTime?: number;
        orderId?: string;
        profitNet: number;
        profitPercent: number;
        side: "buy" | "sell";
        stopLoss?: number;
        swap?: number;
        symbol: string;
        takeProfit?: number;
        volume: number;
    }
    Index

    Properties

    commission?: number

    Trading commission paid

    currentPrice: number

    Current market price

    instrumentId?: number

    Instrument ID for this symbol

    margin?: number

    Margin required for this position

    openPrice: number

    Price at which position was opened

    openTime?: number

    Position open time (Unix timestamp)

    orderId?: string

    Order/position ID

    profitNet: number

    Net profit/loss in account currency

    profitPercent: number

    Profit/loss as percentage

    side: "buy" | "sell"

    Position side

    stopLoss?: number

    Stop loss price (if set)

    swap?: number

    Swap/rollover fees

    symbol: string

    Symbol name

    takeProfit?: number

    Take profit price (if set)

    volume: number

    Position volume (number of shares/lots)