Fix status and filtered positions for metrics
This commit is contained in:
@@ -91,10 +91,10 @@ public class MessengerService : IMessengerService
|
||||
private string BuildClosePositionMessage(Position position)
|
||||
{
|
||||
return $"Closing : {position.OriginDirection} {position.Open.Ticker} \n" +
|
||||
$"Open Price : {position.Open.Price} \n" +
|
||||
$"Closing Price : {position.Open.Price} \n" +
|
||||
$"Quantity :{position.Open.Quantity} \n" +
|
||||
$"PNL : {position.ProfitAndLoss.Realized} $";
|
||||
$"Open Price : {position.Open.Price} \n" +
|
||||
$"Closing Price : {position.Open.Price} \n" +
|
||||
$"Quantity :{position.Open.Quantity} \n" +
|
||||
$"PNL : {position.ProfitAndLoss.Realized} $";
|
||||
}
|
||||
|
||||
public async Task SendMessage(string message, string telegramChannel)
|
||||
@@ -114,21 +114,23 @@ public class MessengerService : IMessengerService
|
||||
|
||||
if (position.Open != null)
|
||||
{
|
||||
message += $"\nOpen Trade: {position.Open.Quantity:F5} @ {position.Open.Price:F5}";
|
||||
message += $"\nOpen Trade: {position.Open.Price:F5}";
|
||||
}
|
||||
|
||||
if (position.StopLoss != null){
|
||||
message += $"\nStop Loss: {position.StopLoss.Quantity:F5} @ {position.StopLoss.Price:F5}";
|
||||
if (position.StopLoss != null)
|
||||
{
|
||||
message += $"\nStop Loss: {position.StopLoss.Price:F5}";
|
||||
}
|
||||
|
||||
if (position.TakeProfit1 != null){
|
||||
message += $"\nTake Profit 1: {position.TakeProfit1.Quantity:F5} @ {position.TakeProfit1.Price:F5}";
|
||||
if (position.TakeProfit1 != null)
|
||||
{
|
||||
message += $"\nTake Profit 1: {position.TakeProfit1.Price:F5}";
|
||||
}
|
||||
|
||||
if (position.ProfitAndLoss != null)
|
||||
{
|
||||
var pnlEmoji = position.ProfitAndLoss.Realized >= 0 ? "✅" : "❌";
|
||||
message += $"\nPnL: {pnlEmoji} ${position.ProfitAndLoss.Realized:F5}";
|
||||
var pnlEmoji = position.ProfitAndLoss.Net >= 0 ? "✅" : "❌";
|
||||
message += $"\nPnL: {pnlEmoji} ${position.ProfitAndLoss.Net:F5}";
|
||||
}
|
||||
|
||||
return message;
|
||||
|
||||
Reference in New Issue
Block a user