mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 00:35:15 +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
|
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{
|
s := &PivotHighStream{
|
||||||
Float64Series: types.NewFloat64Series(),
|
Float64Series: types.NewFloat64Series(),
|
||||||
window: window,
|
window: window,
|
||||||
|
|
|
@ -11,7 +11,12 @@ type PivotLowStream struct {
|
||||||
window, rightWindow int
|
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{
|
s := &PivotLowStream{
|
||||||
Float64Series: types.NewFloat64Series(),
|
Float64Series: types.NewFloat64Series(),
|
||||||
window: window,
|
window: window,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user