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

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