예제 #1
0
파일: Program.cs 프로젝트: zhao0876/mtapi
        static void removeChart(MetaTrader mt)
        {
            var selectedChart = selectChart(mt.InstrumentCharts);

            if (selectedChart != null)
            {
                mt.RemoveInstrumentChart(selectedChart);
            }
        }
예제 #2
0
파일: Program.cs 프로젝트: linyunfeng/mtapi
        static MetaTrader createMetaTrader(string accountName, int accountNumber)
        {
            MetaTrader mt = new MetaTrader(accountName, accountNumber);

            mt.AddInstrument(new MtInstrument("EURUSD", 1.3, 1.4));
            mt.AddInstrument(new MtInstrument("EURJPY", 1.3, 1.4));
            mt.AddInstrument(new MtInstrument("EURAUD", 1.3, 1.4));
            mt.AddInstrument(new MtInstrument("USDAUD", 1.3, 1.4));
            mt.AddInstrument(new MtInstrument("USDJPY", 1.3, 1.4));

            return mt;
        }
예제 #3
0
파일: Program.cs 프로젝트: zhao0876/mtapi
        static MetaTrader createMetaTrader(string accountName, int accountNumber)
        {
            MetaTrader mt = new MetaTrader(accountName, accountNumber);

            mt.AddInstrument(new MtInstrument("EURUSD", 1.3, 1.4));
            mt.AddInstrument(new MtInstrument("EURJPY", 1.3, 1.4));
            mt.AddInstrument(new MtInstrument("EURAUD", 1.3, 1.4));
            mt.AddInstrument(new MtInstrument("USDAUD", 1.3, 1.4));
            mt.AddInstrument(new MtInstrument("USDJPY", 1.3, 1.4));

            return(mt);
        }
예제 #4
0
파일: Program.cs 프로젝트: zhao0876/mtapi
        static void addChart(MetaTrader mt)
        {
            Console.Clear();
            Console.WriteLine("Adding Chart.");

            var selectedIinstrument = selectInstrument(mt.Instruments);

            if (selectedIinstrument != null)
            {
                var instrumentChart = new MtInstrumentChart(selectedIinstrument);

                mt.AddInstrumentChart(instrumentChart);
            }
        }
예제 #5
0
파일: Program.cs 프로젝트: zhao0876/mtapi
        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);
                }
            }
        }
예제 #6
0
파일: Program.cs 프로젝트: linyunfeng/mtapi
        static void addChart(MetaTrader mt)
        {
            Console.Clear();
            Console.WriteLine("Adding Chart.");

            var selectedIinstrument = selectInstrument(mt.Instruments);

            if (selectedIinstrument != null)
            {
                var instrumentChart = new MtInstrumentChart(selectedIinstrument);

                mt.AddInstrumentChart(instrumentChart);
            }
        }
예제 #7
0
파일: Program.cs 프로젝트: linyunfeng/mtapi
        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);
                }
            }
        }
예제 #8
0
파일: Program.cs 프로젝트: linyunfeng/mtapi
        static void removeChart(MetaTrader mt)
        {
            var selectedChart = selectChart(mt.InstrumentCharts);

            if (selectedChart != null)
            {
                mt.RemoveInstrumentChart(selectedChart);
            }
        }