Ejemplo n.º 1
0
        public static SwapAndTagTypes GetTaggingTypeForClientDate(Client pClient, int year_month_day)
        {
            var tagTypes = pClient.m_tag_types_by_target_date;

            if (tagTypes.Count == 0)
                return new SwapAndTagTypes
                {
                    m_sleeveTagType = SleeveTaggingType.Untagged,
                    m_swapTagType = SwapType.NoSwapDetail
                };

            if (tagTypes.Count == 1)
            {
                return tagTypes.First().Value;
            }

            var rit = find_if(tagTypes.rbegin(), tagTypes.rend(), not1(bind2nd(HasGreaterTargetDate(), year_month_day)));

            // the anchor date established in SessionData::FillTagTypes() (19700101) should be before all flow and target dates
            if (rit == tagTypes.rend())
            {
                throw new DataInconsistencyException(
                    string.Format("Account had flow or target date ({0}) before No-FI anchor date ({1}) searching for tag/swap-type on account '{2}'. Contact Support.",
                        year_month_day, tagTypes.First().Key, pClient.m_client_generic_data.m_sShortname));
            }
            return rit->second;
        }
Ejemplo n.º 2
0
        private bool calculatePerformanceFromBeginning(
            BenchAllocation benchAllocation,
            BenchReturns benchmarkReturns,
            int yearMonth, ClientModelBench clientModelBench,
            int accountId, Client clientData)
        {
            var benchMonthReturns = benchmarkReturns.m_bench_monthly_returns[yearMonth];
            var benchDayReturns = benchmarkReturns.m_bench_daily_returns[benchAllocation.m_date_to];

            var iLoop = 1;

            clientModelBench.m_totReturn = ((1 + clientModelBench.m_totReturn)*(1 + benchMonthReturns.m_total_return)/
                                            (benchDayReturns.m_price_return_to_month_end)) - 1;

            clientModelBench.m_totPriceReturn = ((1 + clientModelBench.m_totPriceReturn) * (1 + benchMonthReturns.m_price_return) /
                                                (benchDayReturns.m_price_return_to_month_end)) - 1;

            clientModelBench.m_totDivReturn += (benchMonthReturns.m_dividend_return);
        }