mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 00:35:15 +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
|
types.IntervalWindow
|
||||||
|
|
||||||
Lows floats.Slice
|
Highs floats.Slice
|
||||||
Values floats.Slice
|
Values floats.Slice
|
||||||
EndTime time.Time
|
EndTime time.Time
|
||||||
|
|
||||||
updateCallbacks []func(value float64)
|
updateCallbacks []func(value float64)
|
||||||
|
@ -33,17 +33,17 @@ func (inc *PivotHigh) Last() float64 {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (inc *PivotHigh) Update(value float64) {
|
func (inc *PivotHigh) Update(value float64) {
|
||||||
if len(inc.Lows) == 0 {
|
if len(inc.Highs) == 0 {
|
||||||
inc.SeriesBase.Series = inc
|
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
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
low, ok := calculatePivotHigh(inc.Lows, inc.Window, inc.RightWindow)
|
low, ok := calculatePivotHigh(inc.Highs, inc.Window, inc.RightWindow)
|
||||||
if !ok {
|
if !ok {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user