public void GetsTickData() { InteractiveBrokersGatewayRunner.StartFromConfiguration(); var ib = new InteractiveBrokersBrokerage(new OrderProvider()); ib.Connect(); ib.Subscribe(null, new List<Symbol> {Symbols.USDJPY, Symbols.EURGBP}); Thread.Sleep(1000); for (int i = 0; i < 10; i++) { foreach (var tick in ib.GetNextTicks()) { Console.WriteLine("{0}: {1} - {2} @ {3}", tick.Time, tick.Symbol, tick.Price, ((Tick)tick).Quantity); } } InteractiveBrokersGatewayRunner.Stop(); }
public void GetsTickData() { InteractiveBrokersGatewayRunner.StartFromConfiguration(); var ib = new InteractiveBrokersBrokerage(new OrderMapping()); ib.Connect(); ib.Subscribe(null, new Dictionary<SecurityType, List<string>> { {SecurityType.Forex, new List<string>{"USDJPY", "EURGBP"}} }); Thread.Sleep(1000); for (int i = 0; i < 10; i++) { foreach (var tick in ib.GetNextTicks()) { Console.WriteLine("{0}: {1} - {2} @ {3}", tick.Time, tick.Symbol, tick.Price, ((Tick)tick).Quantity); } } InteractiveBrokersGatewayRunner.Stop(); }