static void removeChart(MetaTrader mt) { var selectedChart = selectChart(mt.InstrumentCharts); if (selectedChart != null) { mt.RemoveInstrumentChart(selectedChart); } }
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; }
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); }
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); } }
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); } } }
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); } } }