Exemplo n.º 1
0
        public void RunMonitor()
        {
            dataStream     = dataSource.GetReport();
            indicatorSerie = indicatorCalculator.Calculate(dataStream);

            monitorThread = new Thread(new ThreadStart(UpdateMonitor));
            monitorThread.Start();
        }
Exemplo n.º 2
0
        public List <int> Calculate(StockReportStream stackReport)
        {
            List <int>    Indicator  = new List <int>();
            List <Candle> listReport = stackReport.Candles.ToList();

            Indicator.Add(Convert.ToInt32(listReport[0].High - listReport[0].Low));
            for (int i = 1; i < listReport.Count; i++)
            {
                Indicator.Add(GetMaxValue(Convert.ToInt32(listReport[i].High - listReport[i].Low), Convert.ToInt32(listReport[i].High - listReport[i - 1].Close),
                                          Convert.ToInt32(listReport[i - 1].Close - listReport[i].Low)));
            }
            return(Indicator);
        }