public QUIKGeneralSettings(ILTSettingsProvider settingsProvider)
        {
            _settingsProvider = settingsProvider;

            InitializeComponent();
            
            tbFolder.Text = _settingsProvider.GetParameter("QUIKPath", @"C:\Program Files\QUIK");
            chbBrokerAdapterEnable.Checked = _settingsProvider.GetParameter("BrokerProviderActive", false);

            string tif = _settingsProvider.GetParameter("TIF", "TODAY");

            if (tif.Contains("TODAY"))
                rbTifToday.Checked = true;
            else
                rbTifGTC.Checked = true;

            chbSlippageEnable.Checked = _settingsProvider.GetParameter("EnableSlippage", false);
            numStocksSlippage.Value = (decimal)_settingsProvider.GetParameter("SlippageUnits", 0.0);
            numFuturesSlippage.Value = (decimal)_settingsProvider.GetParameter("SlippageTicks", 1);

            _accounts = _settingsProvider.GetObject("Accounts", typeof(List<QUIKAccount>)) as List<QUIKAccount> ?? new List<QUIKAccount>();

            dgvAccounts.AutoGenerateColumns = false;

            bsAccounts.DataSource = _accounts;
            dgvAccounts.DataSource = bsAccounts;

            DataGridViewTextBoxColumn accountNumber = new DataGridViewTextBoxColumn();
            accountNumber.HeaderText = "Торговый счет";
            accountNumber.Width = 140;
            accountNumber.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            accountNumber.DataPropertyName = "TradeAccount";

            DataGridViewTextBoxColumn clientCode = new DataGridViewTextBoxColumn();
            clientCode.HeaderText = "Код клиента";
            clientCode.Width = 140;
            clientCode.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            clientCode.DataPropertyName = "ClientCode";

            dgvAccounts.Columns.Add(accountNumber);
            dgvAccounts.Columns.Add(clientCode);
        }
예제 #2
0
        public override MarketInfo GetMarketInfo(string symbol)
        {
            _marketInfo = MarketManager.GetMarketInfo(symbol, "Russian Standard Time", "QUIKStaticDataProvider");

            if (_marketInfo.Name != null)
            {
                List <MarketTimeZone> timeZones = _rttSettingsProvider.GetObject("MarketTimeZones", typeof(List <MarketTimeZone>)) as List <MarketTimeZone> ?? new List <MarketTimeZone>();

                _marketInfo.TimeZoneName = (from timeZone in timeZones
                                            where timeZone.MarketName == _marketInfo.Name
                                            select timeZone.TimeZoneName).DefaultIfEmpty("Russian Standard Time").First();
            }
            else
            {
                _marketInfo.Name            = "Default Russian Market";
                _marketInfo.TimeZoneName    = "Russian Standard Time";
                _marketInfo.OpenTimeNative  = new DateTime(1970, 1, 1, 0, 0, 0);
                _marketInfo.CloseTimeNative = new DateTime(1970, 1, 1, 23, 59, 59);
            }

            return(_marketInfo);
        }
        public QUIKDataImportSettings(ILTSettingsProvider settingsProvider)
        {
            _settingsProvider = settingsProvider;

            InitializeComponent();

            _symbols = (List <SymbolDescription>)_settingsProvider.GetObject("ImportSymbols", typeof(List <SymbolDescription>)) ?? new List <SymbolDescription>();

            dgvSymbols.AutoGenerateColumns = false;

            bsSymbolDescription.DataSource = _symbols;
            dgvSymbols.DataSource          = bsSymbolDescription;

            DataGridViewTextBoxColumn classCode = new DataGridViewTextBoxColumn();

            classCode.HeaderText       = "Код класса";
            classCode.Width            = 140;
            classCode.AutoSizeMode     = DataGridViewAutoSizeColumnMode.Fill;
            classCode.DataPropertyName = "MarketCode";

            DataGridViewTextBoxColumn symbolCode = new DataGridViewTextBoxColumn();

            symbolCode.HeaderText       = "Код инструмента";
            symbolCode.Width            = 140;
            symbolCode.AutoSizeMode     = DataGridViewAutoSizeColumnMode.Fill;
            symbolCode.DataPropertyName = "SymbolCode";

            DataGridViewTextBoxColumn exportName = new DataGridViewTextBoxColumn();

            exportName.HeaderText       = "Обозначение инструмента";
            exportName.Width            = 140;
            exportName.AutoSizeMode     = DataGridViewAutoSizeColumnMode.Fill;
            exportName.DataPropertyName = "ExportName";

            dgvSymbols.Columns.Add(classCode);
            dgvSymbols.Columns.Add(symbolCode);
            dgvSymbols.Columns.Add(exportName);
        }
예제 #4
0
        private string GetPipeName(BarDataScale dataScale, string symbol, string suffix, bool staticPipe)
        {
            string pipeName;

            string timeFrameSuffix = GetTimeFrameSuffix(dataScale);

            List <SymbolDescription> symbols = (List <SymbolDescription>)_settingsProvider.GetObject("ImportSymbols", typeof(List <SymbolDescription>)) ?? new List <SymbolDescription>();

            string appropriateSymbol = (from symbolDescription in symbols
                                        where symbolDescription.FullCode == symbol
                                        select symbolDescription.ExportName).DefaultIfEmpty(symbol).First();

            if (staticPipe)
            {
                pipeName = string.Format("QUIK_{0}{1}_{2}_EXISTING_DATA", appropriateSymbol, suffix, timeFrameSuffix);
            }
            else
            {
                pipeName = string.Format("QUIK_{0}{1}_{2}", appropriateSymbol, suffix, timeFrameSuffix);
            }

            return(pipeName);
        }
        private void FillDataGrid()
        {
            _marketTimeZones.Clear();

            object buffer = _settingsProvider.GetObject("MarketTimeZones", typeof(List <MarketTimeZone>));

            if (buffer != null)
            {
                _marketTimeZones.AddRange((List <MarketTimeZone>)buffer);
            }

            bsMarketManagerTimeZones.DataSource = _marketTimeZones;

            dgvTimeZones.DataSource = bsMarketManagerTimeZones;

            DataGridViewTextBoxColumn marketCode = new DataGridViewTextBoxColumn();

            marketCode.HeaderText       = "Код рынка";
            marketCode.Width            = 120;
            marketCode.SortMode         = DataGridViewColumnSortMode.NotSortable;
            marketCode.DataPropertyName = "MarketName";

            DataGridViewComboBoxColumn timeZone = new DataGridViewComboBoxColumn();

            timeZone.HeaderText       = "Часовой пояс";
            timeZone.Width            = 180;
            timeZone.AutoSizeMode     = DataGridViewAutoSizeColumnMode.Fill;
            timeZone.DisplayStyle     = DataGridViewComboBoxDisplayStyle.ComboBox;
            timeZone.DataSource       = bsTimeZoneNames;
            timeZone.DataPropertyName = "TimeZoneName";
            timeZone.DisplayMember    = "DisplayName";
            timeZone.ValueMember      = "StandartName";

            dgvTimeZones.Columns.Add(marketCode);
            dgvTimeZones.Columns.Add(timeZone);
        }