public Mt5Expert(int handle, string symbol, double bid, double ask, IMetaTraderHandler mtHandler, bool isTestMode) : base(handle, symbol, bid, ask, mtHandler) { IsTestMode = isTestMode; _stopTimer.Interval = StopExpertInterval; _stopTimer.Elapsed += _stopTimer_Elapsed; }
public void InitExpert(int expertHandle, int port, string symbol, double bid, double ask, IMetaTraderHandler mtHandler) { Debug.WriteLine("MtApiServerInstance::InitExpert: symbol = {0}, expertHandle = {1}, port = {2}", symbol, expertHandle, port); MtServer server = null; lock (mServersDictionary) { if (mServersDictionary.ContainsKey(port)) { server = mServersDictionary[port]; } else { server = new MtServer(port); server.Stopped += new EventHandler(server_Stopped); mServersDictionary[port] = server; server.Start(); } } var expert = new MtExpert(expertHandle, new MtQuote(symbol, bid, ask), mtHandler); lock (mExpertsDictionary) { mExpertsDictionary[expert.Handle] = expert; } server.AddExpert(expert); }
public MtExpert(int handle, MtQuote quote, IMetaTraderHandler mtHandler) { if (mtHandler == null) { throw new ArgumentNullException(nameof(mtHandler)); } Quote = quote; Handle = handle; _mtHadler = mtHandler; }
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 void InitExpert(int expertHandle, int port, string symbol, double bid, double ask, IMetaTraderHandler mtHandler) { if (mtHandler == null) { throw new ArgumentNullException(nameof(mtHandler)); } Log.InfoFormat("InitExpert: begin. symbol = {0}, expertHandle = {1}, port = {2}", symbol, expertHandle, port); MtServer server; lock (_servers) { if (_servers.ContainsKey(port)) { server = _servers[port]; } else { server = new MtServer(port); server.Stopped += server_Stopped; _servers[port] = server; server.Start(); } } var expert = new MtExpert(expertHandle, new MtQuote { Instrument = symbol, Bid = bid, Ask = ask, ExpertHandle = expertHandle }, mtHandler); lock (_experts) { _experts[expert.Handle] = expert; } server.AddExpert(expert); Log.Info("InitExpert: end"); }
public Mt5Expert(int handle, string symbol, double bid, double ask, IMetaTraderHandler mtHandler, bool isTestMode) : base(handle, symbol, bid, ask, mtHandler) { IsTestMode = isTestMode; }
public MtExpert(int handle, MtQuote quote, IMetaTraderHandler mtHandler) { Quote = quote; Handle = handle; _mtHadler = mtHandler; }
public MtExpert(int handle, MtQuote quote, IMetaTraderHandler mtHandler) { Quote = quote; Handle = handle; mMtHadler = mtHandler; }