public DefaultProbabilityCurve(XmlNode xmlNode) : base(xmlNode) { XmlNodeList baseYieldCurveNodeList = xmlNode.SelectNodes("baseYieldCurve"); if (baseYieldCurveNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in baseYieldCurveNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { baseYieldCurveIDRef = item.Attributes["id"].Name; PricingStructureReference ob = PricingStructureReference(); IDManager.SetID(baseYieldCurveIDRef, ob); } else if (item.Attributes.ToString() == "href") { baseYieldCurveIDRef = item.Attributes["href"].Name; } else { baseYieldCurve = new PricingStructureReference(item); } } } XmlNodeList defaultProbabilitiesNodeList = xmlNode.SelectNodes("defaultProbabilities"); if (defaultProbabilitiesNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in defaultProbabilitiesNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { defaultProbabilitiesIDRef = item.Attributes["id"].Name; TermCurve ob = TermCurve(); IDManager.SetID(defaultProbabilitiesIDRef, ob); } else if (item.Attributes.ToString() == "href") { defaultProbabilitiesIDRef = item.Attributes["href"].Name; } else { defaultProbabilities = new TermCurve(item); } } } }
public ZeroRateCurve(XmlNode xmlNode) { XmlNode compoundingFrequencyNode = xmlNode.SelectSingleNode("compoundingFrequency"); if (compoundingFrequencyNode != null) { if (compoundingFrequencyNode.Attributes["href"] != null || compoundingFrequencyNode.Attributes["id"] != null) { if (compoundingFrequencyNode.Attributes["id"] != null) { compoundingFrequencyIDRef_ = compoundingFrequencyNode.Attributes["id"].Value; CompoundingFrequency ob = new CompoundingFrequency(compoundingFrequencyNode); IDManager.SetID(compoundingFrequencyIDRef_, ob); } else if (compoundingFrequencyNode.Attributes["href"] != null) { compoundingFrequencyIDRef_ = compoundingFrequencyNode.Attributes["href"].Value; } else { compoundingFrequency_ = new CompoundingFrequency(compoundingFrequencyNode); } } else { compoundingFrequency_ = new CompoundingFrequency(compoundingFrequencyNode); } } XmlNode rateCurveNode = xmlNode.SelectSingleNode("rateCurve"); if (rateCurveNode != null) { if (rateCurveNode.Attributes["href"] != null || rateCurveNode.Attributes["id"] != null) { if (rateCurveNode.Attributes["id"] != null) { rateCurveIDRef_ = rateCurveNode.Attributes["id"].Value; TermCurve ob = new TermCurve(rateCurveNode); IDManager.SetID(rateCurveIDRef_, ob); } else if (rateCurveNode.Attributes["href"] != null) { rateCurveIDRef_ = rateCurveNode.Attributes["href"].Value; } else { rateCurve_ = new TermCurve(rateCurveNode); } } else { rateCurve_ = new TermCurve(rateCurveNode); } } }
public ForwardRateCurve(XmlNode xmlNode) { XmlNode assetReferenceNode = xmlNode.SelectSingleNode("assetReference"); if (assetReferenceNode != null) { if (assetReferenceNode.Attributes["href"] != null || assetReferenceNode.Attributes["id"] != null) { if (assetReferenceNode.Attributes["id"] != null) { assetReferenceIDRef_ = assetReferenceNode.Attributes["id"].Value; AssetReference ob = new AssetReference(assetReferenceNode); IDManager.SetID(assetReferenceIDRef_, ob); } else if (assetReferenceNode.Attributes["href"] != null) { assetReferenceIDRef_ = assetReferenceNode.Attributes["href"].Value; } else { assetReference_ = new AssetReference(assetReferenceNode); } } else { assetReference_ = new AssetReference(assetReferenceNode); } } XmlNode rateCurveNode = xmlNode.SelectSingleNode("rateCurve"); if (rateCurveNode != null) { if (rateCurveNode.Attributes["href"] != null || rateCurveNode.Attributes["id"] != null) { if (rateCurveNode.Attributes["id"] != null) { rateCurveIDRef_ = rateCurveNode.Attributes["id"].Value; TermCurve ob = new TermCurve(rateCurveNode); IDManager.SetID(rateCurveIDRef_, ob); } else if (rateCurveNode.Attributes["href"] != null) { rateCurveIDRef_ = rateCurveNode.Attributes["href"].Value; } else { rateCurve_ = new TermCurve(rateCurveNode); } } else { rateCurve_ = new TermCurve(rateCurveNode); } } }
public ZeroRateCurve(XmlNode xmlNode) { XmlNodeList compoundingFrequencyNodeList = xmlNode.SelectNodes("compoundingFrequency"); if (compoundingFrequencyNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in compoundingFrequencyNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { compoundingFrequencyIDRef = item.Attributes["id"].Name; CompoundingFrequency ob = CompoundingFrequency(); IDManager.SetID(compoundingFrequencyIDRef, ob); } else if (item.Attributes.ToString() == "href") { compoundingFrequencyIDRef = item.Attributes["href"].Name; } else { compoundingFrequency = new CompoundingFrequency(item); } } } XmlNodeList rateCurveNodeList = xmlNode.SelectNodes("rateCurve"); if (rateCurveNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in rateCurveNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { rateCurveIDRef = item.Attributes["id"].Name; TermCurve ob = TermCurve(); IDManager.SetID(rateCurveIDRef, ob); } else if (item.Attributes.ToString() == "href") { rateCurveIDRef = item.Attributes["href"].Name; } else { rateCurve = new TermCurve(item); } } } }
public ForwardRateCurve(XmlNode xmlNode) { XmlNodeList assetReferenceNodeList = xmlNode.SelectNodes("assetReference"); if (assetReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in assetReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { assetReferenceIDRef = item.Attributes["id"].Name; AssetReference ob = AssetReference(); IDManager.SetID(assetReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { assetReferenceIDRef = item.Attributes["href"].Name; } else { assetReference = new AssetReference(item); } } } XmlNodeList rateCurveNodeList = xmlNode.SelectNodes("rateCurve"); if (rateCurveNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in rateCurveNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { rateCurveIDRef = item.Attributes["id"].Name; TermCurve ob = TermCurve(); IDManager.SetID(rateCurveIDRef, ob); } else if (item.Attributes.ToString() == "href") { rateCurveIDRef = item.Attributes["href"].Name; } else { rateCurve = new TermCurve(item); } } } }
public YieldCurveValuation(XmlNode xmlNode) : base(xmlNode) { XmlNodeList inputsNodeList = xmlNode.SelectNodes("inputs"); if (inputsNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in inputsNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { inputsIDRef = item.Attributes["id"].Name; QuotedAssetSet ob = QuotedAssetSet(); IDManager.SetID(inputsIDRef, ob); } else if (item.Attributes.ToString() == "href") { inputsIDRef = item.Attributes["href"].Name; } else { inputs = new QuotedAssetSet(item); } } } XmlNodeList zeroCurveNodeList = xmlNode.SelectNodes("zeroCurve"); if (zeroCurveNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in zeroCurveNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { zeroCurveIDRef = item.Attributes["id"].Name; ZeroRateCurve ob = ZeroRateCurve(); IDManager.SetID(zeroCurveIDRef, ob); } else if (item.Attributes.ToString() == "href") { zeroCurveIDRef = item.Attributes["href"].Name; } else { zeroCurve = new ZeroRateCurve(item); } } } XmlNodeList forwardCurveNodeList = xmlNode.SelectNodes("forwardCurve"); foreach (XmlNode item in forwardCurveNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { forwardCurveIDRef = item.Attributes["id"].Name; List <ForwardRateCurve> ob = new List <ForwardRateCurve>(); ob.Add(new ForwardRateCurve(item)); IDManager.SetID(forwardCurveIDRef, ob); } else if (item.Attributes.ToString() == "href") { forwardCurveIDRef = item.Attributes["href"].Name; } else { forwardCurve.Add(new ForwardRateCurve(item)); } } } XmlNodeList discountFactorCurveNodeList = xmlNode.SelectNodes("discountFactorCurve"); if (discountFactorCurveNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in discountFactorCurveNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { discountFactorCurveIDRef = item.Attributes["id"].Name; TermCurve ob = TermCurve(); IDManager.SetID(discountFactorCurveIDRef, ob); } else if (item.Attributes.ToString() == "href") { discountFactorCurveIDRef = item.Attributes["href"].Name; } else { discountFactorCurve = new TermCurve(item); } } } }
public YieldCurveValuation(XmlNode xmlNode) : base(xmlNode) { XmlNode inputsNode = xmlNode.SelectSingleNode("inputs"); if (inputsNode != null) { if (inputsNode.Attributes["href"] != null || inputsNode.Attributes["id"] != null) { if (inputsNode.Attributes["id"] != null) { inputsIDRef_ = inputsNode.Attributes["id"].Value; QuotedAssetSet ob = new QuotedAssetSet(inputsNode); IDManager.SetID(inputsIDRef_, ob); } else if (inputsNode.Attributes["href"] != null) { inputsIDRef_ = inputsNode.Attributes["href"].Value; } else { inputs_ = new QuotedAssetSet(inputsNode); } } else { inputs_ = new QuotedAssetSet(inputsNode); } } XmlNode zeroCurveNode = xmlNode.SelectSingleNode("zeroCurve"); if (zeroCurveNode != null) { if (zeroCurveNode.Attributes["href"] != null || zeroCurveNode.Attributes["id"] != null) { if (zeroCurveNode.Attributes["id"] != null) { zeroCurveIDRef_ = zeroCurveNode.Attributes["id"].Value; ZeroRateCurve ob = new ZeroRateCurve(zeroCurveNode); IDManager.SetID(zeroCurveIDRef_, ob); } else if (zeroCurveNode.Attributes["href"] != null) { zeroCurveIDRef_ = zeroCurveNode.Attributes["href"].Value; } else { zeroCurve_ = new ZeroRateCurve(zeroCurveNode); } } else { zeroCurve_ = new ZeroRateCurve(zeroCurveNode); } } XmlNodeList forwardCurveNodeList = xmlNode.SelectNodes("forwardCurve"); if (forwardCurveNodeList != null) { this.forwardCurve_ = new List <ForwardRateCurve>(); foreach (XmlNode item in forwardCurveNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] != null) { if (item.Attributes["id"] != null) { forwardCurveIDRef_ = item.Attributes["id"].Value; forwardCurve_.Add(new ForwardRateCurve(item)); IDManager.SetID(forwardCurveIDRef_, forwardCurve_[forwardCurve_.Count - 1]); } else if (item.Attributes["href"] != null) { forwardCurveIDRef_ = item.Attributes["href"].Value; } else { forwardCurve_.Add(new ForwardRateCurve(item)); } } else { forwardCurve_.Add(new ForwardRateCurve(item)); } } } XmlNode discountFactorCurveNode = xmlNode.SelectSingleNode("discountFactorCurve"); if (discountFactorCurveNode != null) { if (discountFactorCurveNode.Attributes["href"] != null || discountFactorCurveNode.Attributes["id"] != null) { if (discountFactorCurveNode.Attributes["id"] != null) { discountFactorCurveIDRef_ = discountFactorCurveNode.Attributes["id"].Value; TermCurve ob = new TermCurve(discountFactorCurveNode); IDManager.SetID(discountFactorCurveIDRef_, ob); } else if (discountFactorCurveNode.Attributes["href"] != null) { discountFactorCurveIDRef_ = discountFactorCurveNode.Attributes["href"].Value; } else { discountFactorCurve_ = new TermCurve(discountFactorCurveNode); } } else { discountFactorCurve_ = new TermCurve(discountFactorCurveNode); } } }
public CreditCurveValuation(XmlNode xmlNode) : base(xmlNode) { XmlNode inputsNode = xmlNode.SelectSingleNode("inputs"); if (inputsNode != null) { if (inputsNode.Attributes["href"] != null || inputsNode.Attributes["id"] != null) { if (inputsNode.Attributes["id"] != null) { inputsIDRef_ = inputsNode.Attributes["id"].Value; QuotedAssetSet ob = new QuotedAssetSet(inputsNode); IDManager.SetID(inputsIDRef_, ob); } else if (inputsNode.Attributes["href"] != null) { inputsIDRef_ = inputsNode.Attributes["href"].Value; } else { inputs_ = new QuotedAssetSet(inputsNode); } } else { inputs_ = new QuotedAssetSet(inputsNode); } } XmlNode defaultProbabilityCurveNode = xmlNode.SelectSingleNode("defaultProbabilityCurve"); if (defaultProbabilityCurveNode != null) { if (defaultProbabilityCurveNode.Attributes["href"] != null || defaultProbabilityCurveNode.Attributes["id"] != null) { if (defaultProbabilityCurveNode.Attributes["id"] != null) { defaultProbabilityCurveIDRef_ = defaultProbabilityCurveNode.Attributes["id"].Value; DefaultProbabilityCurve ob = new DefaultProbabilityCurve(defaultProbabilityCurveNode); IDManager.SetID(defaultProbabilityCurveIDRef_, ob); } else if (defaultProbabilityCurveNode.Attributes["href"] != null) { defaultProbabilityCurveIDRef_ = defaultProbabilityCurveNode.Attributes["href"].Value; } else { defaultProbabilityCurve_ = new DefaultProbabilityCurve(defaultProbabilityCurveNode); } } else { defaultProbabilityCurve_ = new DefaultProbabilityCurve(defaultProbabilityCurveNode); } } XmlNode recoveryRateNode = xmlNode.SelectSingleNode("recoveryRate"); if (recoveryRateNode != null) { if (recoveryRateNode.Attributes["href"] != null || recoveryRateNode.Attributes["id"] != null) { if (recoveryRateNode.Attributes["id"] != null) { recoveryRateIDRef_ = recoveryRateNode.Attributes["id"].Value; XsdTypeDecimal ob = new XsdTypeDecimal(recoveryRateNode); IDManager.SetID(recoveryRateIDRef_, ob); } else if (recoveryRateNode.Attributes["href"] != null) { recoveryRateIDRef_ = recoveryRateNode.Attributes["href"].Value; } else { recoveryRate_ = new XsdTypeDecimal(recoveryRateNode); } } else { recoveryRate_ = new XsdTypeDecimal(recoveryRateNode); } } XmlNode recoveryRateCurveNode = xmlNode.SelectSingleNode("recoveryRateCurve"); if (recoveryRateCurveNode != null) { if (recoveryRateCurveNode.Attributes["href"] != null || recoveryRateCurveNode.Attributes["id"] != null) { if (recoveryRateCurveNode.Attributes["id"] != null) { recoveryRateCurveIDRef_ = recoveryRateCurveNode.Attributes["id"].Value; TermCurve ob = new TermCurve(recoveryRateCurveNode); IDManager.SetID(recoveryRateCurveIDRef_, ob); } else if (recoveryRateCurveNode.Attributes["href"] != null) { recoveryRateCurveIDRef_ = recoveryRateCurveNode.Attributes["href"].Value; } else { recoveryRateCurve_ = new TermCurve(recoveryRateCurveNode); } } else { recoveryRateCurve_ = new TermCurve(recoveryRateCurveNode); } } }
public YieldCurveValuation(XmlNode xmlNode) : base(xmlNode) { XmlNodeList inputsNodeList = xmlNode.SelectNodes("inputs"); if (inputsNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in inputsNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { inputsIDRef = item.Attributes["id"].Name; QuotedAssetSet ob = QuotedAssetSet(); IDManager.SetID(inputsIDRef, ob); } else if (item.Attributes.ToString() == "href") { inputsIDRef = item.Attributes["href"].Name; } else { inputs = new QuotedAssetSet(item); } } } XmlNodeList zeroCurveNodeList = xmlNode.SelectNodes("zeroCurve"); if (zeroCurveNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in zeroCurveNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { zeroCurveIDRef = item.Attributes["id"].Name; ZeroRateCurve ob = ZeroRateCurve(); IDManager.SetID(zeroCurveIDRef, ob); } else if (item.Attributes.ToString() == "href") { zeroCurveIDRef = item.Attributes["href"].Name; } else { zeroCurve = new ZeroRateCurve(item); } } } XmlNodeList forwardCurveNodeList = xmlNode.SelectNodes("forwardCurve"); foreach (XmlNode item in forwardCurveNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { forwardCurveIDRef = item.Attributes["id"].Name; List<ForwardRateCurve> ob = new List<ForwardRateCurve>(); ob.Add(new ForwardRateCurve(item)); IDManager.SetID(forwardCurveIDRef, ob); } else if (item.Attributes.ToString() == "href") { forwardCurveIDRef = item.Attributes["href"].Name; } else { forwardCurve.Add(new ForwardRateCurve(item)); } } } XmlNodeList discountFactorCurveNodeList = xmlNode.SelectNodes("discountFactorCurve"); if (discountFactorCurveNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in discountFactorCurveNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { discountFactorCurveIDRef = item.Attributes["id"].Name; TermCurve ob = TermCurve(); IDManager.SetID(discountFactorCurveIDRef, ob); } else if (item.Attributes.ToString() == "href") { discountFactorCurveIDRef = item.Attributes["href"].Name; } else { discountFactorCurve = new TermCurve(item); } } } }
public FxCurveValuation(XmlNode xmlNode) : base(xmlNode) { XmlNodeList settlementCurrencyYieldCurveNodeList = xmlNode.SelectNodes("settlementCurrencyYieldCurve"); if (settlementCurrencyYieldCurveNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in settlementCurrencyYieldCurveNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { settlementCurrencyYieldCurveIDRef = item.Attributes["id"].Name; PricingStructureReference ob = PricingStructureReference(); IDManager.SetID(settlementCurrencyYieldCurveIDRef, ob); } else if (item.Attributes.ToString() == "href") { settlementCurrencyYieldCurveIDRef = item.Attributes["href"].Name; } else { settlementCurrencyYieldCurve = new PricingStructureReference(item); } } } XmlNodeList forecastCurrencyYieldCurveNodeList = xmlNode.SelectNodes("forecastCurrencyYieldCurve"); if (forecastCurrencyYieldCurveNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in forecastCurrencyYieldCurveNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { forecastCurrencyYieldCurveIDRef = item.Attributes["id"].Name; PricingStructureReference ob = PricingStructureReference(); IDManager.SetID(forecastCurrencyYieldCurveIDRef, ob); } else if (item.Attributes.ToString() == "href") { forecastCurrencyYieldCurveIDRef = item.Attributes["href"].Name; } else { forecastCurrencyYieldCurve = new PricingStructureReference(item); } } } XmlNodeList spotRateNodeList = xmlNode.SelectNodes("spotRate"); if (spotRateNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in spotRateNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { spotRateIDRef = item.Attributes["id"].Name; FxRateSet ob = FxRateSet(); IDManager.SetID(spotRateIDRef, ob); } else if (item.Attributes.ToString() == "href") { spotRateIDRef = item.Attributes["href"].Name; } else { spotRate = new FxRateSet(item); } } } XmlNodeList fxForwardCurveNodeList = xmlNode.SelectNodes("fxForwardCurve"); if (fxForwardCurveNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in fxForwardCurveNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { fxForwardCurveIDRef = item.Attributes["id"].Name; TermCurve ob = TermCurve(); IDManager.SetID(fxForwardCurveIDRef, ob); } else if (item.Attributes.ToString() == "href") { fxForwardCurveIDRef = item.Attributes["href"].Name; } else { fxForwardCurve = new TermCurve(item); } } } XmlNodeList fxForwardPointsCurveNodeList = xmlNode.SelectNodes("fxForwardPointsCurve"); if (fxForwardPointsCurveNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in fxForwardPointsCurveNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { fxForwardPointsCurveIDRef = item.Attributes["id"].Name; TermCurve ob = TermCurve(); IDManager.SetID(fxForwardPointsCurveIDRef, ob); } else if (item.Attributes.ToString() == "href") { fxForwardPointsCurveIDRef = item.Attributes["href"].Name; } else { fxForwardPointsCurve = new TermCurve(item); } } } }
public FxCurveValuation(XmlNode xmlNode) : base(xmlNode) { XmlNode settlementCurrencyYieldCurveNode = xmlNode.SelectSingleNode("settlementCurrencyYieldCurve"); if (settlementCurrencyYieldCurveNode != null) { if (settlementCurrencyYieldCurveNode.Attributes["href"] != null || settlementCurrencyYieldCurveNode.Attributes["id"] != null) { if (settlementCurrencyYieldCurveNode.Attributes["id"] != null) { settlementCurrencyYieldCurveIDRef_ = settlementCurrencyYieldCurveNode.Attributes["id"].Value; PricingStructureReference ob = new PricingStructureReference(settlementCurrencyYieldCurveNode); IDManager.SetID(settlementCurrencyYieldCurveIDRef_, ob); } else if (settlementCurrencyYieldCurveNode.Attributes["href"] != null) { settlementCurrencyYieldCurveIDRef_ = settlementCurrencyYieldCurveNode.Attributes["href"].Value; } else { settlementCurrencyYieldCurve_ = new PricingStructureReference(settlementCurrencyYieldCurveNode); } } else { settlementCurrencyYieldCurve_ = new PricingStructureReference(settlementCurrencyYieldCurveNode); } } XmlNode forecastCurrencyYieldCurveNode = xmlNode.SelectSingleNode("forecastCurrencyYieldCurve"); if (forecastCurrencyYieldCurveNode != null) { if (forecastCurrencyYieldCurveNode.Attributes["href"] != null || forecastCurrencyYieldCurveNode.Attributes["id"] != null) { if (forecastCurrencyYieldCurveNode.Attributes["id"] != null) { forecastCurrencyYieldCurveIDRef_ = forecastCurrencyYieldCurveNode.Attributes["id"].Value; PricingStructureReference ob = new PricingStructureReference(forecastCurrencyYieldCurveNode); IDManager.SetID(forecastCurrencyYieldCurveIDRef_, ob); } else if (forecastCurrencyYieldCurveNode.Attributes["href"] != null) { forecastCurrencyYieldCurveIDRef_ = forecastCurrencyYieldCurveNode.Attributes["href"].Value; } else { forecastCurrencyYieldCurve_ = new PricingStructureReference(forecastCurrencyYieldCurveNode); } } else { forecastCurrencyYieldCurve_ = new PricingStructureReference(forecastCurrencyYieldCurveNode); } } XmlNode spotRateNode = xmlNode.SelectSingleNode("spotRate"); if (spotRateNode != null) { if (spotRateNode.Attributes["href"] != null || spotRateNode.Attributes["id"] != null) { if (spotRateNode.Attributes["id"] != null) { spotRateIDRef_ = spotRateNode.Attributes["id"].Value; FxRateSet ob = new FxRateSet(spotRateNode); IDManager.SetID(spotRateIDRef_, ob); } else if (spotRateNode.Attributes["href"] != null) { spotRateIDRef_ = spotRateNode.Attributes["href"].Value; } else { spotRate_ = new FxRateSet(spotRateNode); } } else { spotRate_ = new FxRateSet(spotRateNode); } } XmlNode fxForwardCurveNode = xmlNode.SelectSingleNode("fxForwardCurve"); if (fxForwardCurveNode != null) { if (fxForwardCurveNode.Attributes["href"] != null || fxForwardCurveNode.Attributes["id"] != null) { if (fxForwardCurveNode.Attributes["id"] != null) { fxForwardCurveIDRef_ = fxForwardCurveNode.Attributes["id"].Value; TermCurve ob = new TermCurve(fxForwardCurveNode); IDManager.SetID(fxForwardCurveIDRef_, ob); } else if (fxForwardCurveNode.Attributes["href"] != null) { fxForwardCurveIDRef_ = fxForwardCurveNode.Attributes["href"].Value; } else { fxForwardCurve_ = new TermCurve(fxForwardCurveNode); } } else { fxForwardCurve_ = new TermCurve(fxForwardCurveNode); } } XmlNode fxForwardPointsCurveNode = xmlNode.SelectSingleNode("fxForwardPointsCurve"); if (fxForwardPointsCurveNode != null) { if (fxForwardPointsCurveNode.Attributes["href"] != null || fxForwardPointsCurveNode.Attributes["id"] != null) { if (fxForwardPointsCurveNode.Attributes["id"] != null) { fxForwardPointsCurveIDRef_ = fxForwardPointsCurveNode.Attributes["id"].Value; TermCurve ob = new TermCurve(fxForwardPointsCurveNode); IDManager.SetID(fxForwardPointsCurveIDRef_, ob); } else if (fxForwardPointsCurveNode.Attributes["href"] != null) { fxForwardPointsCurveIDRef_ = fxForwardPointsCurveNode.Attributes["href"].Value; } else { fxForwardPointsCurve_ = new TermCurve(fxForwardPointsCurveNode); } } else { fxForwardPointsCurve_ = new TermCurve(fxForwardPointsCurveNode); } } }
public YieldCurveValuation(XmlNode xmlNode) : base(xmlNode) { XmlNode inputsNode = xmlNode.SelectSingleNode("inputs"); if (inputsNode != null) { if (inputsNode.Attributes["href"] != null || inputsNode.Attributes["id"] != null) { if (inputsNode.Attributes["id"] != null) { inputsIDRef_ = inputsNode.Attributes["id"].Value; QuotedAssetSet ob = new QuotedAssetSet(inputsNode); IDManager.SetID(inputsIDRef_, ob); } else if (inputsNode.Attributes["href"] != null) { inputsIDRef_ = inputsNode.Attributes["href"].Value; } else { inputs_ = new QuotedAssetSet(inputsNode); } } else { inputs_ = new QuotedAssetSet(inputsNode); } } XmlNode zeroCurveNode = xmlNode.SelectSingleNode("zeroCurve"); if (zeroCurveNode != null) { if (zeroCurveNode.Attributes["href"] != null || zeroCurveNode.Attributes["id"] != null) { if (zeroCurveNode.Attributes["id"] != null) { zeroCurveIDRef_ = zeroCurveNode.Attributes["id"].Value; ZeroRateCurve ob = new ZeroRateCurve(zeroCurveNode); IDManager.SetID(zeroCurveIDRef_, ob); } else if (zeroCurveNode.Attributes["href"] != null) { zeroCurveIDRef_ = zeroCurveNode.Attributes["href"].Value; } else { zeroCurve_ = new ZeroRateCurve(zeroCurveNode); } } else { zeroCurve_ = new ZeroRateCurve(zeroCurveNode); } } XmlNodeList forwardCurveNodeList = xmlNode.SelectNodes("forwardCurve"); if (forwardCurveNodeList != null) { this.forwardCurve_ = new List<ForwardRateCurve>(); foreach (XmlNode item in forwardCurveNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] != null) { if (item.Attributes["id"] != null) { forwardCurveIDRef_ = item.Attributes["id"].Value; forwardCurve_.Add(new ForwardRateCurve(item)); IDManager.SetID(forwardCurveIDRef_, forwardCurve_[forwardCurve_.Count - 1 ]); } else if (item.Attributes["href"] != null) { forwardCurveIDRef_ = item.Attributes["href"].Value; } else { forwardCurve_.Add(new ForwardRateCurve(item)); } } else { forwardCurve_.Add(new ForwardRateCurve(item)); } } } XmlNode discountFactorCurveNode = xmlNode.SelectSingleNode("discountFactorCurve"); if (discountFactorCurveNode != null) { if (discountFactorCurveNode.Attributes["href"] != null || discountFactorCurveNode.Attributes["id"] != null) { if (discountFactorCurveNode.Attributes["id"] != null) { discountFactorCurveIDRef_ = discountFactorCurveNode.Attributes["id"].Value; TermCurve ob = new TermCurve(discountFactorCurveNode); IDManager.SetID(discountFactorCurveIDRef_, ob); } else if (discountFactorCurveNode.Attributes["href"] != null) { discountFactorCurveIDRef_ = discountFactorCurveNode.Attributes["href"].Value; } else { discountFactorCurve_ = new TermCurve(discountFactorCurveNode); } } else { discountFactorCurve_ = new TermCurve(discountFactorCurveNode); } } }
public CreditCurveValuation(XmlNode xmlNode) : base(xmlNode) { XmlNodeList inputsNodeList = xmlNode.SelectNodes("inputs"); if (inputsNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in inputsNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { inputsIDRef = item.Attributes["id"].Name; QuotedAssetSet ob = QuotedAssetSet(); IDManager.SetID(inputsIDRef, ob); } else if (item.Attributes.ToString() == "href") { inputsIDRef = item.Attributes["href"].Name; } else { inputs = new QuotedAssetSet(item); } } } XmlNodeList defaultProbabilityCurveNodeList = xmlNode.SelectNodes("defaultProbabilityCurve"); if (defaultProbabilityCurveNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in defaultProbabilityCurveNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { defaultProbabilityCurveIDRef = item.Attributes["id"].Name; DefaultProbabilityCurve ob = DefaultProbabilityCurve(); IDManager.SetID(defaultProbabilityCurveIDRef, ob); } else if (item.Attributes.ToString() == "href") { defaultProbabilityCurveIDRef = item.Attributes["href"].Name; } else { defaultProbabilityCurve = new DefaultProbabilityCurve(item); } } } XmlNodeList recoveryRateNodeList = xmlNode.SelectNodes("recoveryRate"); if (recoveryRateNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in recoveryRateNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { recoveryRateIDRef = item.Attributes["id"].Name; XsdTypeDecimal ob = XsdTypeDecimal(); IDManager.SetID(recoveryRateIDRef, ob); } else if (item.Attributes.ToString() == "href") { recoveryRateIDRef = item.Attributes["href"].Name; } else { recoveryRate = new XsdTypeDecimal(item); } } } XmlNodeList recoveryRateCurveNodeList = xmlNode.SelectNodes("recoveryRateCurve"); if (recoveryRateCurveNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in recoveryRateCurveNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { recoveryRateCurveIDRef = item.Attributes["id"].Name; TermCurve ob = TermCurve(); IDManager.SetID(recoveryRateCurveIDRef, ob); } else if (item.Attributes.ToString() == "href") { recoveryRateCurveIDRef = item.Attributes["href"].Name; } else { recoveryRateCurve = new TermCurve(item); } } } }
public CreditCurveValuation(XmlNode xmlNode) : base(xmlNode) { XmlNodeList inputsNodeList = xmlNode.SelectNodes("inputs"); if (inputsNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in inputsNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { inputsIDRef = item.Attributes["id"].Name; QuotedAssetSet ob = QuotedAssetSet(); IDManager.SetID(inputsIDRef, ob); } else if (item.Attributes.ToString() == "href") { inputsIDRef = item.Attributes["href"].Name; } else { inputs = new QuotedAssetSet(item); } } } XmlNodeList defaultProbabilityCurveNodeList = xmlNode.SelectNodes("defaultProbabilityCurve"); if (defaultProbabilityCurveNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in defaultProbabilityCurveNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { defaultProbabilityCurveIDRef = item.Attributes["id"].Name; DefaultProbabilityCurve ob = DefaultProbabilityCurve(); IDManager.SetID(defaultProbabilityCurveIDRef, ob); } else if (item.Attributes.ToString() == "href") { defaultProbabilityCurveIDRef = item.Attributes["href"].Name; } else { defaultProbabilityCurve = new DefaultProbabilityCurve(item); } } } XmlNodeList recoveryRateNodeList = xmlNode.SelectNodes("recoveryRate"); if (recoveryRateNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in recoveryRateNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { recoveryRateIDRef = item.Attributes["id"].Name; XsdTypeDecimal ob = XsdTypeDecimal(); IDManager.SetID(recoveryRateIDRef, ob); } else if (item.Attributes.ToString() == "href") { recoveryRateIDRef = item.Attributes["href"].Name; } else { recoveryRate = new XsdTypeDecimal(item); } } } XmlNodeList recoveryRateCurveNodeList = xmlNode.SelectNodes("recoveryRateCurve"); if (recoveryRateCurveNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in recoveryRateCurveNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { recoveryRateCurveIDRef = item.Attributes["id"].Name; TermCurve ob = TermCurve(); IDManager.SetID(recoveryRateCurveIDRef, ob); } else if (item.Attributes.ToString() == "href") { recoveryRateCurveIDRef = item.Attributes["href"].Name; } else { recoveryRateCurve = new TermCurve(item); } } } }
public FxCurveValuation(XmlNode xmlNode) : base(xmlNode) { XmlNodeList settlementCurrencyYieldCurveNodeList = xmlNode.SelectNodes("settlementCurrencyYieldCurve"); if (settlementCurrencyYieldCurveNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in settlementCurrencyYieldCurveNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { settlementCurrencyYieldCurveIDRef = item.Attributes["id"].Name; PricingStructureReference ob = PricingStructureReference(); IDManager.SetID(settlementCurrencyYieldCurveIDRef, ob); } else if (item.Attributes.ToString() == "href") { settlementCurrencyYieldCurveIDRef = item.Attributes["href"].Name; } else { settlementCurrencyYieldCurve = new PricingStructureReference(item); } } } XmlNodeList forecastCurrencyYieldCurveNodeList = xmlNode.SelectNodes("forecastCurrencyYieldCurve"); if (forecastCurrencyYieldCurveNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in forecastCurrencyYieldCurveNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { forecastCurrencyYieldCurveIDRef = item.Attributes["id"].Name; PricingStructureReference ob = PricingStructureReference(); IDManager.SetID(forecastCurrencyYieldCurveIDRef, ob); } else if (item.Attributes.ToString() == "href") { forecastCurrencyYieldCurveIDRef = item.Attributes["href"].Name; } else { forecastCurrencyYieldCurve = new PricingStructureReference(item); } } } XmlNodeList spotRateNodeList = xmlNode.SelectNodes("spotRate"); if (spotRateNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in spotRateNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { spotRateIDRef = item.Attributes["id"].Name; FxRateSet ob = FxRateSet(); IDManager.SetID(spotRateIDRef, ob); } else if (item.Attributes.ToString() == "href") { spotRateIDRef = item.Attributes["href"].Name; } else { spotRate = new FxRateSet(item); } } } XmlNodeList fxForwardCurveNodeList = xmlNode.SelectNodes("fxForwardCurve"); if (fxForwardCurveNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in fxForwardCurveNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { fxForwardCurveIDRef = item.Attributes["id"].Name; TermCurve ob = TermCurve(); IDManager.SetID(fxForwardCurveIDRef, ob); } else if (item.Attributes.ToString() == "href") { fxForwardCurveIDRef = item.Attributes["href"].Name; } else { fxForwardCurve = new TermCurve(item); } } } XmlNodeList fxForwardPointsCurveNodeList = xmlNode.SelectNodes("fxForwardPointsCurve"); if (fxForwardPointsCurveNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in fxForwardPointsCurveNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { fxForwardPointsCurveIDRef = item.Attributes["id"].Name; TermCurve ob = TermCurve(); IDManager.SetID(fxForwardPointsCurveIDRef, ob); } else if (item.Attributes.ToString() == "href") { fxForwardPointsCurveIDRef = item.Attributes["href"].Name; } else { fxForwardPointsCurve = new TermCurve(item); } } } }