Optional
config: IVolumeProfileSessionConfigConfiguration options for the Volume Profile session
A new Tick-based Volume Profile session
import * as ta from 'chart-patterns';
// Create a tick volume profile session
const session = ta.VolumeProfile.createTickSession();
// Process individual trades
session.processTrade({
price: 36500.25,
volume: 1.5,
isBuyer: true,
time: new Date()
});
// Or process multiple trades at once
session.processTrades(tradesArray);
// Get value area (builds histogram only when needed)
const valueArea = session.getValueArea();
// Get distribution with both histogram and exact price levels
const distribution = session.getVolumeDistribution();
// distribution.priceLevels contains exact price points with their volumes
// Real-time processing example
socket.on('trade', trade => {
session.processTrade(trade);
});
// Get current value area without rebuilding histogram unnecessarily
setInterval(() => {
const valueArea = session.getValueArea(); // auto-rebuilds only when needed
console.log('Current Value Area:', valueArea);
}, 5000);
// Reset the session
session.reset();
Generated using TypeDoc
Creates a new Tick-based Volume Profile session for processing individual trades.
A tick-based volume profile provides the most accurate analysis by processing individual trades rather than aggregated candlestick data. This approach allows for precise identification of key price levels where actual transactions occurred.