Skip to content

Commit 613b23e

Browse files
committed
pivotshort: add FastWindow parameter
1 parent e171932 commit 613b23e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pkg/strategy/pivotshort/failedbreakhigh.go

+7-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ type FailedBreakHigh struct {
1717
// IntervalWindow is used for finding the pivot high
1818
types.IntervalWindow
1919

20+
FastWindow int
21+
2022
bbgo.OpenPositionOptions
2123

2224
// BreakInterval is used for checking failed break
@@ -72,6 +74,10 @@ func (s *FailedBreakHigh) Bind(session *bbgo.ExchangeSession, orderExecutor *bbg
7274
return
7375
}
7476

77+
if s.FastWindow == 0 {
78+
s.FastWindow = 3
79+
}
80+
7581
position := orderExecutor.Position()
7682
symbol := position.Symbol
7783
standardIndicator := session.StandardIndicatorSet(s.Symbol)
@@ -80,7 +86,7 @@ func (s *FailedBreakHigh) Bind(session *bbgo.ExchangeSession, orderExecutor *bbg
8086
s.pivotHigh = standardIndicator.PivotHigh(s.IntervalWindow)
8187
s.fastPivotHigh = standardIndicator.PivotHigh(types.IntervalWindow{
8288
Interval: s.IntervalWindow.Interval,
83-
Window: 3,
89+
Window: s.FastWindow,
8490
})
8591

8692
// StrategyController

0 commit comments

Comments
 (0)