static void Main(string[] args) { IBProxy proxy = new IBProxy(true); proxy.connect("127.0.0.1", 7496, 1); proxy.add("SPY"); proxy.add("STK.VXX"); proxy.add("OPT.VXX.C.20171117.35.5"); proxy.add("FUT.ES.20171215"); proxy.add("FOP.ES.C.20171215.2550"); Console.ReadKey(); }
static void Main(string[] args) { IBProxy proxy = new IBProxy(true); proxy.connect("127.0.0.1", 7496, 10); /* * proxy.OnPriceEvent += OnPrice; * proxy.OnGreeksEvent += OnGreeks; * * var spy = proxy.add("SPY"); * var vxx = proxy.add("STK.VXX"); * var vxx_call = proxy.add("OPT.VXX.C.20171117.35.5"); * var es = proxy.add("FUT.ES.20171215"); * var es_call = proxy.add("FOP.ES.C.20171215.2550"); * */ proxy.OnOpenOrderEvent += (msg) => { Console.WriteLine("Open Order, OrderID: {0}", msg.OrderId); }; proxy.OnOrderStatusEvent += (msg) => { Console.WriteLine("Order Status: {0}, {1}, {2}", msg.OrderId, msg.Status, msg.WhyHeld); }; Console.ReadKey(); proxy.placeOrderLMT("STK.BABA", "BUY", 200, 1.5); Console.WriteLine("Order Placed."); proxy.placeOrderLMT("OPT.VXX.P.20171110.33.5", "BUY", 2, 0.01); Console.WriteLine("Order Placed."); Console.ReadKey(); }