Refactor FuturesBot and SpotBot to utilize ticker enum for candle retrieval

- Updated GetCurrentCandleForPositionClose method in both FuturesBot and SpotBot to parse the ticker parameter into an enum, enhancing type safety and clarity.
- Adjusted TradingBotBase to use the position's ticker for candle retrieval, ensuring consistency across trading bot implementations.
This commit is contained in:
2026-01-07 01:44:05 +07:00
parent a0859b6a0d
commit bc4725ca19
3 changed files with 8 additions and 4 deletions

View File

@@ -477,7 +477,7 @@ public abstract class TradingBotBase : ITradingBot
{
lastCandle = TradingBox.IsBacktestTrading(Config.TradingType)
? LastCandle
: await exchangeService.GetCandle(Account, Config.Ticker,
: await exchangeService.GetCandle(Account, positionForSignal.Ticker,
DateTime.UtcNow);
});
@@ -1177,7 +1177,7 @@ public abstract class TradingBotBase : ITradingBot
{
if (Positions.ContainsKey(position.Identifier))
{
Candle currentCandle = await GetCurrentCandleForPositionClose(Account, Config.Ticker.ToString());
Candle currentCandle = await GetCurrentCandleForPositionClose(Account, position.Ticker.ToString());
// Try broker history reconciliation first
var brokerHistoryReconciled = await ReconcileWithBrokerHistory(position, currentCandle);