当前位置: 首页>>代码示例>>C#>>正文


C# ConstructGen.ToDeedle方法代码示例

本文整理汇总了C#中ConstructGen.ToDeedle方法的典型用法代码示例。如果您正苦于以下问题:C# ConstructGen.ToDeedle方法的具体用法?C# ConstructGen.ToDeedle怎么用?C# ConstructGen.ToDeedle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ConstructGen的用法示例。


在下文中一共展示了ConstructGen.ToDeedle方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Go

      public static async Task Go(ICarbonClient cc_)
      {
        DFsWorker.DFInstance().ToString();

        await DFsCache.Instance().RefreshFromServerIfLocalCacheEmpty();
        await TenorDatesCache.Instance().RefreshFromServerIfLocalCacheEmpty();

        var defs = new ISwapCurveDefinition[]
        {
          new USD3mLibor(),
          new USDFedfunds(),
          new EUR6mEuribor(),
          new EUREonia(),
          new GBP6mLibor(),
          new GBPSonia(),
        };

        var sets = new[]
        {
          Tuple.Create(PreDefinedSet.SpotStartOutrights,new[] { "spot","outrights"}),
          Tuple.Create(PreDefinedSet.SpotStartCurves,new[] { "spot","curves"}),
          Tuple.Create(PreDefinedSet.SpotStartButterflies,new[] { "spot","butterflies"}),
          Tuple.Create(PreDefinedSet.FwdOutrights,new[] { "fwd","outrights"}),
          Tuple.Create(PreDefinedSet.FwdCurves,new[] { "fwd","curves"}),
          Tuple.Create(PreDefinedSet.FwdButterflies,new[] { "fwd","butterflies"}),
        };

        foreach (var curveDef in defs)
        {
          foreach (var set in sets)
          {
            var points = UserListHelper.GetStructuresForSet(set.Item1);
            var dataframeMoniker = string.Format("symapp.rates.{0}.{1}.{2}", curveDef.CurveName, set.Item2[0],
              set.Item2[1]);

            var con = new ConstructGen<double>(points.Length);
            con.ColumnHeadings = new string[points.Length];

            for (int i = 0; i < points.Length; ++i)
            {
              InstrumentWithStatsSwap sw = null;
              var point = points[i];
              switch (point.Length)
              {
                case 1:
                  sw = OutrightSwap.Get(curveDef.CurveName, point[0]); break;
                case 2:
                  sw = CurveSwap.Get(curveDef.CurveName, AB_: point[0], CD_: point[1]); break;
                case 3:
                  sw = ButterflySwap.Get(curveDef.CurveName, w1_: point[0], belly_: point[1], w2_: point[2]); break;
              }

              if (sw != null)
              {
                con.ColumnHeadings[i] = sw.Description;
                con.SetColumnValues(i, sw.A_Prices);
              }
            }

            var deedle = con.ToDeedle();

            Logger.Info(string.Format("Writing {0} to carbon dataframes", dataframeMoniker),
              typeof (PersistSetsForDeriveddataWorker));
            await cc_.SaveFrameAsync(dataframeMoniker, deedle);
          }
        }

      }
开发者ID:heimanhon,项目名称:researchwork,代码行数:68,代码来源:OvernightWorker.cs


注:本文中的ConstructGen.ToDeedle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。