cinar / indicator

Indicator is a Golang module providing various stock technical analysis indicators for trading.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Why is volume an []int64 and not []float64 ?

larscom opened this issue · comments

Hi,

Im exploring this lib and kinda new to this stuff, and one thing i don't understand is why the func VolumeWeightedAveragePrice for example and many other funcs expects a volume of type []int64?

Inside that func the []int64 gets converted to []float64 anyway.

func VolumeWeightedAveragePrice(period int, closing []float64, volume []int64) []float64 {

If any one has an answer for me, im pleased ;-)

Thanks!

Hi @larscom, when I started building this project, the data source that I used for the data had the volume as int64, so I followed that convention. However, it is a good point. What data source you are seeing volume as float64? I can certainly make it a float64 moving forward too?

hi @cinar, my data source is binance or bitvavo (crypto). Their volume is always a floating point number. Besides that i think it makes sense to make volume a float64 anyhow.

It is a good point. I can see that it does make sense for crypto data. Let me see if I can change this.

Hi @larscom, please check the fix-126 branch and let me know if it solves the problem for you.

Hi @larscom, please check the fix-126 branch and let me know if it solves the problem for you.

Looking good to me!

Awesome, please try it with release v1.3.0.