Skip to content

Commit 4c6fe11

Browse files
committed
pivotshort: rename ClosedKLineStop to fake break stop
1 parent 7438798 commit 4c6fe11

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

pkg/strategy/pivotshort/breaklow.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ type TrendEMA struct {
1919
types.IntervalWindow
2020
}
2121

22-
type ClosedKLineStop struct {
22+
type FakeBreakStop struct {
2323
types.IntervalWindow
2424
}
2525

@@ -46,7 +46,7 @@ type BreakLow struct {
4646

4747
TrendEMA *TrendEMA `json:"trendEMA"`
4848

49-
ClosedKLineStop *ClosedKLineStop `json:"closedKLineStop"`
49+
FakeBreakStop *FakeBreakStop `json:"fakeBreakStop"`
5050

5151
lastLow fixedpoint.Value
5252

@@ -77,8 +77,8 @@ func (s *BreakLow) Subscribe(session *bbgo.ExchangeSession) {
7777
session.Subscribe(types.KLineChannel, s.Symbol, types.SubscribeOptions{Interval: s.TrendEMA.Interval})
7878
}
7979

80-
if s.ClosedKLineStop != nil {
81-
session.Subscribe(types.KLineChannel, s.Symbol, types.SubscribeOptions{Interval: s.ClosedKLineStop.Interval})
80+
if s.FakeBreakStop != nil {
81+
session.Subscribe(types.KLineChannel, s.Symbol, types.SubscribeOptions{Interval: s.FakeBreakStop.Interval})
8282
}
8383
}
8484

@@ -127,10 +127,10 @@ func (s *BreakLow) Bind(session *bbgo.ExchangeSession, orderExecutor *bbgo.Gener
127127
}
128128
}))
129129

130-
if s.ClosedKLineStop != nil {
130+
if s.FakeBreakStop != nil {
131131
// if the position is already opened, and we just break the low, this checks if the kline closed above the low,
132132
// so that we can close the position earlier
133-
session.MarketDataStream.OnKLineClosed(types.KLineWith(s.Symbol, s.ClosedKLineStop.Interval, func(k types.KLine) {
133+
session.MarketDataStream.OnKLineClosed(types.KLineWith(s.Symbol, s.FakeBreakStop.Interval, func(k types.KLine) {
134134
// make sure the position is opened, and it's a short position
135135
if !position.IsOpened(k.Close) || !position.IsShort() {
136136
return

0 commit comments

Comments
 (0)