コード例 #1
0
    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_);
    }
コード例 #2
0
    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;
    }
コード例 #3
0
 internal static ColumnFormat GetColumnFormatForGivenColumn(StatCols col_)
 {
   return _columnFormats.FirstOrDefault(x => x.StatCol == col_);
 }
コード例 #4
0
 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;
 }
コード例 #5
0
    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;
    }