Exemple #1
0
        public void RefreshName()
        {
            string name = ((TimeSeries)this.series).Name;

            this.name = "";
            if (name.StartsWith(((FIXInstrument)this.instrument).Symbol))
            {
                string str1 = name.Remove(0, ((FIXInstrument)this.instrument).Symbol.Length);
                if (str1.StartsWith(" ("))
                {
                    string str2 = str1.Remove(0, 2);
                    if (str2.EndsWith(")"))
                    {
                        string[] strArray = str2.Substring(0, str2.Length - 1).Split(new char[1]
                        {
                            ' '
                        });
                        if (strArray.Length == 2 && Enum.IsDefined(typeof(BarType), (object)strArray[0]))
                        {
                            BarType barType = (BarType)Enum.Parse(typeof(BarType), strArray[0]);
                            long    result;
                            if (long.TryParse(strArray[1], out result))
                            {
                                this.name = DataSeriesHelper.BarTypeSizeToString(barType, result);
                            }
                        }
                    }
                }
            }
            if (!(this.name == ""))
            {
                return;
            }
            this.name = ((TimeSeries)this.series).Name;
        }
Exemple #2
0
 public override string ToString()
 {
     if (this.barSize <= 0)
     {
         return(string.Empty);
     }
     else
     {
         return(DataSeriesHelper.BarTypeSizeToString(this.barType, this.barSize));
     }
 }
Exemple #3
0
 public override string ToString()
 {
     if (this.BarSize == 86400)
     {
         return("Daily");
     }
     else
     {
         return(string.Format("Bar {0}", DataSeriesHelper.BarTypeSizeToString(this.BarType, this.BarSize)));
     }
 }
Exemple #4
0
 protected override void OnInit(IDataObject dataObject, int decimalPlaces)
 {
     if (dataObject != null)
     {
         Bar bar = (Bar)dataObject;
         this.dtpDateTime.Value   = bar.BeginTime;
         this.dtpEnd.Value        = bar.EndTime;
         this.nudOpen.Value       = (Decimal)bar.Open;
         this.nudHigh.Value       = (Decimal)bar.High;
         this.nudLow.Value        = (Decimal)bar.Low;
         this.nudClose.Value      = (Decimal)bar.Close;
         this.nudVolume.Value     = (Decimal)bar.Volume;
         this.nudOpenInt.Value    = (Decimal)bar.OpenInt;
         this.dtpDateTime.Enabled = false;
         this.dtpEnd.Enabled      = false;
     }
     else
     {
         DateTime now = DateTime.Now;
         this.dtpDateTime.Value   = new DateTime(now.Year, now.Month, now.Day, now.Hour, now.Minute, now.Second);
         this.dtpDateTime.Enabled = true;
         if (this.barType == BarType.Time)
         {
             this.dtpEnd.Value   = this.dtpDateTime.Value.AddSeconds((double)this.barSize);
             this.dtpEnd.Enabled = false;
         }
         else
         {
             this.dtpEnd.Value   = this.dtpDateTime.Value;
             this.dtpEnd.Enabled = true;
         }
     }
     this.tbxBarType.Text        = DataSeriesHelper.BarTypeSizeToString(this.barType, this.barSize);
     this.nudOpen.DecimalPlaces  = decimalPlaces;
     this.nudHigh.DecimalPlaces  = decimalPlaces;
     this.nudLow.DecimalPlaces   = decimalPlaces;
     this.nudClose.DecimalPlaces = decimalPlaces;
 }
Exemple #5
0
 public override string ToString()
 {
     return(string.Format("Bar {0}", DataSeriesHelper.BarTypeSizeToString(this.BarType, this.BarSize)));
 }
 public BarSeriesMenuItem(BarType barType, long barSize)
 {
     this.barType = barType;
     this.barSize = barSize;
     this.Text    = DataSeriesHelper.BarTypeSizeToString(barType, barSize);
 }
Exemple #7
0
 public override string ToString()
 {
     return(DataSeriesHelper.BarTypeSizeToString(BarType.Time, this.BarSize));
 }