diff --git a/MtApi/Monitors/AvailabilityOrdersEventArgs.cs b/MtApi/Monitors/AvailabilityOrdersEventArgs.cs
index f6bea3c8..3f569321 100644
--- a/MtApi/Monitors/AvailabilityOrdersEventArgs.cs
+++ b/MtApi/Monitors/AvailabilityOrdersEventArgs.cs
@@ -10,8 +10,13 @@ namespace MtApi.Monitors
Opened = opened;
Closed = closed;
}
-
+ ///
+ /// Contains all newly opened orders since the last time the monitor checked the open orders.
+ ///
public List Opened { get; private set; }
+ ///
+ /// Contains all newly closed orders since the last time the monitor checked the open orders.
+ ///
public List Closed { get; private set; }
}
}
diff --git a/MtApi/Monitors/TimeframeTradeMonitor.cs b/MtApi/Monitors/TimeframeTradeMonitor.cs
index e76306d8..8d08a0b2 100644
--- a/MtApi/Monitors/TimeframeTradeMonitor.cs
+++ b/MtApi/Monitors/TimeframeTradeMonitor.cs
@@ -4,6 +4,11 @@ namespace MtApi.Monitors
{
public class TimeframeTradeMonitor : TradeMonitor
{
+ ///
+ /// Constructor for initializing a new instance with a trigger instance of .
+ /// SyncTrigger is set to true by default
+ ///
+ /// The which will be used to communicate with MetaTrader.
public TimeframeTradeMonitor(MtApiClient apiClient)
: base(apiClient, new NewBarTrigger(apiClient))
{
diff --git a/MtApi/Monitors/TimerTradeMonitor.cs b/MtApi/Monitors/TimerTradeMonitor.cs
index ccf249a4..769ada89 100644
--- a/MtApi/Monitors/TimerTradeMonitor.cs
+++ b/MtApi/Monitors/TimerTradeMonitor.cs
@@ -5,22 +5,43 @@ namespace MtApi.Monitors
{
public class TimerTradeMonitor : TradeMonitor
{
+ #region Fields
private readonly TimeElapsedTrigger _timeElapsedTrigger;
+ #endregion
+
+ #region Properties
+ ///
+ /// Interval for raising the trigger
+ ///
public double Interval
{
get => _timeElapsedTrigger.Interval.TotalMilliseconds;
set => _timeElapsedTrigger.Interval = TimeSpan.FromMilliseconds(value);
}
+ #endregion
+ #region ctors
+ ///
+ /// Constructor for initializing a new instance with a default of 10 seconds.
+ /// SyncTrigger is set to true by default
+ ///
+ /// The which will be used to communicate with MetaTrader.
public TimerTradeMonitor(MtApiClient apiClient)
: this(apiClient, new TimeElapsedTrigger(TimeSpan.FromSeconds(10)))
{
SyncTrigger = true; //Sync-Trigger set to true, to have the same behavior as before
}
+ ///
+ /// Constructor for initializing a new instance with a custom instance of .
+ /// SyncTrigger is set to false by default
+ ///
+ /// The which will be used to communicate with MetaTrader.
+ /// The custom instance of which will be used to trigger this instance of .
public TimerTradeMonitor(MtApiClient apiClient, TimeElapsedTrigger timeElapsedTrigger)
: base(apiClient, timeElapsedTrigger)
{
_timeElapsedTrigger = timeElapsedTrigger;
}
+ #endregion
}
}
\ No newline at end of file
diff --git a/MtApi/Monitors/TradeMonitor.cs b/MtApi/Monitors/TradeMonitor.cs
index d1e498ca..a80361a0 100644
--- a/MtApi/Monitors/TradeMonitor.cs
+++ b/MtApi/Monitors/TradeMonitor.cs
@@ -21,6 +21,11 @@ namespace MtApi.Monitors
#endregion
#region ctor
+ ///
+ /// Constructor for initializing an instance of .
+ ///
+ /// The which will be used to communicate with MetaTrader.
+ /// The custom instance of which will be used to trigger this instance of .
public TradeMonitor(MtApiClient apiClient, IMonitorTrigger monitorTrigger) : base(apiClient, monitorTrigger) { }
#endregion
diff --git a/MtApi/Monitors/Triggers/NewBarTrigger.cs b/MtApi/Monitors/Triggers/NewBarTrigger.cs
index 2c4cdc4e..4c39109b 100644
--- a/MtApi/Monitors/Triggers/NewBarTrigger.cs
+++ b/MtApi/Monitors/Triggers/NewBarTrigger.cs
@@ -12,22 +12,46 @@ namespace MtApi.Monitors.Triggers
private readonly MtApiClient _apiClient;
#endregion
+ #region Properties
+ ///
+ /// Returns true if the trigger is started, otherwise false
+ ///
public bool IsStarted => _isStarted;
+ #endregion
+
+ #region Events
+ ///
+ /// Event will be called if the trigger raised.
+ ///
public event EventHandler Raised;
+ #endregion
+
+ #region ctor
public NewBarTrigger(MtApiClient apiClient)
{
_apiClient = apiClient;
_apiClient.OnLastTimeBar += _apiClient_OnLastTimeBar;
}
+ #endregion
+ #region Public methods
+ ///
+ /// Starts the trigger
+ ///
+ public void Start() => SetIsStarted(true);
+ ///
+ /// Stops the trigger
+ ///
+ public void Stop() => SetIsStarted(false);
+ #endregion
+
+ #region Private methods
private void _apiClient_OnLastTimeBar(object sender, TimeBarArgs e)
{
if (_isStarted)
Raised?.Invoke(this, EventArgs.Empty);
}
- public void Start() => SetIsStarted(true);
- public void Stop() => SetIsStarted(false);
private void SetIsStarted(bool value)
{
if (value != _isStarted)
@@ -39,5 +63,6 @@ namespace MtApi.Monitors.Triggers
_apiClient.OnLastTimeBar -= _apiClient_OnLastTimeBar;
}
}
+ #endregion
}
}
diff --git a/MtApi/Monitors/Triggers/TimeElapsedTrigger.cs b/MtApi/Monitors/Triggers/TimeElapsedTrigger.cs
index ba085fd1..65d0b59d 100644
--- a/MtApi/Monitors/Triggers/TimeElapsedTrigger.cs
+++ b/MtApi/Monitors/Triggers/TimeElapsedTrigger.cs
@@ -5,9 +5,11 @@ namespace MtApi.Monitors.Triggers
{
public class TimeElapsedTrigger : IMonitorTrigger
{
+ #region Fields
readonly Timer _timer;
+ #endregion
- public event EventHandler Raised;
+ #region Properties
///
/// Interval for raising the trigger
///
@@ -16,25 +18,57 @@ namespace MtApi.Monitors.Triggers
get => TimeSpan.FromMilliseconds(_timer.Interval);
set => _timer.Interval = value.TotalMilliseconds;
}
+
+ ///
+ /// Returns true if the trigger is started, otherwise false
+ ///
public bool IsStarted => _timer.Enabled;
+ ///
+ /// If true, the trigger will raise continuosly after elapsed , otherwise the trigger will raise only once after elapsed .
+ ///
public bool AutoReset { get => _timer.AutoReset; set => _timer.AutoReset = value; }
+ #endregion
+ #region Events
+ ///
+ /// Returns true if the trigger is started, otherwise false
+ ///
+ public event EventHandler Raised;
+ #endregion
+
+ #region ctor
+ ///
+ /// Constructor for initializing TimeElapsedTrigger
+ ///
+ /// Defines the interval for raising the event.
+ /// If true, the trigger will raise continuosly after elapsed , otherwise the trigger will raise only once after elapsed .
public TimeElapsedTrigger(TimeSpan time, bool autoReset = true)
{
_timer = new Timer(time.TotalMilliseconds);
_timer.Elapsed += _timer_Elapsed;
AutoReset = autoReset;
}
+ #endregion
+ #region Public methods
+ ///
+ /// Starts the trigger
+ ///
+ public void Start() => _timer.Start();
+ ///
+ /// Stops the trigger
+ ///
+ public void Stop() => _timer.Stop();
+ #endregion
+
+ #region private methods
private void _timer_Elapsed(object sender, ElapsedEventArgs e)
{
_timer.Elapsed -= _timer_Elapsed;
Raised?.Invoke(this, EventArgs.Empty);
_timer.Elapsed += _timer_Elapsed;
}
- public void Stop() => _timer.Stop();
-
- public void Start() => _timer.Start();
+ #endregion
}
-}
+}
\ No newline at end of file