コード例 #1
0
    public void Create(SwapsSummaryRow instrument_)
    {
      m_dependendSource = instrument_;
      setupSettings();
      reCalculate();

      ultraChart1.CompositeChart.Legends[0].LabelStyle.FontColor = Color.White;

      EstablishDefaultTooltip((hash) =>
      {
        string ret = null;
        try
        {
          string seriesLabel = hash["SERIES_LABEL"].ToString();


          {
            if(seriesLabel.StartsWith("areaTopLeft"))
            {
              string[] arr = hash["ITEM_LABEL"].ToString().Split('_');
              ret =
                string.Format("{0} over {1}@R-squ: {2}", arr[0],
                  EnumDescriptionAttribute.GetDescription(((RegressionWindow) Convert.ToInt32(hash["DATA_VALUE_X"]))), ((double) hash["DATA_VALUE_Y"]).ToString("#0.0#"))
                  .Replace("@", System.Environment.NewLine);
            }
            else if(seriesLabel.StartsWith("areaTopRight"))
            {
              string[] arr = hash["ITEM_LABEL"].ToString().Split('_');
              ret =
                string.Format("{0} over {1}@R-squ: {2}@Last res: {3}", arr[0],
                  arr[1], ((double)hash["DATA_VALUE_Y"]).ToString("#0.0#"), ((double)hash["DATA_VALUE_X"]).ToString("#0.0#"))
                  .Replace("@", System.Environment.NewLine);
            }
            else
            {
              string[] arr = seriesLabel.Split('_');
              ret =
                string.Format("{0} over {1}@{2} : {3}", arr[0], arr[1],
                  ((DateTime) hash["TIME_VALUE"]).ToString("dd-MMM-yyyy"),
                  ((double) hash["DATA_VALUE"]).ToString("#0.0#")).Replace("@", System.Environment.NewLine);
            }
          }
        }
        catch (Exception ex_)
        {
          Logger.Error("Error generating tooltip", typeof (MultiRegressionCompare), ex_);
        }
        return ret;
      });
    }
コード例 #2
0
ファイル: MainControl.cs プロジェクト: heimanhon/researchwork
      public bool ShouldShow(SwapsSummaryRow row_)
      {
        bool listNameOK = true;
        if (!string.IsNullOrEmpty(ProfileName))
        {
          if (String.CompareOrdinal(ProfileName, row_.ProfileName) != 0)
            listNameOK = false;
        }

        var instrument = row_.GetInstrument();

        //bool curveOK = false;
        //switch (instrument.CurveName)
        //{
        //  case(CurveNames.EUR6M):
        //    curveOK = ShowEUR;
        //    break;
        //  case (CurveNames.GBP6M):
        //    curveOK = ShowGBP;
        //    break;
        //  case (CurveNames.USD3M):
        //    curveOK = ShowUSD;
        //    break;
        //  case (CurveNames.JPY6M):
        //    curveOK=ShowJPY;
        //    break;
        //  case (CurveNames.EDCurve):
        //    curveOK = ShowED;
        //    break;
        //  case (CurveNames.ERCurve):
        //    curveOK = ShowER;
        //    break;
        //  case (CurveNames.L_Curve):
        //    curveOK = ShowL_;
        //    break;
        //}

        bool productTypeOK = false;

        if (instrument is ButterflySwap || instrument is ButterflyFuture || instrument is DoubleButterflyFuture )
          productTypeOK = ShowButterfly;
        else if (instrument is CurveSwap || instrument is CurveFuture)
          productTypeOK = ShowCurve;
        else if (instrument is OutrightSwap || instrument is OutrightFuture )
          productTypeOK = ShowOutright;

        return productTypeOK && listNameOK;
      }
コード例 #3
0
ファイル: MainControl.cs プロジェクト: heimanhon/researchwork
    private async void handleUserItemAdded(object sender, Data.MongoBackCacheChangedArgs<UserListItem> item_)
    {
      var instrument = item_.Item.CreateInstrument();
      setStatus(string.Format("Creating instrument stats for {0}.{1}...",instrument.CurveName,instrument.Description));
      var stats = await instrument.GetStats();
      if (stats == null)
      {
        Logger.Error(
          string.Format("Looks like there was a problem generating stats for {0}.{1}", instrument.CurveName,
            instrument.Description), typeof (MainControl));
        setStatus("Error!");
        return;
      }

      var sumRow = new SwapsSummaryRow(instrument, item_.Item);
      setStatus("Subscribing to live");
      sumRow.SubscribeToLive();
      setStatus("Running regressions");
      RegressionHelper.UpdateThisWithCentralOptions(sumRow);
      m_originalList.Add(sumRow);

      if (m_filter.ShouldShow(sumRow))
        m_workingSet.Add(sumRow);

      setStatus(string.Empty);
    }
コード例 #4
0
 public GenericMenuItem(SwapsSummaryRow item_, Action<SwapsSummaryRow> action_, string text_)
 {
   Text = text_;
   m_ssrow = item_;
   m_action = action_;
 }
コード例 #5
0
 public DeleteProduct(SwapsSummaryRow item_, Action<SwapsSummaryRow> action_)
 {
   Text = string.Format("Remove '{0}' from products", item_.Inst);
   m_ssrow = item_;
   m_action = action_;
 }