Fixed MORE bugs

This commit is contained in:
Luke I. Wilson
2023-05-24 15:58:59 -05:00
parent 46fd55ab8d
commit b5434fb5de
10 changed files with 205 additions and 55 deletions

View File

@@ -468,7 +468,7 @@ func (s *RollingSeries) Period(row int) []any {
//
// Will work with all signed int and float types. Ignores all other values.
func (s *RollingSeries) Max() *Series {
return s.series.Map(func(i int, _ any) any {
return s.series.MapReverse(func(i int, _ any) any {
period := s.Period(i)
if len(period) == 0 {
return 0
@@ -514,7 +514,7 @@ func (s *RollingSeries) Max() *Series {
//
// Will work with all signed int and float types. Ignores all other values.
func (s *RollingSeries) Min() *Series {
return s.series.Map(func(i int, _ any) any {
return s.series.MapReverse(func(i int, _ any) any {
period := s.Period(i)
if len(period) == 0 {
return 0