Skip to main content

crypto-volume-profile

Zero-dependency Python & JavaScript (ESM) library to compute Volume Profile (VPVR), Point of Control (POC), 70% Value Area (VAH / VAL), and turnover-decayed Cost-Basis Chip Distribution (筹码分布) directly from standard OHLCV candlestick arrays.


Python Installation & Quick Start

pip install crypto-volume-profile
from crypto_volume_profile import compute_distribution

res = compute_distribution(bars, mode="profile", bins=120)
print(res.poc, res.val, res.vah)

Model Overview

  1. Triangular Intrabar Spread: Each bar's volume is distributed across [low, high] using a triangular density peaking at the typical price (H + L + C) / 3.
  2. Volume Profile Mode (mode: 'profile'): Accumulates raw volume across price bins without decay, then expands outward from the POC bin until 70% of total volume is enclosed (VAL to VAH).
  3. Chip Distribution Mode (mode: 'chips'): Applies per-bar turnover decay min(0.95, V / (avgV × turnoverBars)) before adding new volume, modeling how older positions turn over as fresh volume trades at newer price levels, and computes profitRatio (fraction of estimated holdings below current close).

Usage

import { computeDistribution } from './src/index.mjs';

const bars = [
  { o: 95000, h: 96200, l: 94500, c: 95800, v: 12400 },
  { o: 95800, h: 97400, l: 95500, c: 97100, v: 18900 },
  { o: 97100, h: 97800, l: 96300, c: 96800, v: 15100 },
];

const chips = computeDistribution(bars, { mode: 'chips', bins: 60, turnoverBars: 30 });
console.log({
  pocPrice: chips.pocPrice,
  valPrice: chips.valPrice,
  vahPrice: chips.vahPrice,
  profitRatioPct: (chips.profitRatio * 100).toFixed(1) + '%',
});

License

MIT © HoldWins


Go Module Installation (pkg.go.dev)

go get github.com/dalangdalang934/crypto-volume-profile@latest
import "volumeprofile" // github.com/dalangdalang934/crypto-volume-profile

prof := volumeprofile.Compute(bars, volumeprofile.Options{Mode: "chips", Bins: 120, ValueAreaRatio: 0.70})

Metadata

Release files for crypto-volume-profile 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for crypto-volume-profile 1.1.0
File Size Uploaded Provenance Actions
crypto_volume_profile-1.1.0.tar.gz 4.7 kB Without provenance Details for crypto_volume_profile-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for crypto-volume-profile 1.1.0
File Interpreter ABI Platform Actions
crypto_volume_profile-1.1.0-py3-none-any.whl Python 3 none any Details for crypto_volume_profile-1.1.0-py3-none-any.whl

Total release size: 10.7 kB

Release files / crypto_volume_profile-1.1.0.tar.gz

Download URL crypto_volume_profile-1.1.0.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
b832e3a6c7828e004cf9c08d5f42937c2a6b23a8a612c86f6be6ec3ab4669050
BLAKE2b-256 checksum
How to use checksums
8c08fd55db9e22d0a6e00c49eca2b0316448e58a6a04b8a61bb0e5fa83075e19
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / crypto_volume_profile-1.1.0-py3-none-any.whl

Download URL crypto_volume_profile-1.1.0-py3-none-any.whl
Size 5.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6a4eeb9e6145e3e2343d850866f1606e775ecf441c7d3485d4db135aba9b8ed9
BLAKE2b-256 checksum
How to use checksums
a9da8b63aecf8d1cf736e90866e121dfbc64c31f7e2d13ec73195920a2ffc64d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for crypto-volume-profile 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page