Issue #290: provide information about Period (Timeframe) in event Mt5TimeBar

This commit is contained in:
Viacheslav Demydiuk
2026-04-06 21:55:59 +03:00
parent 9d178280d0
commit 3699b73cf7
4 changed files with 6 additions and 3 deletions
+3 -1
View File
@@ -4,15 +4,17 @@ namespace MtApi5
{
public class Mt5TimeBarArgs: EventArgs
{
internal Mt5TimeBarArgs(int expertHandle, string symbol, MqlRates rates)
internal Mt5TimeBarArgs(int expertHandle, string symbol, ENUM_TIMEFRAMES timeframe, MqlRates rates)
{
ExpertHandle = expertHandle;
Rates = rates;
Symbol = symbol;
Timeframe = timeframe;
}
public int ExpertHandle { get; }
public string Symbol { get; }
public ENUM_TIMEFRAMES Timeframe { get; }
public MqlRates Rates { get; }
}
}
+1 -1
View File
@@ -3546,7 +3546,7 @@ namespace MtApi5
var e = JsonConvert.DeserializeObject<OnLastTimeBarEvent>(payload);
if (e == null || string.IsNullOrEmpty(e.Instrument) || e.Rates == null)
return;
OnLastTimeBar?.Invoke(this, new Mt5TimeBarArgs(expertHandle, e.Instrument, e.Rates));
OnLastTimeBar?.Invoke(this, new Mt5TimeBarArgs(expertHandle, e.Instrument, e.Timeframe, e.Rates));
}
private void ReceivedOnLockTicksEvent(int expertHandle, string payload)
+1
View File
@@ -4,6 +4,7 @@
{
public MqlRates? Rates { get; set; }
public string? Instrument { get; set; }
public ENUM_TIMEFRAMES Timeframe { get; set; }
public int ExpertHandle { get; set; }
}
}