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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user