Skip to content
This repository has been archived by the owner on May 24, 2022. It is now read-only.

miguelmota/vwap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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