private void AddNewCandle(Candle candle, double?indicatorValue1, double?indicatorValue2, double?indicatorValue3) { using (ohlcSeries.SuspendUpdates()) using (BBMiddleSeries.SuspendUpdates()) using (BBUpperSeries.SuspendUpdates()) using (BBLowerSeries.SuspendUpdates()) { candlesCount++; ohlcSeries.Append(candle.Time, (double)candle.Open, (double)candle.High, (double)candle.Low, (double)candle.Close); StockChart.XAxis.VisibleRange = new IndexRange(candlesCount - 50, candlesCount); if (indicatorValue1 != null) { BBMiddleSeries.Append(candle.Time, indicatorValue1.Value); } if (indicatorValue2 != null) { BBUpperSeries.Append(candle.Time, indicatorValue2.Value); } if (indicatorValue3 != null) { BBLowerSeries.Append(candle.Time, indicatorValue3.Value); } } }
private void AddNewCandle(Candle candle, decimal indicator) { using (dataSeries.SuspendUpdates()) using (ohlcSeries.SuspendUpdates()) { ohlcSeries.Append(candle.Time, (double)candle.Open, (double)candle.High, (double)candle.Low, (double)candle.Close); dataSeries.Append(candle.Time, (double)indicator); candleCount++; StockChart.XAxis.VisibleRange = new IndexRange(candleCount - 50, candleCount); indicatorChar.XAxis.VisibleRange = new IndexRange(candleCount - 50, candleCount); } }
private void AddNewCandle(Candle candle, decimal indicator) { using (macdDataSeries.SuspendUpdates()) using (dataSeries.SuspendUpdates()) using (ohlcSeries.SuspendUpdates()) { ohlcSeries.Append(candle.Time, (double)candle.Open, (double)candle.High, (double)candle.Low, (double)candle.Close); macdDataSeries.Append(candle.Time, macdPoints[candleCount].Macd, macdPoints[candleCount].Signal); candleCount++; dataSeries.Append(candle.Time, (double)Monitor.Indicator.Calculate(candle)); StockChart.XAxis.VisibleRange = new IndexRange(candleCount - 50, candleCount); indicatorChar.XAxis.VisibleRange = new IndexRange(candleCount - 50, candleCount); } }
private void AddNewCandle(Candle candle, double?indicatorValue) { using (ohlcSeries.SuspendUpdates()) using (sarSeries.SuspendUpdates()) { ohlcSeries.Append(candle.Time, (double)candle.Open, (double)candle.High, (double)candle.Low, (double)candle.Close); if (indicatorValue != null) { sarSeries.Append(candle.Time, indicatorValue.Value); } candlesCount++; StockChart.XAxis.VisibleRange = new IndexRange(candlesCount - 50, candlesCount); } }