Fix getbalance + fix get orders for bot
This commit is contained in:
@@ -171,7 +171,7 @@ public class TradingBot : Bot, ITradingBot
|
||||
{
|
||||
Logger.LogInformation($"____________________{Name}____________________");
|
||||
Logger.LogInformation(
|
||||
$"Time : {DateTime.Now} - Server time {DateTime.Now.ToUniversalTime()} - Bot : {Name} - Type {BotType} - Ticker : {Ticker}");
|
||||
$"Time : {DateTime.Now} - Server time {DateTime.Now.ToUniversalTime()} - Last candle : {OptimizedCandles.Last().Date} - Bot : {Name} - Type {BotType} - Ticker : {Ticker}");
|
||||
}
|
||||
|
||||
var previousLastCandle = OptimizedCandles.LastOrDefault();
|
||||
@@ -646,11 +646,10 @@ public class TradingBot : Bot, ITradingBot
|
||||
{
|
||||
try
|
||||
{
|
||||
var test = await ExchangeService.CancelOrder(Account, Ticker);
|
||||
|
||||
var openOrders = await ExchangeService.GetOpenOrders(Account, Ticker);
|
||||
if (openOrders.Any())
|
||||
{
|
||||
// TODO: Check if position is open, do not cancel orders if position still open
|
||||
Logger.LogInformation($"Canceling all orders for {Ticker}");
|
||||
await ExchangeService.CancelOrder(Account, Ticker);
|
||||
var closePendingOrderStatus = await ExchangeService.CancelOrder(Account, Ticker);
|
||||
|
||||
Reference in New Issue
Block a user