Calculate the Volume-Weighted Average Price (VWAP)
npm install vwapconst vwap = require('vwap')
// input: [[volume, price], [volume, price], ...]
const p = vwap([[5, 10], [13, 8.5], [10, 11]])
console.log(p) // 9.660714285714286npm test
MIT
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Calculate the Volume-Weighted Average Price (VWAP)
npm install vwapconst vwap = require('vwap')
// input: [[volume, price], [volume, price], ...]
const p = vwap([[5, 10], [13, 8.5], [10, 11]])
console.log(p) // 9.660714285714286npm test
MIT