예제 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="currency1"></param>
        /// <param name="currency2"></param>
        /// <param name="quoteBasis"></param>
        /// <param name="spotRate"></param>
        /// <returns></returns>
        public static ExchangeRate Create(string currency1, string currency2, QuoteBasisEnum quoteBasis,
                                          Decimal spotRate)
        {
            var exchangeRate = new ExchangeRate
            {
                quotedCurrencyPair = QuotedCurrencyPair.Create(currency1, currency2, quoteBasis),
                rate          = spotRate,
                rateSpecified = true
            };

            return(exchangeRate);
        }
예제 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="currency1"></param>
        /// <param name="currency2"></param>
        /// <param name="quoteBasis"></param>
        /// <param name="spotRate"></param>
        /// <param name="forwardRate"></param>
        /// <param name="forwardPoints"></param>
        /// <returns></returns>
        public static ExchangeRate Create(string currency1, string currency2, QuoteBasisEnum quoteBasis,
                                          Decimal spotRate, Decimal forwardRate, Decimal?forwardPoints)
        {
            var exchangeRate = new ExchangeRate
            {
                quotedCurrencyPair = QuotedCurrencyPair.Create(currency1, currency2, quoteBasis),
                rate              = forwardRate,
                rateSpecified     = true,
                spotRate          = spotRate,
                spotRateSpecified = true
            };

            if (forwardPoints != null)
            {
                exchangeRate.forwardPointsField = (decimal)forwardPoints;
            }
            return(exchangeRate);
        }