Esempio n. 1
0
        public static StockBarSerie CreateDailyBarSerie(string name, string shortName, StockTick[] ticks)
        {
            // Arguments check
             if (ticks == null || ticks.Count() == 0)
             {
            throw new ArgumentNullException("ticks", "ticks must contain at least one tick");
             }

             StockBarSerie barSerie = new StockBarSerie(name, shortName, StockBar.StockBarType.Daily);
             barSerie.AppendDailyBars(ticks);
             return barSerie;
        }
Esempio n. 2
0
 public static StockBarSerie CreateRangeBarSerie(string name, string shortName, double range, StockTick[] ticks)
 {
     // Arguments check
      if (ticks == null || ticks.Count() == 0)
      {
     throw new ArgumentNullException("ticks", "ticks must contain at least one tick");
      }
      if (range < (ticks[0].Value / 10000))
      {
     throw new ArgumentOutOfRangeException("range", range, "range must be greater or equal to 0,01% of the value");
      }
      StockBarSerie barSerie = new StockBarSerie(name, shortName, StockBar.StockBarType.Range);
      barSerie.Range = range;
      barSerie.AppendRangeBars(ticks);
      return barSerie;
 }
Esempio n. 3
0
        public static StockBarSerie CreateIntradayBarSerie(string name, string shortName, int duration, StockTick[] ticks)
        {
            // Arguments check
             if (duration < 1)
             {
            throw new ArgumentOutOfRangeException("tickNumber", duration, "duration must be greater or equal to one minute");
             }
             if (ticks == null || ticks.Count() == 0)
             {
            throw new ArgumentNullException("ticks", "ticks must contain at least one tick");
             }

             StockBarSerie barSerie = new StockBarSerie(name, shortName, StockBar.StockBarType.Intraday);
             barSerie.Duration = duration;
             barSerie.AppendIntradayBars(ticks);
             return barSerie;
        }
Esempio n. 4
0
        public static StockBarSerie CreateTickBarSerie(string name, string shortName, int tickNumber, StockTick[] ticks)
        {
            // Arguments check
             if (tickNumber < 1)
             {
            throw new ArgumentOutOfRangeException("tickNumber", tickNumber, "TickNumber must be greater or equal to one");
             }
             if (ticks == null || ticks.Count() == 0)
             {
            throw new ArgumentNullException("ticks", "ticks must contain at least one tick");
             }

             StockBarSerie barSerie = new StockBarSerie(name, shortName, StockBar.StockBarType.Tick);
             barSerie.TickNumber = tickNumber;
             barSerie.AppendTickBars(ticks);
             return barSerie;
        }