Ejemplo n.º 1
0
                public SourceInfo(ICandleSource <Candle> source, CandleManager manager)
                {
                    _source  = source ?? throw new ArgumentNullException(nameof(source));
                    _manager = manager;

                    _source.Processing += OnProcessing;
                }
Ejemplo n.º 2
0
            public CandleManagerSourceList(CandleManager manager)
            {
                if (manager == null)
                {
                    throw new ArgumentNullException(nameof(manager));
                }

                _manager = manager;
            }
Ejemplo n.º 3
0
        /// <summary>
        /// Освободить занятые ресурсы.
        /// </summary>
        protected override void DisposeManaged()
        {
            base.DisposeManaged();

            if (CandleManager != null)
            {
                CandleManager.Stop(this);
            }
        }
Ejemplo n.º 4
0
                public SourceInfo(ICandleSource <Candle> source, CandleManager manager)
                {
                    if (source == null)
                    {
                        throw new ArgumentNullException(nameof(source));
                    }

                    _source  = source;
                    _manager = manager;

                    _source.Processing += OnProcessing;
                    _source.Error      += _manager.RaiseError;
                }
Ejemplo n.º 5
0
                public CandleEnumerator(CandleSeries series, IEnumerable <TValue> values)
                {
                    _series = series;

                    _valuesEnumerator = values.GetEnumerator();

                    _candleManager             = new CandleManager();
                    _candleManager.Processing += OnProcessCandle;

                    _builderSource = new EnumeratorCandleBuilderSource(series.Security);
                    _candleManager.Sources.OfType <ICandleBuilder>().ForEach(b => b.Sources.Add(_builderSource));

                    _candleManager.Start(series);
                }
Ejemplo n.º 6
0
                public SourceInfo(ICandleManagerSource source, CandleManager manager)
                {
                    if (source == null)
                    {
                        throw new ArgumentNullException("source");
                    }

                    _source  = source;
                    _manager = manager;

                    _source.Processing       += OnProcessing;
                    _source.ProcessDataError += _manager.RaiseProcessDataError;
                    _source.CandleManager     = _manager;
                }
Ejemplo n.º 7
0
                public CandleEnumerator(CandleSeries series, IEnumerable <TValue> values)
                {
                    if (series == null)
                    {
                        throw new ArgumentNullException(nameof(series));
                    }

                    if (values == null)
                    {
                        throw new ArgumentNullException(nameof(values));
                    }

                    _series = series;

                    _valuesEnumerator = values.GetEnumerator();

                    _candleManager             = new CandleManager();
                    _candleManager.Processing += OnProcessCandle;

                    _builderSource = new EnumeratorCandleBuilderSource(series.Security);
                    _candleManager.Sources.OfType <ICandleBuilder>().ForEach(b => b.Sources.Add(_builderSource));

                    _candleManager.Start(series);
                }
Ejemplo n.º 8
0
 public CandleManagerSourceList(CandleManager manager)
 {
     _manager = manager ?? throw new ArgumentNullException(nameof(manager));
 }