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

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

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

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

                instrumentChart.Start();
            }
        }