Esempio n. 1
0
        }//constructor

        #endregion Constructors, Initialization & Destructor

        #region Methods

        #region General methods

        public cSecProperties Clone()
        { // Clones properties
            cSecProperties cFinalProps = new cSecProperties(m_objErrorHandler, m_objPortfolio);

            cFinalProps.SecurityName   = this.m_strSecName;
            cFinalProps.SecuritySymbol = this.m_strSecSymbol;
            cFinalProps.ISIN           = this.m_strISIN;
            cFinalProps.PortSecurityId = this.m_iPortSecId;
            cFinalProps.NumericID      = this.m_iNumericId;
            cFinalProps.SecColor       = this.m_clrSecColor;
            cFinalProps.Sector         = this.m_catSector;
            cFinalProps.Market         = this.m_catMarket;
            cFinalProps.SecurityType   = this.m_catSecType;
            //cFinalProps.Currency = this.m_catCurrency;

            return(cFinalProps);
        }//Clone
Esempio n. 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