mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
fix: takeProfitFactor NaN
This commit is contained in:
parent
e34b0c6c30
commit
ba532bd98c
|
@ -405,7 +405,7 @@ func (s *Strategy) initIndicators(kline *types.KLine, priceLines *types.Queue) e
|
||||||
s.takeProfitFactor = &indicator.SMA{IntervalWindow: types.IntervalWindow{Interval: s.Interval, Window: s.ProfitFactorWindow}}
|
s.takeProfitFactor = &indicator.SMA{IntervalWindow: types.IntervalWindow{Interval: s.Interval, Window: s.ProfitFactorWindow}}
|
||||||
s.trendLine = &indicator.EWMA{IntervalWindow: types.IntervalWindow{Interval: s.Interval, Window: s.TrendWindow}}
|
s.trendLine = &indicator.EWMA{IntervalWindow: types.IntervalWindow{Interval: s.Interval, Window: s.TrendWindow}}
|
||||||
|
|
||||||
for i := 0; i < s.ProfitFactorWindow; i++ {
|
for i := 0; i <= s.ProfitFactorWindow; i++ {
|
||||||
s.takeProfitFactor.Update(s.TakeProfitFactor)
|
s.takeProfitFactor.Update(s.TakeProfitFactor)
|
||||||
}
|
}
|
||||||
store, _ := s.Session.MarketDataStore(s.Symbol)
|
store, _ := s.Session.MarketDataStore(s.Symbol)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user