mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
indicator/rsi: make update callback field private
This commit is contained in:
parent
b2538b6960
commit
8d8d9a7c59
|
@ -22,7 +22,7 @@ type RSI struct {
|
|||
PreviousAvgGain float64
|
||||
|
||||
EndTime time.Time
|
||||
UpdateCallbacks []func(value float64)
|
||||
updateCallbacks []func(value float64)
|
||||
}
|
||||
|
||||
func (inc *RSI) Update(price float64) {
|
||||
|
|
|
@ -5,11 +5,11 @@ package indicator
|
|||
import ()
|
||||
|
||||
func (inc *RSI) OnUpdate(cb func(value float64)) {
|
||||
inc.UpdateCallbacks = append(inc.UpdateCallbacks, cb)
|
||||
inc.updateCallbacks = append(inc.updateCallbacks, cb)
|
||||
}
|
||||
|
||||
func (inc *RSI) EmitUpdate(value float64) {
|
||||
for _, cb := range inc.UpdateCallbacks {
|
||||
for _, cb := range inc.updateCallbacks {
|
||||
cb(value)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user