Fix Wallet balances
This commit is contained in:
@@ -296,7 +296,8 @@ namespace Managing.Application.Backtesting
|
||||
var optimizedMoneyManagement =
|
||||
TradingBox.GetBestMoneyManagement(candles, bot.Positions, config.MoneyManagement);
|
||||
var stats = TradingHelpers.GetStatistics(bot.WalletBalances);
|
||||
var growthPercentage = TradingHelpers.GetGrowthFromInitalBalance(config.BotTradingBalance, finalPnl);
|
||||
var growthPercentage =
|
||||
TradingHelpers.GetGrowthFromInitalBalance(bot.WalletBalances.FirstOrDefault().Value, finalPnl);
|
||||
var hodlPercentage = TradingHelpers.GetHodlPercentage(candles[0], candles.Last());
|
||||
|
||||
var fees = bot.GetTotalFees();
|
||||
|
||||
@@ -1313,7 +1313,7 @@ public class TradingBot : Bot, ITradingBot
|
||||
|
||||
public decimal GetProfitAndLoss()
|
||||
{
|
||||
var pnl = Positions.Where(p => p.ProfitAndLoss != null).Sum(p => p.ProfitAndLoss.Realized);
|
||||
var pnl = Positions.Where(p => p.ProfitAndLoss != null && p.IsFinished()).Sum(p => p.ProfitAndLoss.Realized);
|
||||
return pnl - GetTotalFees();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user