Skip to content

Commit

Permalink
fix data generation
Browse files Browse the repository at this point in the history
  • Loading branch information
narumiruna committed Jan 16, 2025
1 parent 733c097 commit 5f16b71
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions config/sentinel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ sessions:
max:
exchange: &exchange max
envVarPrefix: max
publicOnly: true

persistence:
json:
Expand Down
7 changes: 3 additions & 4 deletions pkg/strategy/sentinel/strategy.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,10 @@ func (s *Strategy) extractVolumes(klines []types.KLine) floats.Slice {
func (s *Strategy) generateSamples(volumes floats.Slice) [][]float64 {
samples := make([][]float64, 0, len(volumes))
for i := range volumes {
if i < s.Window {
continue
if i+s.Window > len(volumes) {
break
}

subset := volumes.Tail(s.Window)
subset := volumes[i : i+s.Window]

mean := subset.Mean()
std := subset.Std()
Expand Down

0 comments on commit 5f16b71

Please sign in to comment.