Issue #241: fixed issue of incorrect value of CloseTime in orders received from TradeMonitor

This commit is contained in:
Viacheslav Demydiuk
2025-10-08 16:23:16 +03:00
parent 2c4d9b130b
commit 0c874773e5
2 changed files with 5 additions and 8 deletions
+1 -1
View File
@@ -89,7 +89,7 @@ namespace MtApi.Monitors
{ {
//get closed orders from history with actual values //get closed orders from history with actual values
var historyOrders = ApiClient.GetOrders(OrderSelectSource.MODE_HISTORY) ?? []; var historyOrders = ApiClient.GetOrders(OrderSelectSource.MODE_HISTORY) ?? [];
closedOrders = closeOrdersTemp.Where(cot => historyOrders.Find(a => a.Ticket == cot.Ticket) != null).ToList(); closedOrders = historyOrders.Where(cot => closeOrdersTemp.Find(a => a.Ticket == cot.Ticket) != null).ToList();
} }
} }
+4 -7
View File
@@ -1,9 +1,6 @@
using System; using MtApi;
using System.Collections.Generic;
using System.Drawing;
using System.Globalization;
using MtApi;
using MtApi.Monitors; using MtApi.Monitors;
using System.Globalization;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace TestApiClientUI namespace TestApiClientUI
@@ -1088,12 +1085,12 @@ namespace TestApiClientUI
{ {
if (e.Opened != null) if (e.Opened != null)
{ {
PrintLog($"{sender.GetType()}: Opened orders - {string.Join(", ", e.Opened.Select(o => o.Ticket).ToList())}"); PrintLog($"{sender.GetType()}: Opened orders - {string.Join(", ", e.Opened.Select(o => new { o.Ticket, o.Symbol, o.OpenPrice, o.OpenTime }).ToList())}");
} }
if (e.Closed != null) if (e.Closed != null)
{ {
PrintLog($"{sender.GetType()}: Closed orders - {string.Join(", ", e.Closed.Select(o => o.Ticket).ToList())}"); PrintLog($"{sender.GetType()}: Closed orders - {string.Join(", ", e.Closed.Select(o => new { o.Ticket, o.Symbol, o.ClosePrice, o.CloseTime }).ToList())}");
} }
} }