Skip to content

v0.1.34 - Volume Profile Analysis

Choose a tag to compare

@quanhua92 quanhua92 released this 20 Nov 21:18
· 731 commits to main since this release

πŸŽ‰ Major Feature: Volume Profile Analysis

Complete implementation of Volume Profile analysis for both Vietnamese stocks and cryptocurrencies, with full UI and SDK support.

✨ New Features

Volume Profile Analysis Endpoint

  • NEW /analysis/volume-profile - Analyze volume distribution across price levels
  • Supports both VN stocks and cryptocurrencies
  • Customizable price bins (10-200) and value area percentage (60-90)
  • Returns:
    • Point of Control (POC) - Price with highest volume
    • Value Area - Price range containing 70% (configurable) of volume
    • High/Low Volume Nodes for support/resistance identification
    • Statistical measures (mean, median, std deviation, skewness)

Volume Profile UI (API Explorer)

  • NEW Interactive Volume Profile section at http://api.aipriceaction.com/explorer
  • Visual horizontal bar chart with color-coded levels:
    • 🟑 Yellow: Point of Control (POC)
    • 🟒 Green: High Volume Nodes (HVN > 3%)
    • 🟠 Orange: Low Volume Nodes (LVN < 1%)
    • πŸ”΅ Blue shading: Value Area
  • 4 interactive tabs:
    • πŸ“Š Volume Distribution (visual chart)
    • πŸ“ Price Levels (detailed table)
    • πŸ“ˆ Statistics (metrics dashboard)
    • πŸ’‘ Trading Insights (strategy guide)
  • Default 10 bins for readability
  • Responsive design for mobile/tablet/desktop

TypeScript SDK Support

  • NEW getVolumeProfile() method in aipriceaction-js SDK
  • 8 new TypeScript type definitions
  • Full validation (dates, numeric ranges)
  • Example: 12-volume-profile.ts with 5 use cases
  • Dual mode support (VN + crypto)

πŸ› Bug Fixes

  • Fixed crypto mode support in all analysis endpoints
  • Fixed null safety in Volume Profile UI (undefined percentage values)
  • Fixed required date parameter handling

πŸ“š Documentation

  • NEW docs/VOLUME_PROFILE.md - Technical implementation guide
  • NEW docs/VOLUME_PROFILE_USAGE.md - Trading strategies and user guide
  • Updated docs/API_ANALYSIS.md with Volume Profile endpoint
  • NEW scripts/debug_volume_profile.sh - Testing and debugging script
  • NEW scripts/test-analysis.sh - Analysis API test suite (10 tests)

πŸ”§ Backend Changes

  • New Rust module: src/server/analysis/volume_profile.rs (724 lines)
  • Uniform distribution algorithm for volume smearing across price levels
  • Dynamic tick size based on asset type (VN stocks: 10/50/100 VND, Crypto: 0.0001-1.0)
  • Value Area calculation using greedy expansion from POC
  • Volume-weighted statistical measures

πŸ“¦ SDK Changes (aipriceaction-js 0.1.34)

  • 8 new TypeScript interfaces: VolumeProfileQueryParams, PriceRange, PointOfControl, ValueArea, PriceLevelVolume, VolumeStatistics, VolumeProfileData, VolumeProfileResponse
  • Client-side validation for better UX
  • Comprehensive example file with 5 use cases
  • Full JSDoc documentation

πŸ“Š Statistics

  • 30 files changed
  • 8,410 insertions, 353 deletions
  • 3 new documentation files (1,541 lines)
  • 2 new UI files (751 lines)
  • 1 new backend module (724 lines)
  • 1 new SDK example (160 lines)

πŸš€ Usage Examples

API:

curl "http://api.aipriceaction.com/analysis/volume-profile?symbol=VJC&date=2025-11-20&bins=10"

TypeScript SDK:

const profile = await client.getVolumeProfile({
  symbol: 'VJC',
  date: '2025-11-20',
  bins: 10,
  value_area_pct: 70
});

console.log(`POC: ${profile.data.poc.price}`);
console.log(`Value Area: ${profile.data.value_area.low} - ${profile.data.value_area.high}`);

Web UI:
Visit http://api.aipriceaction.com/explorer and scroll to "πŸ“Š Volume Profile Analysis" section.

🎯 Trading Use Cases

  • POC Mean Reversion: Price gravitates towards POC (fair value)
  • Value Area Range Trading: Buy at VA Low, sell at VA High
  • HVN Support/Resistance: High volume nodes act as strong barriers
  • LVN Gap Fill: Low volume areas facilitate quick price movements
  • Breakout Confirmation: Price moving outside VA with volume

See docs/VOLUME_PROFILE_USAGE.md for complete trading strategies.