@@ -19,7 +19,7 @@ type TrendEMA struct {
19
19
types.IntervalWindow
20
20
}
21
21
22
- type ClosedKLineStop struct {
22
+ type FakeBreakStop struct {
23
23
types.IntervalWindow
24
24
}
25
25
@@ -46,7 +46,7 @@ type BreakLow struct {
46
46
47
47
TrendEMA * TrendEMA `json:"trendEMA"`
48
48
49
- ClosedKLineStop * ClosedKLineStop `json:"closedKLineStop "`
49
+ FakeBreakStop * FakeBreakStop `json:"fakeBreakStop "`
50
50
51
51
lastLow fixedpoint.Value
52
52
@@ -77,8 +77,8 @@ func (s *BreakLow) Subscribe(session *bbgo.ExchangeSession) {
77
77
session .Subscribe (types .KLineChannel , s .Symbol , types.SubscribeOptions {Interval : s .TrendEMA .Interval })
78
78
}
79
79
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 })
82
82
}
83
83
}
84
84
@@ -127,10 +127,10 @@ func (s *BreakLow) Bind(session *bbgo.ExchangeSession, orderExecutor *bbgo.Gener
127
127
}
128
128
}))
129
129
130
- if s .ClosedKLineStop != nil {
130
+ if s .FakeBreakStop != nil {
131
131
// if the position is already opened, and we just break the low, this checks if the kline closed above the low,
132
132
// 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 ) {
134
134
// make sure the position is opened, and it's a short position
135
135
if ! position .IsOpened (k .Close ) || ! position .IsShort () {
136
136
return
0 commit comments