示例#1
0
        public static FRA CreateZARFRA([ExcelArgument(Description = "The trade date of the FRA.  The near and far dates will be calculated from this.")] Date tradeDate,
                                       [ExcelArgument(Description = "The notional of the FRA in rands.")] double notional,
                                       [ExcelArgument(Description = "The fixed rate paid or received.")] double rate,
                                       [ExcelArgument(Description = "The fra code, eg '3x6'.")] string fraCode,
                                       [ExcelArgument(Description = "Is the fixed rate paid? Enter 'TRUE' for yes.")] bool payFixed)

        {
            Calendar zaCalendar = StaticData.GetCalendar("ZA");

            return(FRA.CreateZARFra(tradeDate, notional, rate, fraCode, payFixed, zaCalendar));
        }
示例#2
0
文件: XLRates.cs 项目: zhangz/QuantSA
 public static FRA CreateZARFRA([ExcelArgument(Description =
                                                   "The trade date of the FRA.  The near and far dates will be calculated from this.")]
                                Date tradeDate,
                                [ExcelArgument(Description = "The notional of the FRA in rands.")]
                                double notional,
                                [ExcelArgument(Description = "The fixed rate paid or received.")]
                                double rate,
                                [ExcelArgument(Description = "The FRA code, e.g. '3x6'.")]
                                string fraCode,
                                [ExcelArgument(Description = "Is the fixed rate paid? Enter 'TRUE' for yes.")]
                                bool payFixed,
                                [QuantSAExcelArgument(Description = "The float rate index of the FRA.", Default = "ZAR.JIBAR.3M")]
                                FloatRateIndex jibar)
 {
     // TODO: JT: Get a preferred calendar from the float rate index
     return(FRA.CreateZARFra(tradeDate, notional, rate, fraCode, payFixed, new Calendar("ZA"), jibar));
 }
示例#3
0
        public void FRA_Clone()
        {
            var jibar = TestHelpers.Jibar3M;
            var zar   = TestHelpers.ZAR;
            var fra   = new FRA(1e6, 0.25, 0.07, true, new Date("2020-09-14"), new Date("2020-12-14"), jibar);
            var clone = fra.Clone();

            Assert.IsNotNull(clone);

            var indices = clone.GetRequiredIndices();

            Assert.AreEqual(jibar, indices[0]);
            Assert.That(indices, Has.Count.EqualTo(1));
            var cfCurrencies = clone.GetCashflowCurrencies();

            Assert.AreEqual(zar, cfCurrencies[0]);
            Assert.That(cfCurrencies, Has.Count.EqualTo(1));
        }
示例#4
0
  // fra
  void InitFra(FRA fra, TradeInfo tinfo)
  {
      var sinfo = tinfo.Otc as SwapInfo;
      if (sinfo == null) return;
      fra.IsPay = tinfo.TradeAction.Equals("B") ? true : false;
      fra.FixedRate = tinfo.Price / 100;
      fra.Notional = Math.Abs(tinfo.Nominal1);
      fra.StartDate = sinfo.SwapStartDate1;
      fra.EndDate = sinfo.SwapMaturity1;
 
  }