public IQFeedFrm() { TradeLink.API.TLServer tls; if (Properties.Settings.Default.TLClientAddress == string.Empty) tls = new TradeLink.Common.TLServer_WM(); else tls = new TradeLink.Common.TLServer_IP(Properties.Settings.Default.TLClientAddress, Properties.Settings.Default.TLClientPort); TrackEnabled = Util.TrackUsage(); Program = PROGRAM; InitializeComponent(); this.FormClosing += IQFeedFrm_FormClosing; _helper = new IQFeedHelper(tls); _helper.IgnoreAfterTimeWithBefore = Properties.Settings.Default.IgnoreAfterTimeWithBefore; _helper.IfBeforeTimeUseIgnoreAfter = Properties.Settings.Default.IfBeforeTimeUseIgnoreAfter; _helper.isPaperTradeEnabled = Properties.Settings.Default.PaperTrade; _helper.isPaperTradeUsingBidAsk = Properties.Settings.Default.PaperTradeUsesBidAsk; _helper.DtnPath = Properties.Settings.Default.DtnPath; _helper.port = Properties.Settings.Default.Port; _helper.ReleaseDeadSymbols = Properties.Settings.Default.ReleaseDeadSymbols; _helper.MktCodes = parsemkts(Properties.Resources.marketcenters); _helper.SendDebug += new DebugDelegate(_helper_SendDebug); _helper.Connected += new IQFeedHelper.booldel(_helper_Connected); _helper.SaveRawData = Properties.Settings.Default.SaveRawFeed; _helper.ReportLatency = Properties.Settings.Default.ReportLatency; _helper.IgnoreOutOfOrderTick = Properties.Settings.Default.IgnoreOutofOrderTicks; }
public IQFeedFrm() { TradeLink.API.TLServer tls; if (Properties.Settings.Default.TLClientAddress == string.Empty) { tls = new TradeLink.Common.TLServer_WM(); } else { tls = new TradeLink.Common.TLServer_IP(Properties.Settings.Default.TLClientAddress, Properties.Settings.Default.TLClientPort); } TrackEnabled = Util.TrackUsage(); Program = PROGRAM; InitializeComponent(); this.FormClosing += IQFeedFrm_FormClosing; _helper = new IQFeedHelper(tls); _helper.IgnoreAfterTimeWithBefore = Properties.Settings.Default.IgnoreAfterTimeWithBefore; _helper.IfBeforeTimeUseIgnoreAfter = Properties.Settings.Default.IfBeforeTimeUseIgnoreAfter; _helper.isPaperTradeEnabled = Properties.Settings.Default.PaperTrade; _helper.isPaperTradeUsingBidAsk = Properties.Settings.Default.PaperTradeUsesBidAsk; _helper.DtnPath = Properties.Settings.Default.DtnPath; _helper.port = Properties.Settings.Default.Port; _helper.ReleaseDeadSymbols = Properties.Settings.Default.ReleaseDeadSymbols; _helper.MktCodes = parsemkts(Properties.Resources.marketcenters); _helper.SendDebug += new DebugDelegate(_helper_SendDebug); _helper.Connected += new IQFeedHelper.booldel(_helper_Connected); _helper.SaveRawData = Properties.Settings.Default.SaveRawFeed; _helper.ReportLatency = Properties.Settings.Default.ReportLatency; _helper.IgnoreOutOfOrderTick = Properties.Settings.Default.IgnoreOutofOrderTicks; }
public void setup() { //AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); if (!isserverconok) { server = new TradeLink.Common.TLServer_WM(); con = new IQFeedHelper(server); con.VerboseDebugging = verbosesetting; con.SendDebug += new DebugDelegate(g.d); // get login information var data = Util.getfile(loginfile, g.d); Assert.IsFalse(string.IsNullOrWhiteSpace(data), "no login info"); var li = data.Split(Environment.NewLine.ToCharArray(), StringSplitOptions.RemoveEmptyEntries); Assert.AreEqual(3, li.Length, "missing login info"); // attempt to startup connection con.Start(li[userr], li[pwr], li[prodr], Util.TLBuild()); // wait a moment Util.sleep(4000); Assert.IsTrue(isserverconok, "server connection failed"); } if (isserverconok && !isclientconok) { var c = new TLClient_WM("tempiqclient", false); c.VerboseDebugging = verbosesetting; c.SendDebugEvent += new DebugDelegate(g.d); if (c.ProvidersAvailable[0] != Providers.IQFeed) { throw new Exception("unable to find test server"); } c.Mode(0, false); client = c; client.gotUnknownMessage += new MessageDelegate(client_gotUnknownMessage); // verify Assert.IsTrue(isclientconok, "client connection failed"); } // reset everything mt = new MessageTracker(); mt.VerboseDebugging = verbosesetting; blt = new BarListTracker(); mt.BLT = blt; mt.SendDebug += new DebugDelegate(g.d); mt.GotNewBar += new SymBarIntervalDelegate(mt_GotNewBar); recvbarcount = 0; msgok = true; g.d("iqfeed started."); // wait a moment Util.sleep(1000); }
//[TestFixtureTearDown] public void Stop() { // stop client if (client != null) { client.Disconnect(); } client = null; // stop server if (con != null) { con.Stop(); } con = null; g.d("iqfeed teardown"); }
//[TestFixtureTearDown] public void Stop() { // stop client if (client != null) { client.Disconnect(); } client = null; // stop server if (con != null) con.Stop(); con = null; g.d("iqfeed teardown"); }
public void setup() { //AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); if (!isserverconok) { server = new TradeLink.Common.TLServer_WM(); con = new IQFeedHelper(server); con.VerboseDebugging = verbosesetting; con.SendDebug += new DebugDelegate(g.d); // get login information var data = Util.getfile(loginfile, g.d); Assert.IsFalse(string.IsNullOrWhiteSpace(data), "no login info"); var li = data.Split(Environment.NewLine.ToCharArray(), StringSplitOptions.RemoveEmptyEntries); Assert.AreEqual(3, li.Length, "missing login info"); // attempt to startup connection con.Start(li[userr], li[pwr], li[prodr], Util.TLBuild()); // wait a moment Util.sleep(4000); Assert.IsTrue(isserverconok, "server connection failed"); } if (isserverconok && !isclientconok) { var c = new TLClient_WM("tempiqclient", false); c.VerboseDebugging = verbosesetting; c.SendDebugEvent += new DebugDelegate(g.d); if (c.ProvidersAvailable[0]!= Providers.IQFeed) throw new Exception("unable to find test server"); c.Mode(0, false); client = c; client.gotUnknownMessage += new MessageDelegate(client_gotUnknownMessage); // verify Assert.IsTrue(isclientconok, "client connection failed"); } // reset everything mt = new MessageTracker(); mt.VerboseDebugging = verbosesetting; blt = new BarListTracker(); mt.BLT = blt; mt.SendDebug += new DebugDelegate(g.d); mt.GotNewBar += new SymBarIntervalDelegate(mt_GotNewBar); recvbarcount = 0; msgok = true; g.d("iqfeed started."); // wait a moment Util.sleep(1000); }