/// <summary>
        /// конструктор
        /// </summary>
        public LmaxFixClient(string fixTradingIp, string fixMarketDataIp, string uiUrl, int port, string username, string password, DateTime startWorkingTime, DateTime endWorkingTime)
        {
            if (string.IsNullOrEmpty(username) ||
                string.IsNullOrEmpty(password) ||
                string.IsNullOrEmpty(fixTradingIp) ||
                string.IsNullOrEmpty(uiUrl) ||
                port <= 0)
            {
                SendLogMessage("Не удалось начать подключение, отсутствует один или несколько обязательных параметров", LogMessageType.Error);
                return;
            }

            _startWorkingTime = startWorkingTime;
            _endWorkingTime   = endWorkingTime;

            _fixTradingIp    = fixTradingIp;
            _fixMarketDataIp = fixMarketDataIp;
            _uiUrl           = uiUrl;
            _userName        = username;
            _password        = password;
            _port            = port;
            _isDemo          = uiUrl.Contains("demo");

            var settings = new StandartHeaderSettings
            {
                BeginString     = BeginString,
                SenderCompId    = username,
                TargetCompIdTrd = _targetCompIdTrd,
                TargetCompIdMd  = _targetCompIdMd,
                Username        = username,
                Password        = password
            };

            _creator = new FixMessageCreator(settings);
            _parser  = new FixMessageParser();

            _lmaxApi = new LmaxApi(_uiUrl);

            IsCreated = true;
        }
示例#2
0
        /// <summary>
        /// constructor
        /// конструктор
        /// </summary>
        public LmaxFixClient(string fixTradingIp, string fixMarketDataIp, string uiUrl, int port, string username, string password, DateTime startWorkingTime, DateTime endWorkingTime)
        {
            if (string.IsNullOrEmpty(username) ||
                string.IsNullOrEmpty(password) ||
                string.IsNullOrEmpty(fixTradingIp) ||
                string.IsNullOrEmpty(uiUrl) ||
                port <= 0)
            {
                SendLogMessage(OsLocalization.Market.Label57, LogMessageType.Error);
                return;
            }

            _startWorkingTime = startWorkingTime;
            _endWorkingTime   = endWorkingTime;

            _fixTradingIp    = fixTradingIp;
            _fixMarketDataIp = fixMarketDataIp;
            _uiUrl           = uiUrl;
            _userName        = username;
            _password        = password;
            _port            = port;
            _isDemo          = uiUrl.Contains("demo");

            var settings = new StandartHeaderSettings
            {
                BeginString     = BeginString,
                SenderCompId    = username,
                TargetCompIdTrd = _targetCompIdTrd,
                TargetCompIdMd  = _targetCompIdMd,
                Username        = username,
                Password        = password
            };

            _creator = new FixMessageCreator(settings);
            _parser  = new FixMessageParser();

            _lmaxApi = new LmaxApi(_uiUrl);

            IsCreated = true;
        }