예제 #1
0
        protected override void OnInit()
        {
            this.instrument = this.Key as Instrument;
            DataSeriesList dataSeries = this.instrument.GetDataSeries();

            this.template = Global.ChartManager.Templates["Default Template"];
            this.Text     = "Chart [" + ((FIXInstrument)this.instrument).Symbol + "]";
            this.instrumentListSource.AddInstrument(this.instrument);
            this.instrumentListSource.SelectedInstrument = this.instrument;
            IEnumerator enumerator = dataSeries.GetEnumerator();

            try
            {
                while (enumerator.MoveNext())
                {
                    IDataSeries idataSeries = (IDataSeries)enumerator.Current;
                    string      key         = DataSeriesHelper.SeriesNameToString(idataSeries.Name);
                    if (key.StartsWith("Bar") || key == "Daily")
                    {
                        this.seriesNames.Add(key, idataSeries.Name);
                        this.instrumentListSource.AddSeries(this.instrument, new BarSeries(key));
                    }
                }
            }
            finally
            {
                IDisposable disposable = enumerator as IDisposable;
                if (disposable != null)
                {
                    disposable.Dispose();
                }
            }
            this.instrumentListSource.Refresh();
        }
예제 #2
0
        // TODO: read
        private void V6Aetvk5jr(Instrument instrument, string obj1, bool obj2)
        {
            DataSeriesList dataSeries = instrument.GetDataSeries();

//			Regex regex = new Regex(obj1);
            foreach (IDataSeries series in dataSeries)
            {
                if (series.Name.Substring(instrument.Symbol.Length + 1) == obj1)
                {
                    if (obj2)
                    {
                        if (!this.Simulator.InputSeries.Contains(series))
                        {
                            this.Simulator.InputSeries.Add(series);
                            if (!this.z1tyr7wr0l.Contains(series))
                            {
                                this.z1tyr7wr0l.Add(series, instrument);
                            }
                        }
                    }
                    else
                    {
                        this.Simulator.InputSeries.Remove(series);
                        this.z1tyr7wr0l.Remove(series);
                    }
                }
            }
        }
예제 #3
0
        private void InitDataSeriesList()
        {
            DataSeriesList dataSeries = this.instrument.GetDataSeries();

            this.ltvDataSeries.BeginUpdate();
            this.ltvDataSeries.Items.Clear();
            IEnumerator enumerator = dataSeries.GetEnumerator();

            try
            {
                while (enumerator.MoveNext())
                {
                    this.ltvDataSeries.Items.Add((ListViewItem) new DataSeriesViewItem((IDataSeries)enumerator.Current));
                }
            }
            finally
            {
                IDisposable disposable = enumerator as IDisposable;
                if (disposable != null)
                {
                    disposable.Dispose();
                }
            }
            this.ltvDataSeries.EndUpdate();
        }
예제 #4
0
파일: Site.cs 프로젝트: Fooway/HydroClient
        ///// <summary>
        ///// Information about data service that was used to
        ///// retrieve this site
        ///// </summary>
        //public virtual DataServiceInfo DataService { get; set; }

        /// <summary>
        /// Associates a data series with this site
        /// </summary>
        /// <param name="dataSeries">the data series</param>
        public void AddDataSeries(Series dataSeries)
        {
            if (DataSeriesList == null)
            {
                DataSeriesList = new List <Series>();
            }

            DataSeriesList.Add(dataSeries);
        }
예제 #5
0
        public DataSeriesList GetDataSeries()
        {
            DataSeriesList list = new DataSeriesList();

            foreach (FileSeries fs in this.file.Series)
            {
                list.Add(fs);
            }
            return(list);
        }
예제 #6
0
        private void AddSimulatedSeries(Instrument instrument, string seriesSuffix, bool subscribe)
        {
            //-------------------------------下面一段是为了读出存储在按月分区目录中的数据序列
            DataSeriesList dataSeries = null;

            if (this.seriesNamesToPartitionStore.Contains(seriesSuffix))
            {
                DateTime curDate = Clock.Now.Date;
                this.changeStoreFileForTime(curDate);
                if (this.lastFile != null)
                {
                    dataSeries = new DataSeriesList();
                    foreach (FileSeries series in this.lastFile.Series)
                    {
                        if (!series.Name.StartsWith(string.Concat(instrument.Symbol, '.')))
                        {
                            continue;
                        }
                        dataSeries.Add(series);
                    }
                }
            }
            if (dataSeries == null || dataSeries.Count <= 0)
            {
                dataSeries = instrument.GetDataSeries();
            }
            ///以上为自己添加
            ///下面的为原代码,第一句已在上面使用,第二句貌似是多余的
            //dataSeries = instrument.GetDataSeries();
            //new Regex(seriesSuffix);
            foreach (IDataSeries dataSeries2 in dataSeries)
            {
                if (dataSeries2.Name.Substring(instrument.Symbol.Length + 1) == seriesSuffix)
                {
                    if (subscribe)
                    {
                        if (!this.simulator.InputSeries.Contains(dataSeries2))
                        {
                            this.simulator.InputSeries.Add(dataSeries2);
                            if (!this.seriesTable.Contains(dataSeries2))
                            {
                                this.seriesTable.Add(dataSeries2, instrument);
                            }
                        }
                    }
                    else
                    {
                        this.simulator.InputSeries.Remove(dataSeries2);
                        this.seriesTable.Remove(dataSeries2);
                    }
                }
            }
        }
예제 #7
0
        public static DataSeriesList GetDataSeries(Instrument instrument)
        {
            DataSeriesList dsList = new DataSeriesList();

            foreach (IDataSeries series in DataManager.server.GetDataSeries())
            {
                if (series.Name.StartsWith(instrument.Symbol + SERIES_SEPARATOR))
                {
                    dsList.Add(series);
                }
            }
            return(dsList);
        }
예제 #8
0
 public Simulator()
 {
     this.intervals         = new IntervalList();
     this.inputSeries       = new DataSeriesList();
     this.simulationMode    = SimulationMode.MaxSpeed;
     this.speedMultiplier   = 1.0;
     this.doWork            = false;
     this.doPause           = false;
     this.step              = 0;
     this.stepEnabled       = false;
     this.objectsInInterval = 0;
     this.state             = SimulatorState.Stopped;
 }
예제 #9
0
 public void FlushAllSeries()
 {
     if (this.lastFile != null)
     {
         foreach (FileSeries series in this.lastFile.Series)
         {
             series.Flush();
         }
     }
     foreach (Instrument inst in InstrumentManager.Instruments)
     {
         DataSeriesList seriesList = inst.GetDataSeries();
         foreach (IDataSeries series in seriesList)
         {
             series.Flush();
         }
     }
 }
예제 #10
0
 public void SetDataSeriesList(DataSeriesList series)
 {
     this.Ks6sx4V4bb = series;
 }