コード例 #1
0
        private void ShowChartClick(object sender, RoutedEventArgs e)
        {
            var security = SelectedSecurity;

            var series = new CandleSeries(CandlesSettings.Settings.CandleType, security, CandlesSettings.Settings.Arg);

            _chartWindows.SafeAdd(series, key =>
            {
                var wnd = new ChartWindow
                {
                    Title = "{0} {1} {2}".Put(security.Code, series.CandleType.Name, series.Arg)
                };

                wnd.MakeHideable();

                var area = new ChartArea();
                wnd.Chart.Areas.Add(area);

                var candlesElem = new ChartCandleElement();
                area.Elements.Add(candlesElem);

                return(wnd);
            }).Show();

            _candleManager.Start(series);
        }
コード例 #2
0
        private void ShowChartClick(object sender, RoutedEventArgs e)
        {
            var type     = SelectedCandleType;
            var security = SelectedSecurity;

            CandleSeries series;

            switch (type)
            {
            case CandleTypes.TimeFrame:
                series = new CandleSeries(typeof(TimeFrameCandle), security, TimeFrame.Value.Value.TimeOfDay);
                break;

            case CandleTypes.Tick:
                series = new CandleSeries(typeof(TickCandle), security, VolumeCtrl.Text.To <int>());
                break;

            case CandleTypes.Volume:
                series = new CandleSeries(typeof(VolumeCandle), security, VolumeCtrl.Text.To <decimal>());
                break;

            case CandleTypes.Range:
                series = new CandleSeries(typeof(RangeCandle), security, PriceRange.Value.Clone().SetSecurity(security));
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            _chartWindows.SafeAdd(series, key =>
            {
                var wnd = new ChartWindow
                {
                    Title = "{0} {1} {2}".Put(security.Code, type, series.Arg)
                };

                wnd.MakeHideable();

                var area = new ChartArea();
                wnd.Chart.Areas.Add(area);

                var candlesElem = new ChartCandleElement();
                area.Elements.Add(candlesElem);

                return(wnd);
            }).Show();

            _candleManager.Start(series);
        }
コード例 #3
0
ファイル: MainWindow.xaml.cs プロジェクト: osya/StockSharp
		private void ShowChartClick(object sender, RoutedEventArgs e)
		{
			var security = SelectedSecurity;

			var series = new CandleSeries(CandlesSettings.Settings.CandleType, security, CandlesSettings.Settings.Arg);

			_chartWindows.SafeAdd(series, key =>
			{
				var wnd = new ChartWindow
				{
					Title = "{0} {1} {2}".Put(security.Code, series.CandleType.Name, series.Arg)
				};

				wnd.MakeHideable();

				var area = new ChartArea();
				wnd.Chart.Areas.Add(area);

				var candlesElem = new ChartCandleElement();
				area.Elements.Add(candlesElem);

				return wnd;
			}).Show();

			_candleManager.Start(series);
		}
コード例 #4
0
		private void ShowChartClick(object sender, RoutedEventArgs e)
		{
			var type = SelectedCandleType;
			var security = SelectedSecurity;

			CandleSeries series;

			switch (type)
			{
				case CandleTypes.TimeFrame:
					series = new CandleSeries(typeof(TimeFrameCandle), security, TimeFrame.Value.Value.TimeOfDay);
					break;
				case CandleTypes.Tick:
					series = new CandleSeries(typeof(TickCandle), security, VolumeCtrl.Text.To<int>());
					break;
				case CandleTypes.Volume:
					series = new CandleSeries(typeof(VolumeCandle), security, VolumeCtrl.Text.To<decimal>());
					break;
				case CandleTypes.Range:
					series = new CandleSeries(typeof(RangeCandle), security, PriceRange.Value.Clone().SetSecurity(security));
					break;
				default:
					throw new ArgumentOutOfRangeException();
			}

			_chartWindows.SafeAdd(series, key =>
			{
				var wnd = new ChartWindow
				{
					Title = "{0} {1} {2}".Put(security.Code, type, series.Arg)
				};

				wnd.MakeHideable();

				var area = new ChartArea();
				wnd.Chart.Areas.Add(area);

				var candlesElem = new ChartCandleElement();
				area.Elements.Add(candlesElem);

				return wnd;
			}).Show();

			_candleManager.Start(series);
		}