erocakra / yahoo-finance-managed

Automatically exported from code.google.com/p/yahoo-finance-managed
0 stars 0 forks source link

QuotesData DaysHigh bug #61

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
File QuotesDownload.cs

class QuotesData 
Days high is using Open enum value 

public double DaysHigh
        {
            get { if (mValues[(int)QuoteProperty.Open] != null) { return (double)mValues[(int)QuoteProperty.DaysHigh]; } else { return 0; } }
            set { mValues[(int)QuoteProperty.DaysHigh] = value; }
        }

Switch To:

 public double DaysHigh
        {
            get { if (mValues[(double)QuoteProperty.DaysHigh] != null) { return (double)mValues[(double)QuoteProperty.DaysHigh]; } else { return 0; } }
            set { mValues[(double)QuoteProperty.DaysHigh] = value; }
        }

Original issue reported on code.google.com by r.guerra...@gmail.com on 22 Apr 2012 at 8:30

GoogleCodeExporter commented 9 years ago
Switch to: 
  get { if (mValues[(int)QuoteProperty.DaysHigh] != null) { return (double)mValues[(int)QuoteProperty.DaysHigh]; } else { return 0; } }
            set { mValues[(int)QuoteProperty.DaysHigh] = value; }

Also DaysLow "suffers" from same problem, so boths props must be :

/// <summary>
        /// Gets or sets the highest value of the day.
        /// </summary>
        /// <value></value>
        /// <returns></returns>
        /// <remarks></remarks>
        public double DaysHigh
        {
            get { if (mValues[(int)QuoteProperty.DaysHigh] != null) { return (double)mValues[(int)QuoteProperty.DaysHigh]; } else { return 0; } }
            set { mValues[(int)QuoteProperty.DaysHigh] = value; }
        }
        /// <summary>
        /// Gets or sets the lowest price value of the day.
        /// </summary>
        /// <value></value>
        /// <returns></returns>
        /// <remarks></remarks>
        public double DaysLow
        {
            get { if (mValues[(int)QuoteProperty.DaysLow] != null) { return (double)mValues[(int)QuoteProperty.DaysLow]; } else { return 0; } }
            set { mValues[(int)QuoteProperty.DaysLow] = value; }
        } 

Original comment by r.guerra...@gmail.com on 22 Apr 2012 at 8:37

GoogleCodeExporter commented 9 years ago

Original comment by Maas...@gmail.com on 30 Apr 2012 at 12:50