mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-25 16:25:16 +00:00
fix: takeProfitFactor NaN
This commit is contained in:
parent
0e3aecb549
commit
2c4e03a102
|
@ -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.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)
|
||||
}
|
||||
store, _ := s.Session.MarketDataStore(s.Symbol)
|
||||
|
|
Loading…
Reference in New Issue
Block a user