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

Snapshot volume is changed to float64 from int64. #190

Merged
merged 1 commit into from
Jul 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions asset/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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>)
Expand Down Expand Up @@ -140,7 +140,7 @@ SnapshotsAsOpenings extracts the open field from each snapshot in the provided c
## func [SnapshotsAsVolumes](<https://github.com/cinar/indicator/blob/master/asset/snapshot.go#L88>)

```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.
Expand Down Expand Up @@ -331,7 +331,7 @@ type Snapshot struct {

// Volume represents the total trading activity for
// the asset during the snapshot period.
Volume int64
Volume float64
}
```

Expand Down
6 changes: 3 additions & 3 deletions asset/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
})
}
2 changes: 1 addition & 1 deletion asset/tiingo_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}
}

Expand Down
Loading