示例#1
0
 public CsPricingResult(Guid clientId,
                        Guid requestId,
                        PricingResult result,
                        TradeInfoBase tradeInfo)
 {
     ClientId  = clientId;
     RequestId = requestId;
     TradeInfo = tradeInfo;
     Result    = result;
 }
示例#2
0
 public RateMktData(string tenor, double rate,
                    string indexType,
                    string instrumentType,
                    string curveName,
                    TradeInfoBase tradeInfo = null)
 {
     Tenor          = tenor;
     Rate           = rate;
     IndexType      = indexType;
     InstrumentType = tradeInfo == null ? instrumentType : tradeInfo.InstrumentType;
     TradeInfo      = tradeInfo;
     Name           = tradeInfo == null
                         ? (string.Format("{0}_{1}_{2}_{3}", string.IsNullOrEmpty(curveName) ? "" : curveName, indexType, instrumentType, tenor))
                         : string.Format("{0}_{1}_{2}", string.IsNullOrEmpty(curveName) ? "" : curveName, tradeInfo.InstrumentType, tradeInfo.TradeId);
 }
示例#3
0
        public static IValuationFunction ToVf(TradeInfoBase tradeInfo)
        {
            IValuationFunction vf;

            // sean todo // tradeInfo.GetValuationFunction
            if (tradeInfo is BondInfoBase)
            {
                vf = new BondVf((BondInfoBase)tradeInfo);
            }
            else if (tradeInfo is VanillaOptionInfo)
            {
                vf = new VanillaOptionVf((VanillaOptionInfo)tradeInfo);
            }
            else if (tradeInfo is BarrierOptionInfo)
            {
                vf = new BarrierOptionVf((BarrierOptionInfo)tradeInfo);
            }
            else if (tradeInfo is BinaryOptionInfo)
            {
                vf = new BinaryOptionVf((BinaryOptionInfo)tradeInfo);
            }
            else if (tradeInfo is AsianOptionInfo)
            {
                vf = new AsianOptionVf((AsianOptionInfo)tradeInfo);
            }
            else if (tradeInfo is RainbowOptionInfo)
            {
                vf = new RainbowOptionVf((RainbowOptionInfo)tradeInfo);
            }
            else if (tradeInfo is SpreadOptionInfo)
            {
                vf = new SpreadOptionVf((SpreadOptionInfo)tradeInfo);
            }
            else if (tradeInfo is InterestRateSwapInfo)
            {
                vf = new InterestRateSwapVf((InterestRateSwapInfo)tradeInfo);
            }
            else if (tradeInfo is FixedLegInfo)
            {
                vf = new FixedLegVf((FixedLegInfo)tradeInfo);
            }
            else if (tradeInfo is FloatingLegInfo)
            {
                vf = new FloatingLegVf((FloatingLegInfo)tradeInfo);
            }
            else if (tradeInfo is BondFuturesInfo)
            {
                vf = new BondFuturesVf((BondFuturesInfo)tradeInfo);
            }
            else if (tradeInfo is LoanInfo)
            {
                vf = new LoanVf((LoanInfo)tradeInfo);
            }
            else if (tradeInfo is HoldingPeriodInfo)
            {
                vf = new HoldingPeriodVf((HoldingPeriodInfo)tradeInfo);
            }
            else if (tradeInfo is AbsWithRepurchaseInfo)
            {
                vf = new AbsWithRepurchaseVf((AbsWithRepurchaseInfo)tradeInfo);
            }
            else if (tradeInfo is ConvertibleBondInfo)
            {
                vf = new ConvertibleBondVf((ConvertibleBondInfo)tradeInfo);
            }
            else
            {
                throw new PricingLibraryException("Unknowy trade info type");
            }

            return(vf);
        }
 public PricingEcosystemException(string msg, TradeInfoBase tradeInfo)
     : base(msg)
 {
     TradeInfo = tradeInfo;
 }
示例#5
0
 /// <summary>
 /// Convert trade info into a two column array of {label, value} paris.
 /// </summary>
 /// <param name="tradeInfo">TradeInfo.</param>
 /// <param name="outputLabels">Output labels. If left null or empty array, all labels will be returned.</param>
 /// <returns></returns>
 public static object ToTradeInfoInLabelData(this TradeInfoBase tradeInfo, string[] outputLabels)
 {
     return(GetObjProperties(tradeInfo, outputLabels));
 }