コード例 #1
0
        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);
                            }
                        }
        }
コード例 #2
0
ファイル: MainWindow.xaml.cs プロジェクト: savvinm/Task-7
        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);
                }
        }
コード例 #3
0
ファイル: MainWindow.xaml.cs プロジェクト: StudentBeast99/T7
 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);
             }
 }
コード例 #4
0
ファイル: MainWindow.xaml.cs プロジェクト: PavelParamon/Task7
        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);
                }
        }