VolumeLib
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Hamster-Coder

//@version=5

// @description Contains types and methods related to VOLUME
library("VolumeLib", overlay = true)

// @function TODO: add function description here
// @param x TODO: add parameter x description here
// @returns TODO: add what function returns
export volumePrice() =>
	volume / (high - low)

// volume_price = volumePrice()

export averageVolumePrice(simple int length) =>
	vp = volumePrice()
	ta.sma(vp, length)

export volumePower(series float volume_price, series float average_volume_price) =>
	volume_price / average_volume_price - 1

export volumePower(simple int length) =>
	// avg = ta.sma(volume_price, length) // averageVolumePrice(length)
	avg = averageVolumePrice(length)
	price = volumePrice()
	volumePower(price, avg)
