@@ -308,11 +308,14 @@ public class TradingBot : Bot, ITradingBot
|
||||
{
|
||||
await HandleClosedPosition(positionForSignal);
|
||||
}
|
||||
else if (position.Status == PositionStatus.Filled)
|
||||
else if (position.Status == (PositionStatus.Filled | PositionStatus.PartiallyFilled))
|
||||
{
|
||||
// For backtesting or force close if not executed on exchange :
|
||||
// check if position is still open
|
||||
// Check status, if still open update the status of the position
|
||||
|
||||
// Position might be partially filled, meaning that TPSL havent been sended yet
|
||||
// But the position might already been closed by the exchange so we have to check should be closed
|
||||
var lastCandle = IsForBacktest
|
||||
? OptimizedCandles.Last()
|
||||
: ExchangeService.GetCandle(Account, Ticker, DateTime.UtcNow);
|
||||
|
||||
Reference in New Issue
Block a user