Example #1
0
        }//cSecurity constructor

        #endregion Consturctors, Initialization & Destructor

        #region Methods

        #region Base methods

        public void Init(IPortfolioBL cPort)
        {
            m_objPortfolio    = cPort;
            m_objErrorHandler = m_objPortfolio.cErrorLog;

            m_objColHandler       = m_objPortfolio.ColHandler;
            m_objSecAnalytics     = new cSecAnalytics(this, m_objErrorHandler, m_objColHandler);
            m_objPrices.Portfolio = cPort;
            try
            {
                //LR: why do we have 5 years of date range here ???
                m_sPricesRange = new cDateRange(DateTime.Today.AddYears(-cProperties.DatesInterval).AddDays(-1), DateTime.Today.AddDays(-1));


                m_objRates      = new cRateData(this, m_objPortfolio, false);
                m_objCovarData  = new cCovarCorrelData(this, m_objColHandler, m_objErrorHandler, true);
                m_objCorrelData = new cCovarCorrelData(this, m_objColHandler, m_objErrorHandler, false);
            }
            catch (Exception ex) { m_objErrorHandler.LogInfo(ex); }
        }
Example #2
0
        private List <double> m_colVolumes = new List <double>(); // Collection of traded volumes for each day in full date-range

        #endregion Data members

        #region Consturctors, Initialization & Destructor

        public cSecurity(IPortfolioBL cPort, string secName, string secSymbol)
        {
            m_objPortfolio    = cPort;
            m_objErrorHandler = m_objPortfolio.cErrorLog;

            m_objColHandler    = m_objPortfolio.ColHandler;
            m_objSecProperties = new cSecProperties(m_objErrorHandler, m_objPortfolio);
            m_objSecAnalytics  = new cSecAnalytics(this, m_objErrorHandler, m_objColHandler);
            m_objSecProperties.SecurityName   = m_objSecProperties.getSecName(secName); // No ' signs + trim spaces
            m_objSecProperties.SecuritySymbol = secSymbol;
            m_objSecProperties.SecColor       = System.Drawing.Color.FromArgb(cProperties.RndGenerator.Next(255), cProperties.RndGenerator.Next(255), cProperties.RndGenerator.Next(255));
            m_objPrices = new cPriceData(this, m_objPortfolio);
            try
            {
                m_sPricesRange = new cDateRange(DateTime.Today.AddYears(-cProperties.DatesInterval).AddDays(-1), DateTime.Today.AddDays(-1));


                m_objRates      = new cRateData(this, m_objPortfolio, false);
                m_objCovarData  = new cCovarCorrelData(this, m_objColHandler, m_objErrorHandler, true);
                m_objCorrelData = new cCovarCorrelData(this, m_objColHandler, m_objErrorHandler, false);
            }
            catch (Exception ex) { m_objErrorHandler.LogInfo(ex); }
        }//cSecurity constructor