mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 06:53:52 +00:00
add accessors for last up band and down band values
This commit is contained in:
parent
e60127090b
commit
224acd0ca9
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue
Block a user