Ejemplo n.º 1
0
        /// <summary>
        /// Represent the equivalence of TickerPeriod enumeration used solely when communicating with exchange server.
        /// </summary>
        public static string ToParamValue(this TickerPeriod period)
        {
            switch (period)
            {
            case TickerPeriod.Min1:
                return("1min");

            case TickerPeriod.Min5:
                return("5min");

            case TickerPeriod.Min15:
                return("15min");

            case TickerPeriod.Min30:
                return("30min");

            case TickerPeriod.Min60:
                return("60min");

            case TickerPeriod.Hour4:
                return("4hour");

            case TickerPeriod.Day1:
                return("1day");

            case TickerPeriod.Mon1:
                return("1mon");

            case TickerPeriod.Week1:
                return("1week");

            case TickerPeriod.Year1:
                return("1year");

            default:
                return(period.ToString());
            }
        }
Ejemplo n.º 2
0
        public static string ToKey(this TickerPeriod period)
        {
            switch (period)
            {
            case TickerPeriod.Min1:
                return("1m");

            case TickerPeriod.Min5:
                return("5m");

            case TickerPeriod.Min15:
                return("15m");

            case TickerPeriod.Min30:
                return("30m");

            case TickerPeriod.Min60:
                return("1h");

            case TickerPeriod.Hour4:
                return("4h");

            case TickerPeriod.Day1:
                return("1d");

            case TickerPeriod.Mon1:
                return("1mon");

            case TickerPeriod.Week1:
                return("1w");

            case TickerPeriod.Year1:
                return("1y");

            default:
                return(period.ToString());
            }
        }