Backtest opti (#10)

* Opti backtest

* clean
This commit is contained in:
Oda
2025-02-06 15:47:24 +07:00
committed by GitHub
parent 0987fa76cf
commit 9819fe014e
9 changed files with 78 additions and 47 deletions

View File

@@ -142,10 +142,12 @@ namespace Managing.Application.Backtesting
bot.WalletBalances.Add(candles.FirstOrDefault().Date, balance);
foreach (var candle in candles)
{
bot.Candles.Add(candle);
bot.OptimizedCandles.Enqueue(candle);
bot.Run();
}
bot.Candles = new HashSet<Candle>(candles);
var finalPnl = bot.GetProfitAndLoss();
var winRate = bot.GetWinRate();
var optimizedMoneyManagement = TradingBox.GetBestMoneyManagement(candles, bot.Positions, moneyManagement);