mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
indicator: fix length slice calculation
This commit is contained in:
parent
5dd14feb42
commit
0e18aa68f7
|
@ -72,7 +72,7 @@ func calculatePivotLow(lows types.Float64Slice, window int) (float64, error) {
|
|||
return 0., fmt.Errorf("insufficient elements for calculating with window = %d", window)
|
||||
}
|
||||
|
||||
min := lows[length-(window-1):].Min()
|
||||
min := lows[length-1-(window-1):].Min()
|
||||
if min == lows.Index(int(window/2.)-1) {
|
||||
return min, nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user