private double getLatestStat(StatCols column_, bool scaledWithView_=false) { if (Instrument == null || Instrument.Stats == null || Instrument.Stats.RollingStats == null) return 0d; return getScaledValue(Instrument.Stats.RollingStats.GetValue(statsLatestDate, (int)column_), scaledWithView_); }
public DatedDataCollectionGen<double> GetRawStatSeries(StatCols key_, bool scaledWithView_=false) { DatedDataCollectionGen<double> ret = null; switch (key_) { case StatCols.CombinedStat: ret=RatesHelperMethods.GetHistoricalStatSeries(this); break; case StatCols.Residuals: ret= m_regressionResiduals; break; default: ret= Instrument.Stats.RollingStats.GetColumnValuesAsDDC((int)key_); break; } if (scaledWithView_) { var cf = GetColumnFormatForGivenColumn(key_); if (cf != null && cf.CurrentFormat != null && cf.CurrentFormat.Multiplier != 1d) ret = ret.MultiplyBy(cf.CurrentFormat.Multiplier); } return ret; }
internal static ColumnFormat GetColumnFormatForGivenColumn(StatCols col_) { return _columnFormats.FirstOrDefault(x => x.StatCol == col_); }
public double GetRawStat(StatCols col_) { double ret = double.NaN; switch(col_) { case StatCols.CombinedStat: ret = CombStat; break; case StatCols.Residuals: ret = LastResidual; break; case StatCols.RSquared: ret = RSquared; break; default: ret = getLatestStat(col_, false); break; } return ret; }
public static string GetDisplayFormatForGivenStat(StatCols sc_) { string ret = "##0.000"; var item = _columnFormats.FirstOrDefault(x => x.StatCol==sc_); if (item == null) return ret; ret = item.CurrentFormat.Format; return ret; }