diff --git a/asset/README.md b/asset/README.md index 932ee06..0c18aab 100644 --- a/asset/README.md +++ b/asset/README.md @@ -31,7 +31,7 @@ The information provided on this project is strictly for informational purposes - [func SnapshotsAsHighs\(snapshots \<\-chan \*Snapshot\) \<\-chan float64](<#SnapshotsAsHighs>) - [func SnapshotsAsLows\(snapshots \<\-chan \*Snapshot\) \<\-chan float64](<#SnapshotsAsLows>) - [func SnapshotsAsOpenings\(snapshots \<\-chan \*Snapshot\) \<\-chan float64](<#SnapshotsAsOpenings>) -- [func SnapshotsAsVolumes\(snapshots \<\-chan \*Snapshot\) \<\-chan int64](<#SnapshotsAsVolumes>) +- [func SnapshotsAsVolumes\(snapshots \<\-chan \*Snapshot\) \<\-chan float64](<#SnapshotsAsVolumes>) - [type FileSystemRepository](<#FileSystemRepository>) - [func NewFileSystemRepository\(base string\) \*FileSystemRepository](<#NewFileSystemRepository>) - [func \(r \*FileSystemRepository\) Append\(name string, snapshots \<\-chan \*Snapshot\) error](<#FileSystemRepository.Append>) @@ -140,7 +140,7 @@ SnapshotsAsOpenings extracts the open field from each snapshot in the provided c ## func [SnapshotsAsVolumes]() ```go -func SnapshotsAsVolumes(snapshots <-chan *Snapshot) <-chan int64 +func SnapshotsAsVolumes(snapshots <-chan *Snapshot) <-chan float64 ``` SnapshotsAsVolumes extracts the volume field from each snapshot in the provided channel and returns a new channel containing only those volume values.The original snapshots channel can no longer be directly used afterwards. @@ -331,7 +331,7 @@ type Snapshot struct { // Volume represents the total trading activity for // the asset during the snapshot period. - Volume int64 + Volume float64 } ``` diff --git a/asset/snapshot.go b/asset/snapshot.go index cc5860a..64cdcc4 100644 --- a/asset/snapshot.go +++ b/asset/snapshot.go @@ -34,7 +34,7 @@ type Snapshot struct { // Volume represents the total trading activity for // the asset during the snapshot period. - Volume int64 + Volume float64 } // SnapshotsAsDates extracts the date field from each snapshot in the provided @@ -85,8 +85,8 @@ func SnapshotsAsClosings(snapshots <-chan *Snapshot) <-chan float64 { // SnapshotsAsVolumes extracts the volume field from each snapshot in the provided // channel and returns a new channel containing only those volume values.The // original snapshots channel can no longer be directly used afterwards. -func SnapshotsAsVolumes(snapshots <-chan *Snapshot) <-chan int64 { - return helper.Map(snapshots, func(snapshot *Snapshot) int64 { +func SnapshotsAsVolumes(snapshots <-chan *Snapshot) <-chan float64 { + return helper.Map(snapshots, func(snapshot *Snapshot) float64 { return snapshot.Volume }) } diff --git a/asset/tiingo_repository.go b/asset/tiingo_repository.go index fb73b80..a8a9a75 100644 --- a/asset/tiingo_repository.go +++ b/asset/tiingo_repository.go @@ -87,7 +87,7 @@ func (e *TiingoEndOfDay) ToSnapshot() *Snapshot { High: e.AdjHigh, Low: e.AdjLow, Close: e.AdjClose, - Volume: e.AdjVolume, + Volume: float64(e.AdjVolume), } }