diff --git a/backtesting.go b/backtesting.go index 0e81942..f470f0a 100644 --- a/backtesting.go +++ b/backtesting.go @@ -69,7 +69,7 @@ func Backtest(trader *Trader) { } }) profit := stats.Dated.Float("Profit", -1) - profitFactor := stats.Dated.Float("Profit", -1) / maxDrawdown + profitFactor := profit / maxDrawdown maxDrawdownPct := 100 * maxDrawdown / stats.Dated.Float("Equity", 0) // Print a summary of the statistics to the console. diff --git a/trader.go b/trader.go index 563c475..2a0d1ab 100644 --- a/trader.go +++ b/trader.go @@ -38,7 +38,7 @@ type TradeStat struct { Exit bool // Exit is true if the trade was to exit a previous position. } -// Performance (financial) reporting and statistics. +// Financial performance reporting and statistics. type TraderStats struct { Dated *Frame returnsThisCandle float64