Ejemplo n.º 1
0
        static void addExpert(MetaTrader mt)
        {
            var selectedChart = selectChart(mt.InstrumentCharts);

            if (selectedChart != null)
            {
                bool isController = false;

                Console.WriteLine("Is Expert controller (y/n) ?");

                ConsoleKeyInfo keyInfo = Console.ReadKey();
                Console.WriteLine();

                switch (keyInfo.Key)
                {
                case ConsoleKey.N:
                    isController = false;
                    break;

                case ConsoleKey.Y:
                    isController = true;
                    break;
                }

                Console.WriteLine("Input Port property (8222 - default): ");

                string portStr = Console.ReadLine();
                int    port    = 8222;
                if (int.TryParse(portStr, out port) == false)
                {
                    port = 8222;
                }
                var expert = new MtQuoteExpert(mt, port, isController);

                if (expert != null)
                {
                    selectedChart.AddExpert(expert);
                }
            }
        }
Ejemplo n.º 2
0
        static void addExpert(MetaTrader mt)
        {
            var selectedChart = selectChart(mt.InstrumentCharts);

            if (selectedChart != null)
            {
                bool isController = false;

                Console.WriteLine("Is Expert controller (y/n) ?");

                ConsoleKeyInfo keyInfo = Console.ReadKey();
                Console.WriteLine();

                switch (keyInfo.Key)
                {
                    case ConsoleKey.N:
                        isController = false;
                        break;
                    case ConsoleKey.Y:
                        isController = true;
                        break;
                }

                Console.WriteLine("Input Port property (8222 - default): ");

                string portStr = Console.ReadLine();
                int port = 8222;
                if (int.TryParse(portStr, out port) == false)
                    port = 8222;
                var expert = new MtQuoteExpert(mt, port, isController);

                if (expert != null)
                {
                    selectedChart.AddExpert(expert);
                }
            }
        }