Esempio n. 1
0
 public OTR(int tenor_, BondStructureDefinitionItem definition_)
 {
   Owner = SymmetryEnvironment.UserName;
   Tenor = tenor_;
   Definition = definition_;
   Market = definition_.Market;
 }
 public void RemoveItem(BondStructureDefinitionItem item_)
 {
   if (Items.Contains(item_))
     Items.Remove(item_);
 }
 public void AddItem(BondStructureDefinitionItem item_)
 {
   Items.Add(item_);
 }
    public static BondAnalysisLine FindBondFromDefinition(BondStructureDefinitionItem item_)
    {
      var bonds = CountryBondSource.GetInstance(item_.Market)
        .Lines.Where(x => x.Maturity.Month == item_.Month && x.Maturity.Year == item_.Year);

      if (bonds.Count() > 1)
        bonds = bonds.Where(x => Math.Abs(x.UnderlyingBond.Coupon - item_.Coupon) < 1e-6);

      if (bonds.Count() > 1)
      {
        Logger.Error("Possible problem as more than one bond found for the search critera",
          typeof (BondAnalysisLineHelper));
      }

      return bonds.FirstOrDefault();
    }