Skip to content

Commit

Permalink
indicator: make callback field private
Browse files Browse the repository at this point in the history
  • Loading branch information
c9s committed Jul 14, 2022
1 parent 2a3118a commit b2538b6
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 22 deletions.
2 changes: 1 addition & 1 deletion pkg/indicator/ewma.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type EWMA struct {
Values types.Float64Slice
LastOpenTime time.Time

UpdateCallbacks []func(value float64)
updateCallbacks []func(value float64)
}

func (inc *EWMA) Update(value float64) {
Expand Down
4 changes: 2 additions & 2 deletions pkg/indicator/ewma_callbacks.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/indicator/hull.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type HULL struct {
ma2 *EWMA
result *EWMA

UpdateCallbacks []func(value float64)
updateCallbacks []func(value float64)
}

func (inc *HULL) Update(value float64) {
Expand Down
4 changes: 2 additions & 2 deletions pkg/indicator/hull_callbacks.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/indicator/macd.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type MACD struct {

EndTime time.Time

UpdateCallbacks []func(value float64)
updateCallbacks []func(value float64)
}

func (inc *MACD) Update(x float64) {
Expand Down
4 changes: 2 additions & 2 deletions pkg/indicator/macd_callbacks.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/indicator/obv.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ type OBV struct {
types.IntervalWindow
Values types.Float64Slice
PrePrice float64
EndTime time.Time

EndTime time.Time
UpdateCallbacks []func(value float64)
updateCallbacks []func(value float64)
}

func (inc *OBV) Update(price, volume float64) {
Expand Down
4 changes: 2 additions & 2 deletions pkg/indicator/obv_callbacks.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 10 additions & 7 deletions pkg/indicator/rma.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@ import (
type RMA struct {
types.SeriesBase
types.IntervalWindow
Values types.Float64Slice
counter int
Adjust bool
tmp float64
sum float64
EndTime time.Time
UpdateCallbacks []func(value float64)

Values types.Float64Slice
EndTime time.Time

counter int
Adjust bool
tmp float64
sum float64

updateCallbacks []func(value float64)
}

func (inc *RMA) Update(x float64) {
Expand Down
4 changes: 2 additions & 2 deletions pkg/indicator/rma_callbacks.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b2538b6

Please sign in to comment.