Exemplo n.º 1
0
        private void ProcessSecurityLookup(SecurityLookupMessage lookupMsg)
        {
            var secTypes = lookupMsg.GetSecurityTypes();

            foreach (var info in _httpClient.GetPairsInfo())
            {
                var secMsg = new SecurityMessage
                {
                    SecurityId            = info.Name.ToStockSharp(),
                    SecurityType          = info.UrlSymbol == _eurusd ? SecurityTypes.Currency : SecurityTypes.CryptoCurrency,
                    MinVolume             = info.MinimumOrder.Substring(0, info.MinimumOrder.IndexOf(' ')).To <decimal>(),
                    Decimals              = info.BaseDecimals,
                    Name                  = info.Description,
                    VolumeStep            = info.UrlSymbol == _eurusd ? 0.00001m : 0.00000001m,
                    OriginalTransactionId = lookupMsg.TransactionId,
                };

                if (!secMsg.IsMatch(lookupMsg, secTypes))
                {
                    continue;
                }

                SendOutMessage(secMsg);
            }

            SendSubscriptionResult(lookupMsg);
        }