Clean tradingbot and spot and future

This commit is contained in:
2025-12-11 14:10:38 +07:00
parent 292a48d108
commit df8c199cce
5 changed files with 32 additions and 61 deletions

View File

@@ -36,12 +36,12 @@ public class BacktestSpotBot : TradingBotBase, ITradingBot
// Backtest mode: Skip account loading and broker initialization
// Just log basic startup info
await LogInformation($"🔬 Backtest Spot Bot Started\n" +
$"📊 Testing Setup:\n" +
$"🎯 Ticker: `{Config.Ticker}`\n" +
$"⏰ Timeframe: `{Config.Timeframe}`\n" +
$"🎮 Scenario: `{Config.Scenario?.Name ?? "Unknown"}`\n" +
$"💰 Initial Balance: `${Config.BotTradingBalance:F2}`\n" +
$"✅ Ready to run spot backtest simulation");
$"📊 Testing Setup:\n" +
$"🎯 Ticker: `{Config.Ticker}`\n" +
$"⏰ Timeframe: `{Config.Timeframe}`\n" +
$"🎮 Scenario: `{Config.Scenario?.Name ?? "Unknown"}`\n" +
$"💰 Initial Balance: `${Config.BotTradingBalance:F2}`\n" +
$"✅ Ready to run spot backtest simulation");
}
public override async Task Run()
@@ -67,12 +67,6 @@ public class BacktestSpotBot : TradingBotBase, ITradingBot
return position;
}
protected override async Task<List<Position>> GetBrokerPositionsForUpdate(Account account)
{
// In backtest mode, return empty list (no broker positions to check)
return new List<Position>();
}
protected override async Task UpdatePositionWithBrokerData(Position position, List<Position> brokerPositions)
{
// In backtest mode, skip broker synchronization
@@ -247,7 +241,8 @@ public class BacktestSpotBot : TradingBotBase, ITradingBot
// Only LONG signals should reach here (SHORT signals are filtered out earlier)
if (signal.Direction != TradeDirection.Long)
{
throw new InvalidOperationException($"Only LONG signals can open positions in spot trading. Received: {signal.Direction}");
throw new InvalidOperationException(
$"Only LONG signals can open positions in spot trading. Received: {signal.Direction}");
}
if (Account == null || Account.User == null)
@@ -330,5 +325,4 @@ public class BacktestSpotBot : TradingBotBase, ITradingBot
}
}
}
}
}