예제 #1
0
파일: Program.cs 프로젝트: zhao0876/mtapi
        static MtInstrumentChart selectChart(List <MtInstrumentChart> instrumentCharts)
        {
            MtInstrumentChart result = null;

            if (instrumentCharts != null)
            {
                Console.WriteLine("Select Chart:");

                foreach (var chart in instrumentCharts)
                {
                    if (chart.Instrument != null)
                    {
                        Console.WriteLine("{0} - {1}", instrumentCharts.IndexOf(chart), chart.Instrument.Symbol);
                    }
                }

                string selectedIndexStr = Console.ReadLine();
                int    selectedIndex    = -1;
                int.TryParse(selectedIndexStr, out selectedIndex);

                if (selectedIndex >= 0 && selectedIndex < instrumentCharts.Count)
                {
                    result = instrumentCharts[selectedIndex];
                }
                else
                {
                    Console.WriteLine("ERROR: Invalid number of Chart!\nPress any key...");
                }
            }

            return(result);
        }
예제 #2
0
        public void RemoveInstrumentChart(MtInstrumentChart instrumentChart)
        {
            if (instrumentChart != null && mInstrumentCharts.Contains(instrumentChart) == true)
            {
                mInstrumentCharts.Remove(instrumentChart);

                instrumentChart.Stop();
            }
        }
예제 #3
0
        public void AddInstrumentChart(MtInstrumentChart instrumentChart)
        {
            if (instrumentChart != null && mInstrumentCharts.Contains(instrumentChart) == false)
            {
                mInstrumentCharts.Add(instrumentChart);

                instrumentChart.Start();
            }
        }
예제 #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 프로젝트: 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);
            }
        }
예제 #6
0
        public void RemoveInstrumentChart(MtInstrumentChart instrumentChart)
        {
            if (instrumentChart != null && mInstrumentCharts.Contains(instrumentChart) == true)
            {
                mInstrumentCharts.Remove(instrumentChart);

                instrumentChart.Stop();
            }
        }
예제 #7
0
        public void AddInstrumentChart(MtInstrumentChart instrumentChart)
        {
            if (instrumentChart != null && mInstrumentCharts.Contains(instrumentChart) == false)
            {
                mInstrumentCharts.Add(instrumentChart);

                instrumentChart.Start();
            }
        }