Position management (#12)

* Update position worker

* Update todo

* Update todo

* Update worker base url
This commit is contained in:
Oda
2025-02-20 12:13:49 +07:00
committed by GitHub
parent 160fd02aac
commit 31f7f4cbfc
3 changed files with 10 additions and 6 deletions

View File

@@ -238,6 +238,8 @@ ________________________________________________________________________________
- [ ] Add Tyk API Gateway for rate limit between n8n and Managing API - [ ] Add Tyk API Gateway for rate limit between n8n and Managing API
- [ ] New database Postgre for N8N and Botpress (agent profiles, built strategies, stats) - [ ] New database Postgre for N8N and Botpress (agent profiles, built strategies, stats)
- [ ] Deploy database for Chat and Agent Profiles
_____________________________________________________________________________________________________________ _____________________________________________________________________________________________________________
# Front-end # Front-end

View File

@@ -18,7 +18,7 @@ using OpenApiSecurityScheme = NSwag.OpenApiSecurityScheme;
// Builder // Builder
var builder = WebApplication.CreateBuilder(args); var builder = WebApplication.CreateBuilder(args);
builder.WebHost.UseUrls("http://localhost:5001"); // builder.WebHost.UseUrls("http://localhost:5001");
builder.Configuration.SetBasePath(AppContext.BaseDirectory); builder.Configuration.SetBasePath(AppContext.BaseDirectory);
builder.Configuration.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true) builder.Configuration.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
.AddJsonFile($"appsettings.{builder.Environment.EnvironmentName}.json"); .AddJsonFile($"appsettings.{builder.Environment.EnvironmentName}.json");

View File

@@ -163,16 +163,18 @@ public class TradingBot : Bot, ITradingBot
Logger.LogInformation( Logger.LogInformation(
$"Time : {DateTime.Now} - Server time {DateTime.Now.ToUniversalTime()} - Bot : {Name} - Type {BotType} - Ticker : {Ticker}"); $"Time : {DateTime.Now} - Server time {DateTime.Now.ToUniversalTime()} - Bot : {Name} - Type {BotType} - Ticker : {Ticker}");
var previousCandleCount = OptimizedCandles.Count; var previousLastCandle = OptimizedCandles.LastOrDefault();
if (!IsForBacktest) if (!IsForBacktest)
await UpdateCandles(); await UpdateCandles();
if (OptimizedCandles.Count > previousCandleCount || IsForBacktest) var currentLastCandle = OptimizedCandles.LastOrDefault();
if (currentLastCandle != previousLastCandle || IsForBacktest)
await UpdateSignals(OptimizedCandles); await UpdateSignals(OptimizedCandles);
else else
Logger.LogInformation($"No need to update signals for {Ticker}"); Logger.LogInformation($"No need to update signals for {Ticker}");
if (!IsForWatchingOnly) if (!IsForWatchingOnly)
await ManagePositions(); await ManagePositions();