Esempio n. 1
0
        public CandleReceiver GetCandleReceiver(string epic, int ticksCount, int averageOpen, int maxSeconds)
        {
            var receiver = CandleReceivers.OfType <TicksDataReceiver>().FirstOrDefault(c => c.Epic == epic && c.TicksCount == ticksCount && c.AverageOpen == averageOpen && c.MaxSeconds == maxSeconds);

            if (receiver == null)
            {
                receiver = new TicksDataReceiver(epic, ticksCount, averageOpen, maxSeconds);

                CandleReceivers.Add(receiver);

                _hasNewReceiver = true;
            }

            return(receiver);
        }
Esempio n. 2
0
        public CandleReceiver GetCandleReceiver(string epic, Periods period, int averageOpen)
        {
            var receiver = CandleReceivers.OfType <CandleDataReceiver>().FirstOrDefault(c => c.Epic == epic && c.Period == period && c.AverageOpen == averageOpen);

            if (receiver == null)
            {
                receiver = new CandleDataReceiver(epic, period, averageOpen);

                CandleReceivers.Add(receiver);

                _hasNewReceiver = true;
            }

            return(receiver);
        }