public void RunMonitor() { dataStream = dataSource.GetReport(); indicatorSerie = indicatorCalculator.Calculate(dataStream); monitorThread = new Thread(new ThreadStart(UpdateMonitor)); monitorThread.Start(); }
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); }