mirror of
https://github.com/vdemydiuk/mtapi.git
synced 2026-08-15 19:58:10 +00:00
Issue #290: provide information about Period (Timeframe) in event Mt5TimeBar
This commit is contained in:
@@ -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; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user