//------------------------------------------------------------------------- public override PortfolioItemSummary summarize() { // ID x 200 string description = SecurityId.StandardId.Value + " x " + SummarizerUtils.value(Quantity); return(SummarizerUtils.summary(this, ProductType.BOND_FUTURE_OPTION, description, Currency)); }
//------------------------------------------------------------------------- public override PortfolioItemSummary summarize() { // AAPL x 200 string description = SecurityId.StandardId.Value + " x " + SummarizerUtils.value(Quantity); return(SummarizerUtils.summary(this, ProductType.SECURITY, description, Currency)); }
//------------------------------------------------------------------------- public PortfolioItemSummary summarize() { // O-ECAG-OGBS-201706-P1.50 x 200, Jun17 P1.50 string option = security.summaryDescription(); string description = SecurityId.StandardId.Value + " x " + SummarizerUtils.value(Quantity) + ", " + option; return(SummarizerUtils.summary(this, ProductType.ETD_OPTION, description, Currency)); }
//------------------------------------------------------------------------- public PortfolioItemSummary summarize() { // F-ECAG-FGBS-201706 x 200, Jun17 string future = security.summaryDescription(); string description = SecurityId.StandardId.Value + " x " + SummarizerUtils.value(Quantity) + ", " + future; return(SummarizerUtils.summary(this, ProductType.ETD_FUTURE, description, Currency)); }
// a summary of the leg private string legSummary(SwapLeg leg) { if (leg is RateCalculationSwapLeg) { RateCalculationSwapLeg rcLeg = (RateCalculationSwapLeg)leg; RateCalculation calculation = rcLeg.Calculation; if (calculation is FixedRateCalculation) { FixedRateCalculation calc = (FixedRateCalculation)calculation; string vary = calc.Rate.Steps.Count > 0 || calc.Rate.StepSequence.Present ? " variable" : ""; return(SummarizerUtils.percent(calc.Rate.InitialValue) + vary); } if (calculation is IborRateCalculation) { IborRateCalculation calc = (IborRateCalculation)calculation; string gearing = calc.Gearing.map(g => " * " + SummarizerUtils.value(g.InitialValue)).orElse(""); string spread = calc.Spread.map(s => " + " + SummarizerUtils.percent(s.InitialValue)).orElse(""); return(calc.Index.Name + gearing + spread); } if (calculation is OvernightRateCalculation) { OvernightRateCalculation calc = (OvernightRateCalculation)calculation; string avg = calc.AccrualMethod == OvernightAccrualMethod.AVERAGED ? " avg" : ""; string gearing = calc.Gearing.map(g => " * " + SummarizerUtils.value(g.InitialValue)).orElse(""); string spread = calc.Spread.map(s => " + " + SummarizerUtils.percent(s.InitialValue)).orElse(""); return(calc.Index.Name + avg + gearing + spread); } if (calculation is InflationRateCalculation) { InflationRateCalculation calc = (InflationRateCalculation)calculation; string gearing = calc.Gearing.map(g => " * " + SummarizerUtils.value(g.InitialValue)).orElse(""); return(calc.Index.Name + gearing); } } if (leg is KnownAmountSwapLeg) { KnownAmountSwapLeg kaLeg = (KnownAmountSwapLeg)leg; string vary = kaLeg.Amount.Steps.Count > 0 || kaLeg.Amount.StepSequence.Present ? " variable" : ""; return(SummarizerUtils.amount(kaLeg.Currency, kaLeg.Amount.InitialValue) + vary); } ImmutableSet <Index> allIndices = leg.allIndices(); return(allIndices.Empty ? "Fixed" : allIndices.ToString()); }