Пример #1
0
        internal static void AddMapping(FuturesSymbolMapping mapping, IDictionary <FuturesSymbolKey, FuturesSymbolMapping> bloombergSymbol, IDictionary <FuturesSymbolKey, FuturesSymbolMapping> sendingSymbol, IDictionary <FuturesSymbolKey, FuturesSymbolMapping> receivingSymbol)
        {
            // only the bloomberg symbol is required
            if (!string.IsNullOrEmpty(mapping.PlatformReceivingSymbolRoot))
            {
                var receivingKey = new FuturesSymbolKey(mapping.PlatformId, mapping.PlatformReceivingSymbolRoot);
                receivingSymbol.Add(receivingKey, mapping);
            }

            // only the bloomberg symbol is required
            if (!string.IsNullOrEmpty(mapping.PlatformSendingSymbolRoot))
            {
                var sendingKey = new FuturesSymbolKey(mapping.PlatformId, mapping.PlatformSendingSymbolRoot);
                sendingSymbol.Add(sendingKey, mapping);
            }

            var bloombergKey = new FuturesSymbolKey(mapping.PlatformId, mapping.BloombergSymbolRoot);

            if (!bloombergSymbol.ContainsKey(bloombergKey))
            {
                bloombergSymbol.Add(bloombergKey, mapping);
            }
            else
            {
                bloombergSymbol[bloombergKey] = mapping;
            }
        }
Пример #2
0
        public void AddBloombergMapping(string platform, string bloombergRoot, string platformReceiveRoot, string platformSendRoot, decimal priceMultiplier)
        {
            var mapping = new FuturesSymbolMapping
            {
                PlatformId                  = platform.ToUpperInvariant(),
                BloombergSymbolRoot         = bloombergRoot.ToUpperInvariant(),
                PlatformReceivingSymbolRoot = platformReceiveRoot.ToUpperInvariant(),
                PlatformSendingSymbolRoot   = platformSendRoot.ToUpperInvariant(),
                PriceMultiplier             = priceMultiplier
            };

            AddMapping(mapping);
        }
Пример #3
0
 internal void AddMapping(FuturesSymbolMapping mapping)
 {
     AddMapping(mapping, _bloombergSymbol, _sendingSymbol, _receivingSymbol);
 }