mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 08:45:16 +00:00
supertrend: avoid using embedded struct on DoubleDema
This commit is contained in:
parent
5bd292d0b2
commit
59fcef0b6d
|
@ -42,7 +42,7 @@ type Strategy struct {
|
||||||
types.IntervalWindow
|
types.IntervalWindow
|
||||||
|
|
||||||
// Double DEMA
|
// Double DEMA
|
||||||
DoubleDema
|
DoubleDema *DoubleDema
|
||||||
|
|
||||||
|
|
||||||
// SuperTrend indicator
|
// SuperTrend indicator
|
||||||
|
@ -165,7 +165,7 @@ func (s *Strategy) setupIndicators() {
|
||||||
kLineStore, _ := s.session.MarketDataStore(s.Symbol)
|
kLineStore, _ := s.session.MarketDataStore(s.Symbol)
|
||||||
|
|
||||||
// Double DEMA
|
// Double DEMA
|
||||||
s.setupDoubleDema(kLineStore, s.Interval)
|
s.DoubleDema.setupDoubleDema(kLineStore, s.Interval)
|
||||||
|
|
||||||
// Supertrend
|
// Supertrend
|
||||||
if s.SupertrendWindow == 0 {
|
if s.SupertrendWindow == 0 {
|
||||||
|
@ -342,7 +342,7 @@ func (s *Strategy) Run(ctx context.Context, orderExecutor bbgo.OrderExecutor, se
|
||||||
stSignal := s.Supertrend.GetSignal()
|
stSignal := s.Supertrend.GetSignal()
|
||||||
|
|
||||||
// DEMA signal
|
// DEMA signal
|
||||||
demaSignal := s.getDemaSignal(openPrice64, closePrice64)
|
demaSignal := s.DoubleDema.getDemaSignal(openPrice64, closePrice64)
|
||||||
|
|
||||||
// Linear Regression signal
|
// Linear Regression signal
|
||||||
var lgSignal types.Direction
|
var lgSignal types.Direction
|
||||||
|
|
Loading…
Reference in New Issue
Block a user