public double ValueInstrumentFromFactory(LinearRateModel model, string instrument) { // Values an instrument contained in the instrument factory using a // linear rate model. Note that value here means calculating the value // par rate (which is how trades are quoted). QuoteType type = InstrumentTypeMap[instrument]; switch (type) { case QuoteType.ParSwapRate: return(model.IrParSwapRate(IrSwaps[instrument])); case QuoteType.ParBasisSpread: return(model.ParBasisSpread(BasisSwaps[instrument])); case QuoteType.OisRate: return(model.OisRateSimple(OisSwaps[instrument])); case QuoteType.FraRate: return(model.ParFraRate(Fras[instrument])); case QuoteType.FuturesRate: return(model.ParFutureRate(Futures[instrument])); case QuoteType.Deposit: return(model.ParDepositRate(Deposits[instrument])); default: throw new InvalidOperationException("Instrument QuoteType not supported..."); } }
public void UpdateFixedRateToPar(LinearRateModel model) { FixedRate = model.ParDepositRate(this); }