Fix Wallet balances
This commit is contained in:
@@ -296,7 +296,8 @@ namespace Managing.Application.Backtesting
|
|||||||
var optimizedMoneyManagement =
|
var optimizedMoneyManagement =
|
||||||
TradingBox.GetBestMoneyManagement(candles, bot.Positions, config.MoneyManagement);
|
TradingBox.GetBestMoneyManagement(candles, bot.Positions, config.MoneyManagement);
|
||||||
var stats = TradingHelpers.GetStatistics(bot.WalletBalances);
|
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 hodlPercentage = TradingHelpers.GetHodlPercentage(candles[0], candles.Last());
|
||||||
|
|
||||||
var fees = bot.GetTotalFees();
|
var fees = bot.GetTotalFees();
|
||||||
|
|||||||
@@ -1313,7 +1313,7 @@ public class TradingBot : Bot, ITradingBot
|
|||||||
|
|
||||||
public decimal GetProfitAndLoss()
|
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();
|
return pnl - GetTotalFees();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user