mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-21 22:43:52 +00:00
indicator: make right window optional
This commit is contained in:
parent
4c69dccf09
commit
dfa3f7d4c4
|
@ -11,7 +11,12 @@ type PivotHighStream struct {
|
|||
window, rightWindow int
|
||||
}
|
||||
|
||||
func PivotHigh2(source types.Float64Source, window, rightWindow int) *PivotHighStream {
|
||||
func PivotHigh(source types.Float64Source, window int, args ...int) *PivotHighStream {
|
||||
rightWindow := window
|
||||
if len(args) > 0 {
|
||||
rightWindow = args[0]
|
||||
}
|
||||
|
||||
s := &PivotHighStream{
|
||||
Float64Series: types.NewFloat64Series(),
|
||||
window: window,
|
||||
|
|
|
@ -11,7 +11,12 @@ type PivotLowStream struct {
|
|||
window, rightWindow int
|
||||
}
|
||||
|
||||
func PivotLow(source types.Float64Source, window, rightWindow int) *PivotLowStream {
|
||||
func PivotLow(source types.Float64Source, window int, args ...int) *PivotLowStream {
|
||||
rightWindow := window
|
||||
if len(args) > 0 {
|
||||
rightWindow = args[0]
|
||||
}
|
||||
|
||||
s := &PivotLowStream{
|
||||
Float64Series: types.NewFloat64Series(),
|
||||
window: window,
|
||||
|
|
Loading…
Reference in New Issue
Block a user