Exemplo n.º 1
0
 private void ClearButton_Click(object sender, RoutedEventArgs e)
 {
     xlsxrb.IsEnabled = true;
     jsonrb.IsEnabled = true;
     sciChart.Annotations.Clear();
     dataSeries.Clear();
 }
Exemplo n.º 2
0
        public void SetSecurity(string board, string seccode)
        {
            if (Seccode == seccode)
            {
                return;
            }
            TickDataHandler.UnsubscribeFromTicksEvent(TicksToCandles);
            TXmlConnector.SendNewCandles -= ProcessCandles;
            OhlcDataSeries.Clear();
            XyDataSeries.Clear();
            StockChartAnnotations = new AnnotationCollection();
            Board       = board;
            Seccode     = seccode;
            _lastCandle = null;
            Task.Run(() => GetHistory());
            BubbleSeries.Clear();
            GetBubbleData();
            var volumes = TickDataHandler.AddChartSubscription(Board, Seccode, TicksToCandles);

            HorizontalVolumesBuy  = volumes[0];
            HorizontalVolumesSell = volumes[1];
            UpdateWindowInstrument();
            DragStep = Application.Current.Dispatcher
                       .Invoke(() => MainWindowViewModel.SecVm._secList
                               .First(s => s.Board == Board && s.Seccode == Seccode).Minstep);
            GetOrders();
        }
        public override void InitExampleForUiTest()
        {
            base.InitExampleForUiTest();

            _marketDataService.ClearSubscriptions();

            _xyDataSeries.Clear();
            _ohlcDataSeries.Clear();
            _sma50.Clear();
            _lastPrice = default(PriceBar);

            var marketDataService = new MarketDataService(new DateTime(2000, 08, 01, 12, 00, 00), 5, 20);

            // add initizal data
            InitData(marketDataService);

            // perform zoom extents to restore default VisibleRange
            MainSurface.ZoomExtentsX();

            // add one price bar to update location of annotations
            OnNewPrice(marketDataService.GetNextBar());
        }
Exemplo n.º 4
0
        private void MainMenu_FileOpen_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog.Filter = "XLSX files (*.xlsx)|*.xlsx|JSON files (*.json)|*.json";

            if (openFileDialog.ShowDialog() == true)
            {
                try
                {
                    string extension = System.IO.Path.GetExtension(openFileDialog.FileName);

                    if (extension == ".xlsx")
                    {
                        LoadDataSource(new Reporter(new XLSXLoader(openFileDialog.FileName)));
                    }
                    else if (extension == ".json")
                    {
                        LoadDataSource(new Reporter(new JSONLoader(openFileDialog.FileName)));
                    }
                    else
                    {
                        throw new Exception();
                    }
                    dataSeries.Clear();

                    ohlcSeries.Clear();
                    StockChart.Annotations.Clear();
                    indicatorChar.Annotations.Clear();
                    ReloadChartSeries();
                    //LineSeries
                }
                catch (Exception er)
                {
                    MessageBox.Show("Произошла ошибка загрузки данных", "Ошибка", MessageBoxButton.OK, MessageBoxImage.Error);
                }
            }
        }
 private void WindowClosing()
 {
     OhlcDataSeries.Clear();
     BuySeries.Clear();
     SellSeries.Clear();
 }