Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        public void RemoveInstrumentChart(MtInstrumentChart instrumentChart)
        {
            if (instrumentChart != null && mInstrumentCharts.Contains(instrumentChart) == true)
            {
                mInstrumentCharts.Remove(instrumentChart);

                instrumentChart.Stop();
            }
        }
Exemplo n.º 3
0
        public void AddInstrumentChart(MtInstrumentChart instrumentChart)
        {
            if (instrumentChart != null && mInstrumentCharts.Contains(instrumentChart) == false)
            {
                mInstrumentCharts.Add(instrumentChart);

                instrumentChart.Start();
            }
        }
Exemplo n.º 4
0
        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);
            }
        }
Exemplo n.º 5
0
        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);
            }
        }
Exemplo n.º 6
0
        public void RemoveInstrumentChart(MtInstrumentChart instrumentChart)
        {
            if (instrumentChart != null && mInstrumentCharts.Contains(instrumentChart) == true)
            {
                mInstrumentCharts.Remove(instrumentChart);

                instrumentChart.Stop();
            }
        }
Exemplo n.º 7
0
        public void AddInstrumentChart(MtInstrumentChart instrumentChart)
        {
            if (instrumentChart != null && mInstrumentCharts.Contains(instrumentChart) == false)
            {
                mInstrumentCharts.Add(instrumentChart);

                instrumentChart.Start();
            }
        }