Optionnal cooldown
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
using System.Text.Json;
|
||||
using Managing.Api.Models.Requests;
|
||||
using Managing.Application.Abstractions;
|
||||
using Managing.Application.Abstractions.Services;
|
||||
using Managing.Application.Hubs;
|
||||
using Managing.Domain.Backtests;
|
||||
@@ -372,7 +371,7 @@ public class BacktestController : BaseController
|
||||
IsForWatchingOnly = request.Config.IsForWatchingOnly,
|
||||
BotTradingBalance = request.Config.BotTradingBalance,
|
||||
IsForBacktest = true,
|
||||
CooldownPeriod = request.Config.CooldownPeriod,
|
||||
CooldownPeriod = request.Config.CooldownPeriod ?? 1,
|
||||
MaxLossStreak = request.Config.MaxLossStreak,
|
||||
MaxPositionTimeHours = request.Config.MaxPositionTimeHours,
|
||||
FlipOnlyWhenInProfit = request.Config.FlipOnlyWhenInProfit,
|
||||
|
||||
@@ -218,7 +218,7 @@ public class BotController : BaseController
|
||||
}
|
||||
|
||||
var result = await _mediator.Send(new StopAllUserBotsCommand(user));
|
||||
|
||||
|
||||
if (result)
|
||||
{
|
||||
await NotifyBotSubscriberAsync();
|
||||
@@ -724,7 +724,7 @@ public class BotController : BaseController
|
||||
Timeframe = request.Config.Timeframe,
|
||||
IsForWatchingOnly = request.Config.IsForWatchingOnly,
|
||||
BotTradingBalance = request.Config.BotTradingBalance,
|
||||
CooldownPeriod = request.Config.CooldownPeriod,
|
||||
CooldownPeriod = request.Config.CooldownPeriod ?? 1,
|
||||
MaxLossStreak = request.Config.MaxLossStreak,
|
||||
MaxPositionTimeHours = request.Config.MaxPositionTimeHours,
|
||||
FlipOnlyWhenInProfit = request.Config.FlipOnlyWhenInProfit,
|
||||
@@ -886,7 +886,7 @@ public class BotController : BaseController
|
||||
Timeframe = request.Config.Timeframe,
|
||||
IsForWatchingOnly = request.Config.IsForWatchingOnly,
|
||||
BotTradingBalance = request.Config.BotTradingBalance,
|
||||
CooldownPeriod = request.Config.CooldownPeriod,
|
||||
CooldownPeriod = request.Config.CooldownPeriod ?? 1,
|
||||
MaxLossStreak = request.Config.MaxLossStreak,
|
||||
MaxPositionTimeHours = request.Config.MaxPositionTimeHours,
|
||||
FlipOnlyWhenInProfit = request.Config.FlipOnlyWhenInProfit,
|
||||
|
||||
@@ -256,7 +256,7 @@ public class BundleBacktestWorker : BaseWorker<BundleBacktestWorker>
|
||||
IsForWatchingOnly = runBacktestRequest.Config.IsForWatchingOnly,
|
||||
BotTradingBalance = runBacktestRequest.Config.BotTradingBalance,
|
||||
IsForBacktest = true,
|
||||
CooldownPeriod = runBacktestRequest.Config.CooldownPeriod,
|
||||
CooldownPeriod = runBacktestRequest.Config.CooldownPeriod ?? 1,
|
||||
MaxLossStreak = runBacktestRequest.Config.MaxLossStreak,
|
||||
MaxPositionTimeHours = runBacktestRequest.Config.MaxPositionTimeHours,
|
||||
FlipOnlyWhenInProfit = runBacktestRequest.Config.FlipOnlyWhenInProfit,
|
||||
|
||||
@@ -50,13 +50,11 @@ public class TradingBotConfigRequest
|
||||
/// <summary>
|
||||
/// Cooldown period between trades (in candles)
|
||||
/// </summary>
|
||||
[Required]
|
||||
public int CooldownPeriod { get; set; }
|
||||
public int? CooldownPeriod { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Maximum consecutive losses before stopping the bot
|
||||
/// </summary>
|
||||
[Required]
|
||||
public int MaxLossStreak { get; set; }
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -4073,8 +4073,8 @@ export interface TradingBotConfigRequest {
|
||||
botTradingBalance: number;
|
||||
name: string;
|
||||
flipPosition: boolean;
|
||||
cooldownPeriod: number;
|
||||
maxLossStreak: number;
|
||||
cooldownPeriod?: number;
|
||||
maxLossStreak?: number;
|
||||
scenario?: ScenarioRequest | null;
|
||||
scenarioName?: string | null;
|
||||
moneyManagementName?: string | null;
|
||||
|
||||
@@ -556,8 +556,8 @@ export interface TradingBotConfigRequest {
|
||||
botTradingBalance: number;
|
||||
name: string;
|
||||
flipPosition: boolean;
|
||||
cooldownPeriod: number;
|
||||
maxLossStreak: number;
|
||||
cooldownPeriod?: number;
|
||||
maxLossStreak?: number;
|
||||
scenario?: ScenarioRequest | null;
|
||||
scenarioName?: string | null;
|
||||
moneyManagementName?: string | null;
|
||||
|
||||
Reference in New Issue
Block a user