• Creates a new Volume Profile calculation session based on OHLC candles.

    A bar-based volume profile analyses price and volume data from candlesticks to identify areas of significant trading activity. It helps visualize where the majority of trading occurred within a given time period.

    Parameters

    Returns BarVolumeProfileSession

    A new Bar-based Volume Profile session

    Example

    import * as ta from 'chart-patterns';

    // Create a volume profile session with default settings
    const session = ta.VolumeProfile.createBarSession();

    // Create a session with custom settings
    const customSession = ta.VolumeProfile.createBarSession({
    valueAreaRowSize: 24,
    valueAreaVolume: 0.7,
    pricePrecision: 2
    });

    // Process candles
    for (const candle of candles) {
    session.processCandle(candle);
    }

    // Get value area
    const valueArea = session.getValueArea();
    // Result: { VAH: 36488.2, VAL: 35613.1, POC: 36439.58, EQ: 35613.1, low: 34446.3, high: 36779.9 }

    // Get full volume distribution including buy/sell volume per level
    const distribution = session.getVolumeDistribution();

    // Reset the session
    session.reset();

Generated using TypeDoc