miguelmota / vwap

Calculate the Volume-Weighted Average Price (VWAP)

Home Page:https://github.com/miguelmota/vwap

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

vwap

Calculate the Volume-Weighted Average Price (VWAP)

Install

npm install vwap

Usage

const vwap = require('vwap')

// input: [[volume, price], [volume, price], ...]
const p = vwap([[5, 10], [13, 8.5], [10, 11]])

console.log(p) // 9.660714285714286

Test

npm test

License

MIT

About

Calculate the Volume-Weighted Average Price (VWAP)

https://github.com/miguelmota/vwap

License:MIT License


Languages

Language:JavaScript 100.0%