mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-12 15:26:55 +08:00
fix: remove leverage from position history and fix max drawdown calculation
- Remove leverage column from position history table - Fix max drawdown calculation using virtual starting equity - Add formula tooltips for all statistics metrics - Remove leverage parameter from pnlPct calculation
This commit is contained in:
@@ -2,6 +2,7 @@ package trader
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
"math"
|
||||
"nofx/store"
|
||||
"testing"
|
||||
"time"
|
||||
@@ -382,7 +383,8 @@ func TestHyperliquidBugScenario(t *testing.T) {
|
||||
}
|
||||
|
||||
expectedTotalPnL := 4.72 + 5.0 // Sum of both close trades
|
||||
if totalPnL != expectedTotalPnL {
|
||||
// Use tolerance for floating point comparison
|
||||
if math.Abs(totalPnL-expectedTotalPnL) > 0.01 {
|
||||
t.Errorf("Expected total PnL %.2f, got %.2f", expectedTotalPnL, totalPnL)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user