private MT4Router CreateRouter(ISignalServiceRepository signalServiceRepository) { OperationResult <ServerConfiguration[]> serversData; while (true) { try { serversData = accService.GetServerConfigurations(); if (!serversData.IsSuccess) { throw new Exception(serversData.Error); } break; } catch (EndpointNotFoundException) { Thread.Sleep(1000); } } var res = serversData.Result; var names = res.Select(x => x.Name).ToArray(); var confs = res.Select(x => x.Ip).ToArray(); var ports = res.Select(x => x.Port).ToArray(); return(new MT4Router(names, confs, ports)); }
public ConsistencyController(ISignalServiceRepository repository, IServerController serverController, IAccountService accountService) { this.accountService = accountService; this.repository = repository; this.serverController = serverController; serverController.OrdersStatus += HandleOrderStatusResponse; }
public TradeSignalProcessor(ISignalServiceRepository signalServiceRepository, IMT4Router serversController, IAccountService accountService) { this.signalServiceRepository = signalServiceRepository; this.accountService = accountService; serversRouter = serversController; FillServersDictionary(); FillAccountsDictionary(); }
private const int consistencyControlInterval = 60 * 5; // Interval in seconds #endregion #region Constructor public SignalService(ISignalServiceRepository signalServiceRepository, IAccountService accService, IZeroMqServer server) { Logger.Info("Starting signal service..."); Logger.Info("Starting wcf service..."); this.signalServiceRepository = signalServiceRepository; this.accService = accService; this.server = server; }