Move workers
This commit is contained in:
@@ -3,7 +3,7 @@ using System.Diagnostics;
|
||||
using Managing.Application.Abstractions;
|
||||
using Managing.Application.Abstractions.Repositories;
|
||||
using Managing.Application.Abstractions.Services;
|
||||
using Managing.Application.Backtesting;
|
||||
using Managing.Application.Backtests;
|
||||
using Managing.Application.Hubs;
|
||||
using Managing.Core;
|
||||
using Managing.Domain.Bots;
|
||||
@@ -84,7 +84,7 @@ namespace Managing.Application.Tests
|
||||
// Act
|
||||
var backtestResult =
|
||||
await _backtester.RunTradingBotBacktest(config, DateTime.UtcNow.AddDays(-6),
|
||||
DateTime.UtcNow, null, false, false);
|
||||
DateTime.UtcNow, null, false, false);
|
||||
|
||||
var json = JsonConvert.SerializeObject(backtestResult, Formatting.None);
|
||||
File.WriteAllText($"{ticker}-{timeframe}-{Guid.NewGuid()}.json", json);
|
||||
@@ -256,43 +256,43 @@ namespace Managing.Application.Tests
|
||||
{
|
||||
BotType.SimpleBot => throw new NotImplementedException(),
|
||||
BotType.ScalpingBot => _backtester.RunTradingBotBacktest(new TradingBotConfig
|
||||
{
|
||||
AccountName = _account.Name,
|
||||
MoneyManagement = moneyManagement,
|
||||
Ticker = ticker,
|
||||
Scenario = LightScenario.FromScenario(scenario),
|
||||
Timeframe = timeframe,
|
||||
IsForWatchingOnly = false,
|
||||
BotTradingBalance = 1000,
|
||||
IsForBacktest = true,
|
||||
CooldownPeriod = 1,
|
||||
MaxLossStreak = 0,
|
||||
FlipPosition = false,
|
||||
Name = "Test",
|
||||
FlipOnlyWhenInProfit = true,
|
||||
MaxPositionTimeHours = null,
|
||||
CloseEarlyWhenProfitable = false
|
||||
}, DateTime.UtcNow.AddDays(-6),
|
||||
DateTime.UtcNow, null, false, false).Result,
|
||||
{
|
||||
AccountName = _account.Name,
|
||||
MoneyManagement = moneyManagement,
|
||||
Ticker = ticker,
|
||||
Scenario = LightScenario.FromScenario(scenario),
|
||||
Timeframe = timeframe,
|
||||
IsForWatchingOnly = false,
|
||||
BotTradingBalance = 1000,
|
||||
IsForBacktest = true,
|
||||
CooldownPeriod = 1,
|
||||
MaxLossStreak = 0,
|
||||
FlipPosition = false,
|
||||
Name = "Test",
|
||||
FlipOnlyWhenInProfit = true,
|
||||
MaxPositionTimeHours = null,
|
||||
CloseEarlyWhenProfitable = false
|
||||
}, DateTime.UtcNow.AddDays(-6),
|
||||
DateTime.UtcNow, null, false, false).Result,
|
||||
BotType.FlippingBot => _backtester.RunTradingBotBacktest(new TradingBotConfig
|
||||
{
|
||||
AccountName = _account.Name,
|
||||
MoneyManagement = moneyManagement,
|
||||
Ticker = ticker,
|
||||
Scenario = LightScenario.FromScenario(scenario),
|
||||
Timeframe = timeframe,
|
||||
IsForWatchingOnly = false,
|
||||
BotTradingBalance = 1000,
|
||||
IsForBacktest = true,
|
||||
CooldownPeriod = 1,
|
||||
MaxLossStreak = 0,
|
||||
FlipPosition = true,
|
||||
Name = "Test",
|
||||
FlipOnlyWhenInProfit = true,
|
||||
MaxPositionTimeHours = null,
|
||||
CloseEarlyWhenProfitable = false
|
||||
}, DateTime.UtcNow.AddDays(-6),
|
||||
DateTime.UtcNow, null, false, false).Result,
|
||||
{
|
||||
AccountName = _account.Name,
|
||||
MoneyManagement = moneyManagement,
|
||||
Ticker = ticker,
|
||||
Scenario = LightScenario.FromScenario(scenario),
|
||||
Timeframe = timeframe,
|
||||
IsForWatchingOnly = false,
|
||||
BotTradingBalance = 1000,
|
||||
IsForBacktest = true,
|
||||
CooldownPeriod = 1,
|
||||
MaxLossStreak = 0,
|
||||
FlipPosition = true,
|
||||
Name = "Test",
|
||||
FlipOnlyWhenInProfit = true,
|
||||
MaxPositionTimeHours = null,
|
||||
CloseEarlyWhenProfitable = false
|
||||
}, DateTime.UtcNow.AddDays(-6),
|
||||
DateTime.UtcNow, null, false, false).Result,
|
||||
_ => throw new NotImplementedException(),
|
||||
};
|
||||
timer.Stop();
|
||||
@@ -399,43 +399,43 @@ namespace Managing.Application.Tests
|
||||
{
|
||||
BotType.SimpleBot => throw new NotImplementedException(),
|
||||
BotType.ScalpingBot => _backtester.RunTradingBotBacktest(new TradingBotConfig
|
||||
{
|
||||
AccountName = _account.Name,
|
||||
MoneyManagement = moneyManagement,
|
||||
Ticker = ticker,
|
||||
Scenario = LightScenario.FromScenario(scenario),
|
||||
Timeframe = timeframe,
|
||||
IsForWatchingOnly = false,
|
||||
BotTradingBalance = 1000,
|
||||
IsForBacktest = true,
|
||||
CooldownPeriod = 1,
|
||||
MaxLossStreak = 0,
|
||||
FlipPosition = false,
|
||||
Name = "Test",
|
||||
FlipOnlyWhenInProfit = true,
|
||||
MaxPositionTimeHours = null,
|
||||
CloseEarlyWhenProfitable = false
|
||||
}, DateTime.UtcNow.AddDays(-6),
|
||||
DateTime.UtcNow, null, false, false).Result,
|
||||
{
|
||||
AccountName = _account.Name,
|
||||
MoneyManagement = moneyManagement,
|
||||
Ticker = ticker,
|
||||
Scenario = LightScenario.FromScenario(scenario),
|
||||
Timeframe = timeframe,
|
||||
IsForWatchingOnly = false,
|
||||
BotTradingBalance = 1000,
|
||||
IsForBacktest = true,
|
||||
CooldownPeriod = 1,
|
||||
MaxLossStreak = 0,
|
||||
FlipPosition = false,
|
||||
Name = "Test",
|
||||
FlipOnlyWhenInProfit = true,
|
||||
MaxPositionTimeHours = null,
|
||||
CloseEarlyWhenProfitable = false
|
||||
}, DateTime.UtcNow.AddDays(-6),
|
||||
DateTime.UtcNow, null, false, false).Result,
|
||||
BotType.FlippingBot => _backtester.RunTradingBotBacktest(new TradingBotConfig
|
||||
{
|
||||
AccountName = _account.Name,
|
||||
MoneyManagement = moneyManagement,
|
||||
Ticker = ticker,
|
||||
Scenario = LightScenario.FromScenario(scenario),
|
||||
Timeframe = timeframe,
|
||||
IsForWatchingOnly = false,
|
||||
BotTradingBalance = 1000,
|
||||
IsForBacktest = true,
|
||||
CooldownPeriod = 1,
|
||||
MaxLossStreak = 0,
|
||||
FlipPosition = true,
|
||||
Name = "Test",
|
||||
FlipOnlyWhenInProfit = true,
|
||||
MaxPositionTimeHours = null,
|
||||
CloseEarlyWhenProfitable = false
|
||||
}, DateTime.UtcNow.AddDays(-6),
|
||||
DateTime.UtcNow, null, false, false).Result,
|
||||
{
|
||||
AccountName = _account.Name,
|
||||
MoneyManagement = moneyManagement,
|
||||
Ticker = ticker,
|
||||
Scenario = LightScenario.FromScenario(scenario),
|
||||
Timeframe = timeframe,
|
||||
IsForWatchingOnly = false,
|
||||
BotTradingBalance = 1000,
|
||||
IsForBacktest = true,
|
||||
CooldownPeriod = 1,
|
||||
MaxLossStreak = 0,
|
||||
FlipPosition = true,
|
||||
Name = "Test",
|
||||
FlipOnlyWhenInProfit = true,
|
||||
MaxPositionTimeHours = null,
|
||||
CloseEarlyWhenProfitable = false
|
||||
}, DateTime.UtcNow.AddDays(-6),
|
||||
DateTime.UtcNow, null, false, false).Result,
|
||||
_ => throw new NotImplementedException(),
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user