Example #1
0
        public void ConvertOutrightRiskToRiskOutputObject()
        {
            // This is sensitive to the order of instruments ..
            CurveTenor[] tenors = { CurveTenor.DiscOis, CurveTenor.Fwd1M, CurveTenor.Fwd3M, CurveTenor.Fwd6M, CurveTenor.Fwd1Y };

            int j = 0;

            foreach (CurveTenor tenor in tenors)
            {
                OutrightRiskOutput tempRiskOutput = new OutrightRiskOutput(_asOf, tenor);

                if (tenor == CurveTenor.DiscOis)
                {
                    for (int i = 0; i < _jacobian.CurveDimensions[tenor]; i++)
                    {
                        string ident = _jacobian.Instruments[j].Identifier;
                        tempRiskOutput.AddRiskCalculation(ident, _outrightRisk[j]);
                        j += 1;
                    }

                    OutrightRiskOutput.AddDiscRisk(tempRiskOutput);
                }
                else
                {
                    for (int i = 0; i < _jacobian.CurveDimensions[tenor]; i++)
                    {
                        string ident = _jacobian.Instruments[j].Identifier;
                        tempRiskOutput.AddRiskCalculation(ident, _outrightRisk[j]);
                        j += 1;
                    }

                    OutrightRiskOutput.AddForwardRisk(tenor, tempRiskOutput);
                }
            }
        }
Example #2
0
 public void AddDiscRisk(OutrightRiskOutput riskOutput)
 {
     DiscRisk = riskOutput;
 }
Example #3
0
 public void AddForwardRisk(CurveTenor tenor, OutrightRiskOutput riskOutput)
 {
     FwdRiskCollection[tenor] = riskOutput;
 }