Example #1
0
        public CandleChartPanel()
        {
            InitializeComponent();

            var cmdSvc = ConfigManager.GetService <IStudioCommandService>();

            cmdSvc.Register <ChartDrawCommand>(this, false, cmd => _bufferedChart.Draw(cmd.Values));
            cmdSvc.Register <ChartAddAreaCommand>(this, false, cmd => _bufferedChart.AddArea(cmd.Area));
            cmdSvc.Register <ChartRemoveAreaCommand>(this, false, cmd => _bufferedChart.RemoveArea(cmd.Area));
            cmdSvc.Register <ChartAddElementCommand>(this, false, cmd => _bufferedChart.AddElement(cmd.Area, cmd.Element));
            cmdSvc.Register <ChartRemoveElementCommand>(this, false, cmd => _bufferedChart.RemoveElement(cmd.Area, cmd.Element));
            cmdSvc.Register <ChartClearAreasCommand>(this, false, cmd => _bufferedChart.ClearAreas());
            cmdSvc.Register <ChartResetElementsCommand>(this, false, cmd => _bufferedChart.Reset(cmd.Elements));
            cmdSvc.Register <ChartAutoRangeCommand>(this, false, cmd => _bufferedChart.IsAutoRange = cmd.AutoRange);
            cmdSvc.Register <ResetedCommand>(this, true, cmd => OnReseted());
            cmdSvc.Register <BindStrategyCommand>(this, true, cmd =>
            {
                if (!cmd.CheckControl(this))
                {
                    return;
                }

                if (_strategy == cmd.Source)
                {
                    return;
                }

                _strategy = cmd.Source;

                SetChart(true);

                ChartPanel.IsInteracted = _strategy != null && _strategy.GetIsInteracted();

                if (_settingsStorage != null)
                {
                    ChartPanel.Load(_settingsStorage);
                }

                TryCreateDefaultSeries();
            });

            ChartPanel.SettingsChanged           += () => new ControlChangedCommand(this).Process(this);
            ChartPanel.RegisterOrder             += order => new RegisterOrderCommand(order).Process(this);
            ChartPanel.SubscribeCandleElement    += OnChartPanelSubscribeCandleElement;
            ChartPanel.SubscribeIndicatorElement += OnChartPanelSubscribeIndicatorElement;
            ChartPanel.SubscribeOrderElement     += OnChartPanelSubscribeOrderElement;
            ChartPanel.SubscribeTradeElement     += OnChartPanelSubscribeTradeElement;
            ChartPanel.UnSubscribeElement        += OnChartPanelUnSubscribeElement;

            var indicatorTypes = ConfigManager
                                 .GetService <IAlgoService>()
                                 .IndicatorTypes;

            ChartPanel.MinimumRange = 200;
            ChartPanel.IndicatorTypes.AddRange(indicatorTypes);

            _bufferedChart = new BufferedChart(ChartPanel);

            WhenLoaded(() => new RequestBindSource(this).SyncProcess(this));
        }
Example #2
0
        public MainWindow()
        {
            InitializeComponent();

            _bufferedChart = new BufferedChart(Chart);

            HistoryPath.Text = @"..\..\..\HistoryData\".ToFullPath();

            From.Value = new DateTime(2012, 10, 1);
            To.Value   = new DateTime(2012, 10, 25);
        }
Example #3
0
		public MainWindow()
		{
			InitializeComponent();

			_bufferedChart = new BufferedChart(Chart);

			HistoryPath.Text = @"..\..\..\HistoryData\".ToFullPath();

			From.Value = new DateTime(2012, 10, 1);
			To.Value = new DateTime(2012, 10, 25);
		}
		public CandleChartPanel()
		{
			InitializeComponent();

			var cmdSvc = ConfigManager.GetService<IStudioCommandService>();
			cmdSvc.Register<ChartDrawCommand>(this, false, cmd => _bufferedChart.Draw(cmd.Values));
			cmdSvc.Register<ChartAddAreaCommand>(this, false, cmd => _bufferedChart.AddArea(cmd.Area));
			cmdSvc.Register<ChartRemoveAreaCommand>(this, false, cmd => _bufferedChart.RemoveArea(cmd.Area));
			cmdSvc.Register<ChartAddElementCommand>(this, false, cmd => _bufferedChart.AddElement(cmd.Area, cmd.Element));
			cmdSvc.Register<ChartRemoveElementCommand>(this, false, cmd => _bufferedChart.RemoveElement(cmd.Area, cmd.Element));
			cmdSvc.Register<ChartClearAreasCommand>(this, false, cmd => _bufferedChart.ClearAreas());
			cmdSvc.Register<ChartResetElementsCommand>(this, false, cmd => _bufferedChart.Reset(cmd.Elements));
			cmdSvc.Register<ChartAutoRangeCommand>(this, false, cmd => _bufferedChart.IsAutoRange = cmd.AutoRange);
			cmdSvc.Register<ResetedCommand>(this, true, cmd => OnReseted());
			cmdSvc.Register<BindStrategyCommand>(this, true, cmd =>
			{
				if (!cmd.CheckControl(this))
					return;

				if (_strategy == cmd.Source)
					return;

				_strategy = cmd.Source;

				SetChart(true);

				ChartPanel.IsInteracted = _strategy != null && _strategy.GetIsInteracted();

				if (_settingsStorage != null)
					ChartPanel.Load(_settingsStorage);

				TryCreateDefaultSeries();
			});
			
			ChartPanel.SettingsChanged += () => new ControlChangedCommand(this).Process(this);
			ChartPanel.RegisterOrder += order => new RegisterOrderCommand(order).Process(this);
			ChartPanel.SubscribeCandleElement += OnChartPanelSubscribeCandleElement;
			ChartPanel.SubscribeIndicatorElement += OnChartPanelSubscribeIndicatorElement;
			ChartPanel.SubscribeOrderElement += OnChartPanelSubscribeOrderElement;
			ChartPanel.SubscribeTradeElement += OnChartPanelSubscribeTradeElement;
			ChartPanel.UnSubscribeElement += OnChartPanelUnSubscribeElement;

			var indicatorTypes = ConfigManager
				.GetService<IAlgoService>()
				.IndicatorTypes;

			ChartPanel.MinimumRange = 200;
			ChartPanel.IndicatorTypes.AddRange(indicatorTypes);

			_bufferedChart = new BufferedChart(ChartPanel);

			WhenLoaded(() => new RequestBindSource(this).SyncProcess(this));
		}
Example #5
0
        public MainWindow()
        {
            InitializeComponent();

            _bufferedChart = new BufferedChart(Chart);

            HistoryPath.Folder = @"..\..\..\HistoryData\".ToFullPath();

            if (LocalizedStrings.ActiveLanguage == Languages.Russian)
            {
                SecId.Text = "RIZ2@FORTS";

                From.Value = new DateTime(2012, 10, 1);
                To.Value   = new DateTime(2012, 10, 25);

                TimeFrame.SelectedIndex = 1;
            }
            else
            {
                SecId.Text = "@ES#@CMEMINI";

                From.Value = new DateTime(2015, 8, 1);
                To.Value   = new DateTime(2015, 8, 31);

                TimeFrame.SelectedIndex = 0;
            }

            _progressBars.AddRange(new[]
            {
                TicksProgress,
                TicksAndDepthsProgress,
                DepthsProgress,
                CandlesProgress,
                CandlesAndDepthsProgress,
                OrderLogProgress,
                Level1Progress,
                FinamCandlesProgress,
                YahooCandlesProgress
            });

            _checkBoxes.AddRange(new[]
            {
                TicksCheckBox,
                TicksAndDepthsCheckBox,
                DepthsCheckBox,
                CandlesCheckBox,
                CandlesAndDepthsCheckBox,
                OrderLogCheckBox,
                Level1CheckBox,
                FinamCandlesCheckBox,
                YahooCandlesCheckBox,
            });
        }
        public StrategyControl()
        {
            InitializeComponent();

            _bufferedChart = new BufferedChart(Chart);
            _layoutManager = new LayoutManager(DockingManager);

            _pnlCurve           = EquityCurve.CreateCurve(LocalizedStrings.PnL, Colors.DarkGreen, EquityCurveChartStyles.Area);
            _unrealizedPnLCurve = EquityCurve.CreateCurve(LocalizedStrings.PnLUnreal, Colors.Black);
            _commissionCurve    = EquityCurve.CreateCurve(LocalizedStrings.Str159, Colors.Red, EquityCurveChartStyles.DashedLine);

            _posItems = PositionCurve.CreateCurve(LocalizedStrings.Str862, Colors.DarkGreen);
        }
		public StrategyControl()
		{
			InitializeComponent();

			_bufferedChart = new BufferedChart(Chart);
			_layoutManager = new LayoutManager(DockingManager);

			_pnlCurve = EquityCurve.CreateCurve(LocalizedStrings.PnL, Colors.DarkGreen, EquityCurveChartStyles.Area);
			_unrealizedPnLCurve = EquityCurve.CreateCurve(LocalizedStrings.PnLUnreal, Colors.Black);
			_commissionCurve = EquityCurve.CreateCurve(LocalizedStrings.Str159, Colors.Red, EquityCurveChartStyles.DashedLine);

			_posItems = PositionCurve.CreateCurve(LocalizedStrings.Str862, Colors.DarkGreen);
		}
        public MainWindow()
        {
            InitializeComponent();

            bufferedChart = new BufferedChart(Chart);
            connector     = null;

            HistoryPath.Text = @"D:\StockSharp\DatabaseNew\".ToFullPath();

            if (LocalizedStrings.ActiveLanguage == Languages.Russian)
            {
                SecId.Text = "RIZ5@FORTS";

                From.Value = new DateTime(2015, 10, 1);
                To.Value   = new DateTime(2015, 11, 5);
            }
        }
Example #9
0
        public CompositeSecurityPanel()
        {
            InitializeComponent();

            InputBorder.SetBindings(IsEnabledProperty, this, "IsStarted", BindingMode.OneWay, new InverseBooleanConverter());

            MarketDataSettings = ConfigManager.GetService <MarketDataSettingsCache>().Settings.First(s => s.Id != Guid.Empty);
            DateFrom           = DateTime.Today.AddDays(-180);
            DateTo             = DateTime.Today;

            _timer          = new ResettableTimer(TimeSpan.FromSeconds(30));
            _timer.Elapsed += () =>
            {
                GuiDispatcher.GlobalDispatcher.AddAction(() => IsStarted = false);
                _bufferedChart.IsAutoRange = false;
            };

            _drawTimer          = new ResettableTimer(TimeSpan.FromSeconds(2));
            _drawTimer.Elapsed += DrawTimerOnElapsed;

            ChartPanel.SubscribeCandleElement    += OnChartPanelSubscribeCandleElement;
            ChartPanel.SubscribeIndicatorElement += OnChartPanelSubscribeIndicatorElement;
            ChartPanel.UnSubscribeElement        += OnChartPanelUnSubscribeElement;

            var indicatorTypes = ConfigManager
                                 .GetService <IAlgoService>()
                                 .IndicatorTypes;

            ChartPanel.IsInteracted = true;
            ChartPanel.MinimumRange = 200;
            ChartPanel.IndicatorTypes.AddRange(indicatorTypes);

            SecurityPicker.SetColumnVisibility("Id", Visibility.Visible);
            SecurityPicker.SetColumnVisibility("Code", Visibility.Collapsed);

            _candleManager.Container.CandlesKeepTime = TimeSpan.FromDays(5000);
            _candleManager.Processing += ProcessCandle;

            WhenLoaded(OnLoaded);

            _bufferedChart = new BufferedChart(ChartPanel);
        }
Example #10
0
        public MainWindow()
        {
            InitializeComponent();

            _bufferedChart = new BufferedChart(Chart);

            HistoryPath.Text = @"..\..\..\HistoryData\".ToFullPath();

            From.Value = new DateTime(2012, 10, 1);
            To.Value   = new DateTime(2012, 10, 25);

            _progressBars.AddRange(new[]
            {
                TicksTestingProcess,
                TicksAndDepthsTestingProcess,
                DepthsTestingProcess,
                CandlesTestingProcess,
                CandlesAndDepthsTestingProcess,
                OrderLogTestingProcess
            });
        }
Example #11
0
		public MainWindow()
		{
			InitializeComponent();

			_bufferedChart = new BufferedChart(Chart);

			HistoryPath.Text = @"..\..\..\HistoryData\".ToFullPath();

			From.Value = new DateTime(2012, 10, 1);
			To.Value = new DateTime(2012, 10, 25);

			_progressBars.AddRange(new[]
			{
				TicksTestingProcess,
				TicksAndDepthsTestingProcess,
				DepthsTestingProcess,
				CandlesTestingProcess,
				CandlesAndDepthsTestingProcess,
				OrderLogTestingProcess
			});
		}
Example #12
0
        public EmulationControl()
        {
            InitializeComponent();

            HistoryPathTextBox.Text = @"..\..\..\..\Testing\HistoryData\".ToFullPath();
            SecusityTextBox.Text    = "RIZ2@FORTS";
            FromDatePicker.Value    = new DateTime(2012, 10, 1);
            ToDatePicke.Value       = new DateTime(2012, 10, 25);

            MarketDataTypeComboBox.ItemsSource  = new[] { "Ticks", "Candles" };
            MarketDataTypeComboBox.SelectedItem = "Candles";

            TimeFrameComboBox.ItemsSource  = new[] { TimeSpan.FromMinutes(1), TimeSpan.FromMinutes(5) };
            TimeFrameComboBox.SelectedItem = TimeSpan.FromMinutes(5);

            _bufferedChart = new BufferedChart(Chart);

            _logManager = new LogManager();
            _logManager.Listeners.Add(new FileLogListener("sample.log"));
            _logManager.Listeners.Add(new GuiLogListener(Monitor));
            //logManager.Listeners.Add(new DebugLogListener());	// for track logs in output window in Vusial Studio (poor performance).
        }
Example #13
0
		public MainWindow()
		{
			InitializeComponent();

			_bufferedChart = new BufferedChart(Chart);

			HistoryPath.Text = @"..\..\..\HistoryData\".ToFullPath();

			if (LocalizedStrings.ActiveLanguage == Languages.Russian)
			{
				SecId.Text = "RIZ2@FORTS";

				From.Value = new DateTime(2012, 10, 1);
				To.Value = new DateTime(2012, 10, 25);

				TimeFrame.SelectedIndex = 1;
			}
			else
			{
				SecId.Text = "@ES#@CMEMINI";

				From.Value = new DateTime(2015, 8, 1);
				To.Value = new DateTime(2015, 8, 31);

				TimeFrame.SelectedIndex = 0;
			}

			_progressBars.AddRange(new[]
			{
				TicksTestingProcess,
				TicksAndDepthsTestingProcess,
				DepthsTestingProcess,
				CandlesTestingProcess,
				CandlesAndDepthsTestingProcess,
				OrderLogTestingProcess,
				Level1TestingProcess,
			});
		}
		public CompositeSecurityPanel()
		{
			InitializeComponent();

			InputBorder.SetBindings(IsEnabledProperty, this, "IsStarted", BindingMode.OneWay, new InverseBooleanConverter());

			MarketDataSettings = ConfigManager.GetService<MarketDataSettingsCache>().Settings.First(s => s.Id != Guid.Empty);
			DateFrom = DateTime.Today.AddDays(-180);
			DateTo = DateTime.Today;

			_timer = new ResettableTimer(TimeSpan.FromSeconds(30), "Composite");
			_timer.Elapsed += canProcess =>
			{
				GuiDispatcher.GlobalDispatcher.AddAction(() => IsStarted = false);
				_bufferedChart.IsAutoRange = false;
			};

			_drawTimer = new ResettableTimer(TimeSpan.FromSeconds(2), "Composite 2");
			_drawTimer.Elapsed += DrawTimerOnElapsed;

			ChartPanel.SubscribeCandleElement += OnChartPanelSubscribeCandleElement;
			ChartPanel.SubscribeIndicatorElement += OnChartPanelSubscribeIndicatorElement;
			ChartPanel.UnSubscribeElement += OnChartPanelUnSubscribeElement;
			
			ChartPanel.IsInteracted = true;
			ChartPanel.MinimumRange = 200;
			ChartPanel.FillIndicators();

			SecurityPicker.SetColumnVisibility("Id", Visibility.Visible);
			SecurityPicker.SetColumnVisibility("Code", Visibility.Collapsed);

			_candleManager.Container.CandlesKeepTime = TimeSpan.FromDays(5000);
			_candleManager.Processing += ProcessCandle;

			WhenLoaded(OnLoaded);

			_bufferedChart = new BufferedChart(ChartPanel);
		}
Example #15
0
		public EmulationControl()
		{
			InitializeComponent();

			HistoryPathTextBox.Text = @"..\..\..\..\Testing\HistoryData\".ToFullPath();
			SecusityTextBox.Text = "RIZ2@FORTS";
			FromDatePicker.Value = new DateTime(2012, 10, 1);
			ToDatePicke.Value = new DateTime(2012, 10, 25);

			MarketDataTypeComboBox.ItemsSource = new[] { "Ticks", "Candles" };
			MarketDataTypeComboBox.SelectedItem = "Candles";

			TimeFrameComboBox.ItemsSource = new[] { TimeSpan.FromMinutes(1), TimeSpan.FromMinutes(5) };
			TimeFrameComboBox.SelectedItem = TimeSpan.FromMinutes(5);

			_bufferedChart = new BufferedChart(Chart);

			_logManager = new LogManager();
			_logManager.Listeners.Add(new FileLogListener("sample.log"));
			_logManager.Listeners.Add(new GuiLogListener(Monitor));
			//logManager.Listeners.Add(new DebugLogListener());	// for track logs in output window in Vusial Studio (poor performance).
		}