docker files fixes from liaqat
This commit is contained in:
74
src/Managing.Domain/Backtests/Backtest.cs
Normal file
74
src/Managing.Domain/Backtests/Backtest.cs
Normal file
@@ -0,0 +1,74 @@
|
||||
using Exilion.TradingAtomics;
|
||||
using Managing.Domain.Candles;
|
||||
using Managing.Domain.MoneyManagements;
|
||||
using Managing.Domain.Strategies;
|
||||
using Managing.Domain.Trades;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using static Managing.Common.Enums;
|
||||
|
||||
namespace Managing.Domain.Backtests;
|
||||
|
||||
public class Backtest
|
||||
{
|
||||
public Backtest(
|
||||
Ticker ticker,
|
||||
string scenario,
|
||||
List<Position> positions,
|
||||
List<Signal> signals,
|
||||
Timeframe timeframe,
|
||||
List<Candle> candles,
|
||||
BotType botType,
|
||||
string accountName)
|
||||
{
|
||||
Ticker = ticker;
|
||||
Positions = positions;
|
||||
Signals = signals;
|
||||
Timeframe = timeframe;
|
||||
Candles = candles;
|
||||
Scenario = scenario;
|
||||
BotType = botType;
|
||||
AccountName = accountName;
|
||||
}
|
||||
|
||||
[Required]
|
||||
public string Id { get; set; }
|
||||
[Required]
|
||||
public decimal FinalPnl { get; set; }
|
||||
[Required]
|
||||
public int WinRate { get; set; }
|
||||
[Required]
|
||||
public decimal GrowthPercentage { get; set; }
|
||||
[Required]
|
||||
public decimal HodlPercentage { get; set; }
|
||||
[Required]
|
||||
public Ticker Ticker { get; }
|
||||
[Required]
|
||||
public string Scenario { get; set; }
|
||||
[Required]
|
||||
public List<Position> Positions { get; }
|
||||
[Required]
|
||||
public List<Signal> Signals { get; }
|
||||
[Required]
|
||||
public Timeframe Timeframe { get; }
|
||||
[Required]
|
||||
public BotType BotType { get; }
|
||||
[Required]
|
||||
public string AccountName { get; }
|
||||
[Required]
|
||||
public List<Candle> Candles { get; }
|
||||
[Required]
|
||||
public PerformanceMetrics Statistics { get; set; }
|
||||
[Required]
|
||||
public decimal Fees { get; set; }
|
||||
[Required]
|
||||
public List<KeyValuePair<DateTime, decimal>> WalletBalances { get; set; }
|
||||
[Required]
|
||||
public MoneyManagement OptimizedMoneyManagement { get; set; }
|
||||
[Required]
|
||||
public MoneyManagement MoneyManagement { get; set; }
|
||||
|
||||
public string GetStringReport()
|
||||
{
|
||||
return $"{Ticker} | {Timeframe} | Positions: {Positions.Count} | Winrate: {WinRate}% | Pnl: {FinalPnl:#.##}$ | %Pnl: {GrowthPercentage:#.##}% | %Hodl: {HodlPercentage:#.##}%";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user