diff --git a/pkg/indicator/boll.go b/pkg/indicator/boll.go index 5301a97d1..0206a46c8 100644 --- a/pkg/indicator/boll.go +++ b/pkg/indicator/boll.go @@ -20,6 +20,8 @@ Bollinger Bands Bollinger Bands Technical indicator guide: - https://www.fidelity.com/learning-center/trading-investing/technical-analysis/technical-indicator-guide/bollinger-bands */ + +//go:generate callbackgen -type BOLL type BOLL struct { types.IntervalWindow @@ -32,6 +34,16 @@ type BOLL struct { DownBand Float64Slice EndTime time.Time + + updateCallbacks []func(sma, upBand, downBand float64) +} + +func (inc *BOLL) LastUpBand() float64 { + return inc.UpBand[len(inc.UpBand)-1] +} + +func (inc *BOLL) LastDownBand() float64 { + return inc.DownBand[len(inc.DownBand)-1] } func (inc *BOLL) LastSMA() float64 {