Ejemplo n.º 1
0
        public IBars GetBars(ISymbol symbol, IScale scale)
        {
            if (l.IsDebugEnabled)
            {
                l.Debug("GetBars " + symbol + " " + scale);
            }
            lock (barss)
            {
                string key = symbol + "." + scale;
                if (barss.ContainsKey(key))
                {
                    return(barss[key]);
                }

                IBars newBars;
                if ((scale.scaleType == ScaleEnum.tick) && (scale.interval == 1))
                {
                    newBars = new Ticks(symbol);
                }
                else
                {
                    newBars = new AggregateBars(this, symbol, scale);
                }

                barss.Add(key, newBars);

                return(newBars);
            }
        }
Ejemplo n.º 2
0
        public IBars GetBars(ISymbol symbol, IScale scale)
        {
            if (l.IsDebugEnabled)
                l.Debug("GetBars " + symbol + " " + scale);
            lock (barss)
            {
                string key = symbol + "." + scale;
                if (barss.ContainsKey(key))
                    return barss[key];

                IBars newBars;
                if ((scale.scaleType == ScaleEnum.tick) && (scale.interval == 1))
                {
                    newBars = new Ticks(symbol);
                }
                else
                    newBars = new AggregateBars(this, symbol, scale);

                barss.Add(key, newBars);

                return newBars;
            }
        }