mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 06:53:52 +00:00
indicator: rename PivotHigh value field
This commit is contained in:
parent
8fcc3ee368
commit
70fb6d19a9
|
@ -13,8 +13,8 @@ type PivotHigh struct {
|
|||
|
||||
types.IntervalWindow
|
||||
|
||||
Lows floats.Slice
|
||||
Values floats.Slice
|
||||
Highs floats.Slice
|
||||
Values floats.Slice
|
||||
EndTime time.Time
|
||||
|
||||
updateCallbacks []func(value float64)
|
||||
|
@ -33,17 +33,17 @@ func (inc *PivotHigh) Last() float64 {
|
|||
}
|
||||
|
||||
func (inc *PivotHigh) Update(value float64) {
|
||||
if len(inc.Lows) == 0 {
|
||||
if len(inc.Highs) == 0 {
|
||||
inc.SeriesBase.Series = inc
|
||||
}
|
||||
|
||||
inc.Lows.Push(value)
|
||||
inc.Highs.Push(value)
|
||||
|
||||
if len(inc.Lows) < inc.Window {
|
||||
if len(inc.Highs) < inc.Window {
|
||||
return
|
||||
}
|
||||
|
||||
low, ok := calculatePivotHigh(inc.Lows, inc.Window, inc.RightWindow)
|
||||
low, ok := calculatePivotHigh(inc.Highs, inc.Window, inc.RightWindow)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user