Skip to content

Commit

Permalink
Fix bug where having more than 2 TPs than TP ratios caused crash.
Browse files Browse the repository at this point in the history
  • Loading branch information
marianogappa committed Aug 2, 2021
1 parent e739324 commit 3f3709a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion profitcalculator/profit.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func NewProfitCalculator(input common.SignalCheckInput) ProfitCalculator {
for i := 0; i < len(input.TakeProfits); i++ {
if i >= len(input.TakeProfitRatios) {
accums = append(accums, accum)
break
continue
}
accum += float64(input.TakeProfitRatios[i])
accums = append(accums, accum)
Expand Down

0 comments on commit 3f3709a

Please sign in to comment.