Add new parameters
This commit is contained in:
@@ -67,7 +67,9 @@ namespace Managing.Application.Backtesting
|
||||
bool save = false,
|
||||
List<Candle>? initialCandles = null,
|
||||
int cooldownPeriod = 1,
|
||||
int maxLossStreak = 0)
|
||||
int maxLossStreak = 0,
|
||||
decimal? maxPositionTimeHours = null,
|
||||
bool flipOnlyWhenInProfit = true)
|
||||
{
|
||||
var config = new TradingBotConfig
|
||||
{
|
||||
@@ -81,7 +83,9 @@ namespace Managing.Application.Backtesting
|
||||
BotType = BotType.ScalpingBot,
|
||||
IsForBacktest = true,
|
||||
CooldownPeriod = cooldownPeriod,
|
||||
MaxLossStreak = maxLossStreak
|
||||
MaxLossStreak = maxLossStreak,
|
||||
MaxPositionTimeHours = maxPositionTimeHours,
|
||||
FlipOnlyWhenInProfit = flipOnlyWhenInProfit
|
||||
};
|
||||
|
||||
var scalpingBot = _botFactory.CreateBacktestScalpingBot(config);
|
||||
@@ -122,7 +126,9 @@ namespace Managing.Application.Backtesting
|
||||
bool save = false,
|
||||
List<Candle>? initialCandles = null,
|
||||
int cooldownPeriod = 1,
|
||||
int maxLossStreak = 0)
|
||||
int maxLossStreak = 0,
|
||||
decimal? maxPositionTimeHours = null,
|
||||
bool flipOnlyWhenInProfit = true)
|
||||
{
|
||||
var config = new TradingBotConfig
|
||||
{
|
||||
@@ -136,7 +142,9 @@ namespace Managing.Application.Backtesting
|
||||
BotType = BotType.FlippingBot,
|
||||
IsForBacktest = true,
|
||||
CooldownPeriod = cooldownPeriod,
|
||||
MaxLossStreak = maxLossStreak
|
||||
MaxLossStreak = maxLossStreak,
|
||||
MaxPositionTimeHours = maxPositionTimeHours,
|
||||
FlipOnlyWhenInProfit = flipOnlyWhenInProfit
|
||||
};
|
||||
|
||||
var flippingBot = _botFactory.CreateBacktestFlippingBot(config);
|
||||
@@ -173,7 +181,9 @@ namespace Managing.Application.Backtesting
|
||||
decimal balance,
|
||||
User user = null,
|
||||
int cooldownPeriod = 1,
|
||||
int maxLossStreak = 0)
|
||||
int maxLossStreak = 0,
|
||||
decimal? maxPositionTimeHours = null,
|
||||
bool flipOnlyWhenInProfit = true)
|
||||
{
|
||||
var ticker = MiscExtensions.ParseEnum<Ticker>(candles.FirstOrDefault().Ticker);
|
||||
var config = new TradingBotConfig
|
||||
@@ -188,7 +198,9 @@ namespace Managing.Application.Backtesting
|
||||
BotType = BotType.ScalpingBot,
|
||||
IsForBacktest = true,
|
||||
CooldownPeriod = cooldownPeriod,
|
||||
MaxLossStreak = maxLossStreak
|
||||
MaxLossStreak = maxLossStreak,
|
||||
MaxPositionTimeHours = maxPositionTimeHours,
|
||||
FlipOnlyWhenInProfit = flipOnlyWhenInProfit
|
||||
};
|
||||
|
||||
var bot = _botFactory.CreateBacktestScalpingBot(config);
|
||||
@@ -215,7 +227,9 @@ namespace Managing.Application.Backtesting
|
||||
decimal balance,
|
||||
User user = null,
|
||||
int cooldownPeriod = 1,
|
||||
int maxLossStreak = 0)
|
||||
int maxLossStreak = 0,
|
||||
decimal? maxPositionTimeHours = null,
|
||||
bool flipOnlyWhenInProfit = true)
|
||||
{
|
||||
var ticker = MiscExtensions.ParseEnum<Ticker>(candles.FirstOrDefault().Ticker);
|
||||
var config = new TradingBotConfig
|
||||
@@ -230,7 +244,9 @@ namespace Managing.Application.Backtesting
|
||||
BotType = BotType.FlippingBot,
|
||||
IsForBacktest = true,
|
||||
CooldownPeriod = cooldownPeriod,
|
||||
MaxLossStreak = maxLossStreak
|
||||
MaxLossStreak = maxLossStreak,
|
||||
MaxPositionTimeHours = maxPositionTimeHours,
|
||||
FlipOnlyWhenInProfit = flipOnlyWhenInProfit
|
||||
};
|
||||
|
||||
var bot = _botFactory.CreateBacktestFlippingBot(config);
|
||||
|
||||
Reference in New Issue
Block a user