public void OnQuoteAdded(MtQuote quote) { Log.DebugFormat("OnQuoteAdded: begin. quote = {0}", quote); QuoteAdded?.Invoke(quote); Log.Debug("OnQuoteAdded: end."); }
private void expert_QuoteChanged(MtExpert expert, MtQuote quote) { Log.DebugFormat("expert_QuoteChanged: begin. expert = {0}, quote = {1}", expert, quote); _service.QuoteUpdate(quote); Log.Debug("expert_QuoteChanged: end."); }
public void OnQuoteRemoved(MtQuote quote) { Debug.WriteLine("[INFO] MtClient::OnQuoteRemoved"); if (QuoteRemoved != null) { QuoteRemoved(quote); } }
private void FireOnQuoteChanged(MtQuote quote) { var handler = QuoteChanged; if (handler != null) { handler(this, quote); } }
public MtExpert(int handle, MtQuote quote, IMetaTraderHandler mtHandler) { if (mtHandler == null) { throw new ArgumentNullException(nameof(mtHandler)); } Quote = quote; Handle = handle; _mtHadler = mtHandler; }
public void OnQuoteUpdate(MtQuote quote) { if (quote != null) { if (QuoteUpdated != null) { QuoteUpdated(quote); } Debug.WriteLine("[INFO] MtClient::OnQuoteUpdate: " + quote); } }
public void OnQuoteUpdate(MtQuote quote) { Log.DebugFormat("OnQuoteUpdate: begin. quote = {0}", quote); if (quote == null) { return; } QuoteUpdated?.Invoke(quote); Log.Debug("OnQuoteUpdate: end."); }
public MtExpert(int handle, string symbol, double bid, double ask, IMetaTraderHandler mtHandler) { if (mtHandler == null) { throw new ArgumentNullException(nameof(mtHandler)); } _quote = new MtQuote { ExpertHandle = handle, Instrument = symbol, Bid = bid, Ask = ask }; Handle = handle; _mtHadler = mtHandler; }
public override void UpdateQuote(MtQuote quote) { Log.Debug("UpdateQuote: begin."); base.UpdateQuote(quote); if (IsTestMode) { //reset timer _stopTimer.Stop(); _stopTimer.Start(); } Log.Debug("UpdateQuote: end."); }
public void OnQuoteRemoved(MtQuote quote) { try { mClientsLocker.AcquireReaderLock(2000); List <IMtApiCallback> crashedClientsCallback = null; try { foreach (var callback in mClientCallbacks) { try { callback.OnQuoteRemoved(quote); } catch (Exception) { if (crashedClientsCallback == null) { crashedClientsCallback = new List <IMtApiCallback>(); } crashedClientsCallback.Add(callback); } } } finally { mClientsLocker.ReleaseReaderLock(); } removeCrashedClientCallbacks(crashedClientsCallback); } catch (ApplicationException) { } }
public void OnQuoteRemoved(MtQuote quote) { ExecuteCallbackAction(a => a.OnQuoteRemoved(quote)); }
public void QuoteUpdate(MtQuote quote) { ExecuteCallbackAction(a => a.OnQuoteUpdate(quote)); }
private void FireOnQuoteChanged(MtQuote quote) { QuoteChanged?.Invoke(this, quote); }
public MtExpert(int handle, MtQuote quote, IMetaTraderHandler mtHandler) { Quote = quote; Handle = handle; mMtHadler = mtHandler; }
private void expert_QuoteChanged(MtExpert expert, MtQuote quote) { mService.QuoteUpdate(quote); }
public void OnQuoteRemoved(MtQuote quote) { try { mClientsLocker.AcquireReaderLock(2000); List<IMtApiCallback> crashedClientsCallback = null; try { foreach (var callback in mClientCallbacks) { try { callback.OnQuoteRemoved(quote); } catch (Exception) { if (crashedClientsCallback == null) crashedClientsCallback = new List<IMtApiCallback>(); crashedClientsCallback.Add(callback); } } } finally { mClientsLocker.ReleaseReaderLock(); } removeCrashedClientCallbacks(crashedClientsCallback); } catch (ApplicationException) { } }
public MtExpert(int handle, MtQuote quote, IMetaTraderHandler mtHandler) { Quote = quote; Handle = handle; _mtHadler = mtHandler; }
public void OnQuoteRemoved(MtQuote quote) { Debug.WriteLine("[INFO] MtClient::OnQuoteRemoved"); QuoteRemoved?.Invoke(quote); }