static void Main(string[] args) { try { baseUrl = args.Length > 0 ? args[0] : null; if (string.IsNullOrEmpty(baseUrl)) { Console.WriteLine("String is null or empty"); return; } mmRestService = MarketMakerRestServiceFactory.CreateMakerRestService(baseUrl, "/oauth/token", authorization); mmRestService.Authorize("admin", "admin"); var ws = new SubscriptionFactory("wss://18.218.146.41:8990/websocket/v0", mmRestService.Token); // Receive instrument by ID _instrument = mmRestService.GetInstrument(_algoId); _originalBuyMargins = _instrument.PricerConfig.BuyMargins; _originalSellMargins = _instrument.PricerConfig.SellMargins; var tradeStatisticsSubs = ws.CreateTradingStatisticsSubscription(); // Subscribe for trade statistics tradeStatisticsSubs.Subscribe(OnStatisticsMessage); Console.ReadLine(); tradeStatisticsSubs.Unsubscribe(OnStatisticsMessage); ws.Close(); Console.ReadLine(); /* * Console.Clear(); * var menuItems = GetMenuItems(); * var options = GetMenuOptions(); * ShowOptions(menuItems, options); * while (true) * { * Console.Write("Select option and press Enter:"); * var s = Console.ReadLine(); * if (string.IsNullOrWhiteSpace(s)) * s = " "; * else * s = s.ToLower(); * if (s.Contains("clear") || s.Contains("cls")) * { * Console.Clear(); * ShowOptions(menuItems, options); * continue; * } * if (s.Contains("exit") || s.Contains("quit")) * { * return; * } * var option = GetChoice(options, s[0]); * if (option == -1 || option >= menuItems.Length) * { * Console.WriteLine("Incorrect choice."); * Console.WriteLine(); * ShowOptions(menuItems, options); * continue; * } * try * { * Console.WriteLine($"('{menuItems[option].Item1}' was selected)"); * menuItems[option].Item2(); * } * catch (Exception ex) * { * Console.WriteLine(ex.ToString()); * } * } */ } catch (Exception e) { Console.WriteLine(e.ToString()); } }