mirror of
https://github.com/vdemydiuk/mtapi.git
synced 2026-07-27 18:47:55 +00:00
Issue #87: Added event QuoteUpdate to MtApi5Client (MT5) for compatibility with MATLAB
This commit is contained in:
+4
-9
@@ -1,15 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace MtApi5
|
||||
namespace MtApi5
|
||||
{
|
||||
public class Mt5Quote
|
||||
{
|
||||
public string Instrument { get; private set; }
|
||||
public double Bid { get; private set; }
|
||||
public double Ask { get; private set; }
|
||||
public string Instrument { get; }
|
||||
public double Bid { get; }
|
||||
public double Ask { get; }
|
||||
|
||||
public Mt5Quote(string instrument, double bid, double ask)
|
||||
{
|
||||
|
||||
@@ -6,7 +6,6 @@ using MTApiService;
|
||||
using System.Collections;
|
||||
using System.ServiceModel;
|
||||
using MtApi5.Requests;
|
||||
using MtApi5.Responses;
|
||||
using Newtonsoft.Json;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
@@ -2293,6 +2292,7 @@ namespace MtApi5
|
||||
|
||||
#region Events
|
||||
public event QuoteHandler QuoteUpdated;
|
||||
public event EventHandler<Mt5QuoteEventArgs> QuoteUpdate;
|
||||
public event EventHandler<Mt5QuoteEventArgs> QuoteAdded;
|
||||
public event EventHandler<Mt5QuoteEventArgs> QuoteRemoved;
|
||||
public event EventHandler<Mt5ConnectionEventArgs> ConnectionStateChanged;
|
||||
@@ -2476,6 +2476,7 @@ namespace MtApi5
|
||||
{
|
||||
if (quote != null)
|
||||
{
|
||||
QuoteUpdate?.Invoke(this, new Mt5QuoteEventArgs(new Mt5Quote(quote.Instrument, quote.Bid, quote.Ask)));
|
||||
QuoteUpdated?.Invoke(this, quote.Instrument, quote.Bid, quote.Ask);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user