private static long _PeriodicityToMillis(Enums.Periodicity periodicity)
        {
            switch (periodicity)
            {
            case Enums.Periodicity.MINUTE:
                return(60 * 1000);

            case Enums.Periodicity.HOUR:
                return(60 * 60 * 1000);

            case Enums.Periodicity.DAY:
                return(24 * 60 * 60 * 1000);

            case Enums.Periodicity.WEEK:
                return(7 * 24 * 60 * 60 * 1000);

            case Enums.Periodicity.MONTH:
                return((long)TimeSpan.FromDays(30).TotalMilliseconds);

            case Enums.Periodicity.YEAR:
                return((long)TimeSpan.FromDays(365).TotalMilliseconds);

            default:
                return(60 * 1000);
            }
        }
 public static Bars GetHistory(Symbol symbol, Enums.Periodicity periodicity, int interval, int barsCount)
 {
     return(new Bars(symbol, GenerateRandomBars(symbol.Name, barsCount)));
 }
 public static Bars GetHistory(Symbol symbol, Enums.Periodicity periodicity, int interval, long startTimestamp)
 {
     return(new Bars(symbol, GenerateRandomBars(symbol.Name)));
 }