mirror of
https://github.com/vdemydiuk/mtapi.git
synced 2026-08-03 14:07:48 +00:00
27 lines
905 B
C#
27 lines
905 B
C#
using System;
|
|
using MtApi.Monitors.Triggers;
|
|
|
|
namespace MtApi.Monitors
|
|
{
|
|
public class TimerTradeMonitor : TradeMonitor
|
|
{
|
|
private readonly TimeElapsedTrigger _timeElapsedTrigger;
|
|
public double Interval
|
|
{
|
|
get => _timeElapsedTrigger.Interval.TotalMilliseconds;
|
|
set => _timeElapsedTrigger.Interval = TimeSpan.FromMilliseconds(value);
|
|
}
|
|
|
|
public TimerTradeMonitor(MtApiClient apiClient)
|
|
: this(apiClient, new TimeElapsedTrigger(TimeSpan.FromSeconds(10)))
|
|
{
|
|
|
|
}
|
|
public TimerTradeMonitor(MtApiClient apiClient, TimeElapsedTrigger timeElapsedTrigger)
|
|
: base(apiClient, timeElapsedTrigger)
|
|
{
|
|
SyncTrigger = true; //Sync-Trigger set to true, to have the same behavior as before
|
|
_timeElapsedTrigger = timeElapsedTrigger;
|
|
}
|
|
}
|
|
} |