コード例 #1
0
ファイル: FxMatrix.cs プロジェクト: biqueta/qwack
 public TO_FxMatrix GetTransportObject() =>
 new TO_FxMatrix
 {
     BaseCurrency      = BaseCurrency.Ccy,
     BuildDate         = BuildDate,
     DiscountCurveMap  = DiscountCurveMap.ToDictionary(x => x.Key.Ccy, x => x.Value),
     SpotRates         = SpotRates.ToDictionary(x => x.Key.Ccy, x => x.Value),
     FxPairDefinitions = FxPairDefinitions.Select(x => x.GetTransportObject()).ToList()
 };
コード例 #2
0
ファイル: FxMatrix.cs プロジェクト: biqueta/qwack
        public FxPair GetFxPair(Currency domesticCcy, Currency foreignCcy)
        {
            if (domesticCcy == foreignCcy)
            {
                return new FxPair {
                           Domestic = domesticCcy, Foreign = foreignCcy, PrimaryCalendar = new Calendar(), SpotLag = 0.Day()
                }
            }
            ;

            var pair = FxPairDefinitions.SingleOrDefault(x => x.Domestic == domesticCcy && x.Foreign == foreignCcy);

            return(pair ??
                   FxPairDefinitions.SingleOrDefault(x => x.Foreign == domesticCcy && x.Domestic == foreignCcy) ??
                   new FxPair {
                Domestic = domesticCcy, Foreign = foreignCcy, PrimaryCalendar = foreignCcy.SettlementCalendar.Merge(domesticCcy.SettlementCalendar), SpotLag = 2.Bd()
            });
        }
コード例 #3
0
ファイル: FxMatrix.cs プロジェクト: mpvyard/qwack
 public FxPair GetFxPair(Currency domesticCcy, Currency foreignCcy) => FxPairDefinitions.SingleOrDefault(x => x.Domestic == domesticCcy && x.Foreign == foreignCcy);