Example #1
0
        /// <summary>
        ///  кнопка принять
        /// </summary>
        private void ButtonAccept_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                _connectorBot.PortfolioName = ComboBoxPortfolio.Text;
                if (CheckBoxIsEmulator.IsChecked != null)
                {
                    _connectorBot.EmulatorIsOn = CheckBoxIsEmulator.IsChecked.Value;
                }
                TimeFrame timeFrame;
                Enum.TryParse(ComboBoxTimeFrame.Text, out timeFrame);

                _connectorBot.TimeFrame = timeFrame;
                _connectorBot.NamePaper = ComboBoxSecurities.Text;
                Enum.TryParse(ComboBoxTypeServer.Text, true, out _connectorBot.ServerType);

                CandleMarketDataType createType;
                Enum.TryParse(ComboBoxCandleMarketDataType.Text, true, out createType);
                _connectorBot.CandleMarketDataType = createType;

                CandleCreateMethodType methodType;
                Enum.TryParse(ComboBoxCandleCreateMethodType.Text, true, out methodType);

                _connectorBot.CandleCreateMethodType = methodType;

                if (CheckBoxSetForeign.IsChecked.HasValue)
                {
                    _connectorBot.SetForeign = CheckBoxSetForeign.IsChecked.Value;
                }

                _connectorBot.RencoPunktsToCloseCandleInRencoType = _rencoPuncts;
                _connectorBot.CountTradeInCandle = _countTradesInCandle;
                _connectorBot.VolumeToCloseCandleInVolumeType = _volumeToClose;
                _connectorBot.DeltaPeriods = _deltaPeriods;

                _connectorBot.Save();
                Close();
            }
            catch (Exception error)
            {
                SendNewLogMessage(error.ToString(), LogMessageType.Error);
            }
        }
Example #2
0
        /// <summary>
        ///  кнопка принять
        /// </summary>
        private void ButtonAccept_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                _connectorBot.PortfolioName = ComboBoxPortfolio.Text;

                if (CheckBoxIsEmulator.IsChecked != null)
                {
                    _connectorBot.EmulatorIsOn = CheckBoxIsEmulator.IsChecked.Value;
                }

                TimeFrame timeFrame;

                Enum.TryParse(BoxTimeFrame.Text, out timeFrame);

                _connectorBot.TimeFrame = timeFrame;

                _connectorBot.NamePaper = ComboBoxSecurities.Text;

                Enum.TryParse(ComboBoxTypeServer.Text, true, out _connectorBot.ServerType);

                CandleSeriesCreateDataType createType;
                Enum.TryParse(BoxTimeCandleCreateType.Text, true, out createType);

                _connectorBot.CandleCreateType = createType;

                if (CheckBoxSetForeign.IsChecked.HasValue)
                {
                    _connectorBot.SetForeign = CheckBoxSetForeign.IsChecked.Value;
                }


                _connectorBot.Save();
                Close();
            }
            catch (Exception error)
            {
                SendNewLogMessage(error.ToString(), LogMessageType.Error);
            }
        }