Update closing trade date on SL or TP
This commit is contained in:
@@ -450,6 +450,8 @@ public class TradingBotBase : ITradingBot
|
||||
if (internalPosition.Status.Equals(PositionStatus.Filled))
|
||||
{
|
||||
internalPosition.Status = PositionStatus.Finished;
|
||||
// Call HandleClosedPosition to ensure trade dates are properly updated
|
||||
await HandleClosedPosition(internalPosition);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1161,6 +1163,8 @@ public class TradingBotBase : ITradingBot
|
||||
{
|
||||
// Trade close on exchange => Should close trade manually
|
||||
await SetPositionStatus(signal.Identifier, PositionStatus.Finished);
|
||||
// Ensure trade dates are properly updated even for canceled/rejected positions
|
||||
await HandleClosedPosition(position);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user