From d755f07d385257a8697bdb69e7ff9acec00aab78 Mon Sep 17 00:00:00 2001 From: Luke Wilson Date: Sun, 3 Nov 2024 09:50:30 -0600 Subject: [PATCH] Quick fixes --- backtesting.go | 2 +- trader.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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