Exemplo n.º 1
0
        public UIManager(ManagerFileRecord managerFileRecord, StatsRecord dbStats, StatsRecord citiStats, StatsRecord jlsStats)
        {
            // create a new manager file record
            // in the UI for comparison with
            // disk file data
            m_managerFileRecord = new ManagerFileRecord();

            m_managerFileRecord.ManagerName              = managerFileRecord.ManagerName;
            m_managerFileRecord.DBManagerName            = managerFileRecord.DBManagerName;
            m_managerFileRecord.CITIManagerName          = managerFileRecord.CITIManagerName;
            m_managerFileRecord.MorganStanleyManagerName = managerFileRecord.MorganStanleyManagerName;
            m_managerFileRecord.JLSName      = managerFileRecord.JLSName;
            m_managerFileRecord.Location     = managerFileRecord.Location;
            m_managerFileRecord.ContactName  = managerFileRecord.ContactName;
            m_managerFileRecord.ContactPhone = managerFileRecord.ContactPhone;
            m_managerFileRecord.FirmCode     = managerFileRecord.FirmCode;
            m_managerFileRecord.ProgramCode  = managerFileRecord.ProgramCode;
            m_managerFileRecord.Strategy     = managerFileRecord.Strategy;
            m_managerFileRecord.SubStrat     = managerFileRecord.SubStrat;
            m_managerFileRecord.MktsFocus    = managerFileRecord.MktsFocus;

            if (Utility.FindManagerInStitch(managerFileRecord.ManagerName, frmMain.MainForm.StitchDatabaseFile) != null)
            {
                m_existsInStitch = true;
            }
            else
            {
                m_existsInStitch = false;
            }


            m_dbStats   = dbStats;
            m_citiStats = citiStats;
            m_jlsStats  = jlsStats;
        }
Exemplo n.º 2
0
        public static StatsRecord FindManagerInStats(string managerName, StatsFile statsFile)
        {
            StatsRecord statsRecord = null;

            List <StatsRecord> statsRecords = statsFile.StatsRecords();

            foreach (StatsRecord rec in statsRecords)
            {
                if (rec.ManagerName == managerName)
                {
                    statsRecord = rec;
                    break;
                }
            }

            return(statsRecord);
        }
Exemplo n.º 3
0
        public UIManager(AliasNamesRecord aliasNamesRecord, StitchDatabaseFileRecord stitchDatabaseFileRecord, StatsRecord dbStats, StatsRecord citiStats, StatsRecord jlsStats)
        {
            // create a new manager file record
            // in the UI for comparison with
            // disk file data
            m_managerFileRecord = new ManagerFileRecord();

            // alias names
            m_managerFileRecord.ManagerName              = aliasNamesRecord.ManagerName;
            m_managerFileRecord.DBManagerName            = aliasNamesRecord.DBManagerName;
            m_managerFileRecord.CITIManagerName          = aliasNamesRecord.CITIManagerName;
            m_managerFileRecord.MorganStanleyManagerName = aliasNamesRecord.MorganStanleyManagerName;
            m_managerFileRecord.JLSName     = aliasNamesRecord.JLS_Has_Data_Sent_directly_from_Mgr;
            m_managerFileRecord.FirmCode    = aliasNamesRecord.FirmCode;
            m_managerFileRecord.ProgramCode = aliasNamesRecord.ProgramCode;

            // stitch database
            if (stitchDatabaseFileRecord != null)
            {
                m_managerFileRecord.Strategy  = stitchDatabaseFileRecord.Strategy;
                m_managerFileRecord.SubStrat  = stitchDatabaseFileRecord.SubStrat;
                m_managerFileRecord.MktsFocus = stitchDatabaseFileRecord.MktsFocus;
                m_existsInStitch = true;
            }
            else
            {
                m_managerFileRecord.Strategy  = String.Empty;
                m_managerFileRecord.SubStrat  = String.Empty;
                m_managerFileRecord.MktsFocus = String.Empty;
                m_existsInStitch = false;
            }

            // these only exist in manager.csv file
            m_managerFileRecord.Location     = "";
            m_managerFileRecord.ContactName  = "";
            m_managerFileRecord.ContactPhone = "";


            //m_aliasNamesRecord = aliasNamesRecord;
            m_dbStats   = dbStats;
            m_citiStats = citiStats;
            m_jlsStats  = jlsStats;
        }
Exemplo n.º 4
0
        private void CreateManagerObjects_FromAliasNamesAndStitch()
        {
            m_managers = new List <UIManager>();
            UIManager   manager   = null;
            StatsRecord dbStats   = null;
            StatsRecord citiStats = null;
            StatsRecord jlsStats  = null;
            StitchDatabaseFileRecord stitchRec = null;

            foreach (AliasNamesRecord aliasNamesRecord in m_aliasNamesFile.GetList())
            {
                dbStats   = Utility.FindManagerInStats(aliasNamesRecord.ManagerName, m_dbStatsFile);
                citiStats = Utility.FindManagerInStats(aliasNamesRecord.ManagerName, m_citiStatsFile);
                jlsStats  = Utility.FindManagerInStats(aliasNamesRecord.ManagerName, m_jlsStatsFile);
                stitchRec = Utility.FindManagerInStitch(aliasNamesRecord.ManagerName, m_stitchDatabaseFile);
                manager   = new UIManager(aliasNamesRecord, stitchRec, dbStats, citiStats, jlsStats);
                m_managers.Add(manager);
            }
        }
Exemplo n.º 5
0
        public List <StatsRecord> StatsRecords()
        {
            List <StatsRecord> recs = new List <StatsRecord>();

            string line;

            string[] fields    = null;
            int      CODE_FIRM = 0;
            string   field     = string.Empty;

            for (int i = 1; i < m_lines.Length; i++)
            {
                line = m_lines[i];

                // skip blank lines
                if (line.Trim().Length == 0)
                {
                    continue;
                }

                fields = line.Split(',');

                // create new record object
                StatsRecord rec = new StatsRecord();

                field           = fields[Actual_Idx];
                field           = field.Replace("\"", "");
                rec.ManagerName = field;

                field         = fields[Stdt_Idx];
                field         = field.Replace("\"", "");
                rec.StartDate = DateTime.Parse(field);

                field       = fields[Enddt_Idx];
                field       = field.Replace("\"", "");
                rec.EndDate = DateTime.Parse(field);

                field = fields[Average_Idx];
                field = field.Replace("\"", "");
                if (field != "NA")
                {
                    rec.Average = Decimal.Parse(field);
                }
                else
                {
                    rec.Average = 0;
                }

                field = fields[Volty_Idx];
                field = field.Replace("\"", "");
                if (field != "NA")
                {
                    rec.Volatility = Decimal.Parse(field);
                }
                else
                {
                    rec.Volatility = 0;
                }

                field = fields[Sortino_Idx];
                field = field.Replace("\"", "");
                if (field != "NA")
                {
                    rec.Sortino = Decimal.Parse(field);
                }
                else
                {
                    rec.Sortino = 0;
                }

                field = fields[Corr_Idx];
                field = field.Replace("\"", "");
                if (field != "NA")
                {
                    rec.Correlation = Decimal.Parse(field);
                }
                else
                {
                    rec.Correlation = 0;
                }

                field = fields[VIXCorr_Idx];
                field = field.Replace("\"", "");
                if (field != "NA")
                {
                    rec.VIXCorrelation = Decimal.Parse(field);
                }
                else
                {
                    rec.VIXCorrelation = 0;
                }

                field = fields[CTACorr_Idx];
                field = field.Replace("\"", "");
                if (field != "NA")
                {
                    rec.CTACorrelation = Decimal.Parse(field);
                }
                else
                {
                    rec.CTACorrelation = 0;
                }

                recs.Add(rec);
            }

            return(recs);
        }
Exemplo n.º 6
0
        private void ShowManagerData()
        {
            dgvManagersNew.Rows.Clear();

            UIManager uiManager = null;

            for (int i = 0; i < m_managers.Count; i++)
            {
                uiManager = m_managers[i];

                // Don't show filtered managers
                if (uiManager.DontShow == true)
                {
                    continue;
                }

                dgvManagersNew.Rows.Add();

                // and add manager info to row
                dgvManagersNew.Rows[i].Cells[(int)ManagerCols.Manager].Value = uiManager.ManagerFileRecord.ManagerName;

                dgvManagersNew.Rows[i].Cells[(int)ManagerCols.InStitch].Value        = uiManager.ExistsInStitch;
                dgvManagersNew.Rows[i].Cells[(int)ManagerCols.DBManagerName].Value   = uiManager.ManagerFileRecord.DBManagerName;
                dgvManagersNew.Rows[i].Cells[(int)ManagerCols.CITIManagerName].Value = uiManager.ManagerFileRecord.CITIManagerName;
                dgvManagersNew.Rows[i].Cells[(int)ManagerCols.JLSName].Value         = uiManager.ManagerFileRecord.JLSName;
                dgvManagersNew.Rows[i].Cells[(int)ManagerCols.Location].Value        = uiManager.ManagerFileRecord.Location;
                dgvManagersNew.Rows[i].Cells[(int)ManagerCols.ContactName].Value     = uiManager.ManagerFileRecord.ContactName;
                dgvManagersNew.Rows[i].Cells[(int)ManagerCols.ContactPhone].Value    = uiManager.ManagerFileRecord.ContactPhone;

                dgvManagersNew.Rows[i].Cells[(int)ManagerCols.ManagerCode].Value = uiManager.ManagerFileRecord.FirmCode;
                dgvManagersNew.Rows[i].Cells[(int)ManagerCols.ProgramCode].Value = uiManager.ManagerFileRecord.ProgramCode.ToString();

                dgvManagersNew.Rows[i].Cells[(int)ManagerCols.Strategy].Value    = uiManager.ManagerFileRecord.Strategy;
                dgvManagersNew.Rows[i].Cells[(int)ManagerCols.SubStrategy].Value = uiManager.ManagerFileRecord.SubStrat;
                dgvManagersNew.Rows[i].Cells[(int)ManagerCols.MarketFocus].Value = uiManager.ManagerFileRecord.MktsFocus;

                // stats
                StatsRecord stats = null;
                if (uiManager.JLSStats != null)
                {
                    stats = uiManager.JLSStats;
                    dgvManagersNew.Rows[i].Cells[(int)ManagerCols.JS].Value = true;
                    dgvManagersNew.Rows[i].Cells[(int)ManagerCols.CL].Value = false;
                    dgvManagersNew.Rows[i].Cells[(int)ManagerCols.DB].Value = false;
                }
                else if (uiManager.CITIStats != null)
                {
                    stats = uiManager.CITIStats;
                    dgvManagersNew.Rows[i].Cells[(int)ManagerCols.JS].Value = false;
                    dgvManagersNew.Rows[i].Cells[(int)ManagerCols.CL].Value = true;
                    dgvManagersNew.Rows[i].Cells[(int)ManagerCols.DB].Value = false;
                }
                else if (uiManager.DBStats != null)
                {
                    stats = uiManager.DBStats;
                    dgvManagersNew.Rows[i].Cells[(int)ManagerCols.JS].Value = false;
                    dgvManagersNew.Rows[i].Cells[(int)ManagerCols.CL].Value = false;
                    dgvManagersNew.Rows[i].Cells[(int)ManagerCols.DB].Value = true;
                }
                //
                if (stats != null)
                {
                    dgvManagersNew.Rows[i].Cells[(int)ManagerCols.Volatility].Value     = stats.Volatility;
                    dgvManagersNew.Rows[i].Cells[(int)ManagerCols.Sortino].Value        = stats.Sortino;
                    dgvManagersNew.Rows[i].Cells[(int)ManagerCols.CTACorrelation].Value = stats.CTACorrelation;
                    dgvManagersNew.Rows[i].Cells[(int)ManagerCols.VIXCorrelation].Value = stats.VIXCorrelation;
                    dgvManagersNew.Rows[i].Cells[(int)ManagerCols.StartDate].Value      = stats.StartDate;
                    dgvManagersNew.Rows[i].Cells[(int)ManagerCols.EndDate].Value        = stats.EndDate;
                }
            }

            // manager filter list
            // supports filtering of managers
            // and needs to be updated anytime
            // managers change
            //CreateManagerFilterList();

            //SetManagersGridColors();
        }