Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
larscom opened this issue Oct 17, 2023 · 6 comments · Fixed by #127
Closed

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

larscom opened this issue Oct 17, 2023 · 6 comments · Fixed by #127
Assignees
Labels
enhancement New feature or request

Comments

@larscom
Copy link

larscom commented Oct 17, 2023

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!

@cinar
Copy link
Owner

cinar commented Oct 21, 2023

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?

@cinar cinar self-assigned this Oct 21, 2023
@cinar cinar added the enhancement New feature or request label Oct 21, 2023
@larscom
Copy link
Author

larscom commented Oct 21, 2023

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.

@cinar
Copy link
Owner

cinar commented Oct 21, 2023

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

@cinar
Copy link
Owner

cinar commented Oct 21, 2023

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

@larscom
Copy link
Author

larscom commented Oct 21, 2023

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

Looking good to me!

@cinar cinar linked a pull request Oct 21, 2023 that will close this issue
cinar added a commit that referenced this issue Oct 21, 2023
Fixes #126 by changing the Volume from int64 to float64. This is going
to be a breaking change for the projects depending to this module, so I
will be incrementing the minor version number.
@cinar
Copy link
Owner

cinar commented Oct 21, 2023

Awesome, please try it with release v1.3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants