Пример #1
0
 private void InitTransientFields()
 {
     baseSymbol = MarketEventSymbols.GetBaseSymbol(symbol);
     if (exchange == null)
     {
         exchange = CandleExchange.GetAttributeForSymbol(symbol);
     }
     if (price == null)
     {
         price = CandlePrice.GetAttributeForSymbol(symbol);
     }
     if (session == null)
     {
         session = CandleSession.GetAttributeForSymbol(symbol);
     }
     if (period == null)
     {
         period = CandlePeriod.GetAttributeForSymbol(symbol);
     }
     if (alignment == null)
     {
         alignment = CandleAlignment.GetAttributeForSymbol(symbol);
     }
     if (priceLevel == null)
     {
         priceLevel = CandlePriceLevel.GetAttributeForSymbol(symbol);
     }
 }
Пример #2
0
        /// <summary>
        /// Returns candle symbol string with the normalized representation of the candle price type attribute.
        /// </summary>
        /// <param name="symbol">candle symbol string.</param>
        /// <returns>candle symbol string with the normalized representation of the the candle price type attribute.</returns>
        public static string NormalizeAttributeForSymbol(string symbol)
        {
            string a = MarketEventSymbols.GetAttributeStringByKey(symbol, ATTRIBUTE_KEY);

            if (a == null)
            {
                return(symbol);
            }
            try
            {
                CandlePrice other = Parse(a);
                if (other == DEFAULT)
                {
                    MarketEventSymbols.RemoveAttributeStringByKey(symbol, ATTRIBUTE_KEY);
                }
                if (!a.Equals(other.ToString()))
                {
                    return(MarketEventSymbols.ChangeAttributeStringByKey(symbol, ATTRIBUTE_KEY, other.ToString()));
                }
                return(symbol);
            }
            catch (ArgumentNullException)
            {
                return(symbol);
            }
        }
Пример #3
0
 private static string Normalize(string symbol)
 {
     symbol = CandlePrice.NormalizeAttributeForSymbol(symbol);
     symbol = CandleSession.NormalizeAttributeForSymbol(symbol);
     symbol = CandlePeriod.NormalizeAttributeForSymbol(symbol);
     symbol = CandleAlignment.NormalizeAttributeForSymbol(symbol);
     symbol = CandlePriceLevel.NormalizeAttributeForSymbol(symbol);
     return(symbol);
 }