Ejemplo n.º 1
0
        public void profile_load()
        {
            foreach (DataGridViewColumn dc in DGV.Columns)
            {
                this.DGV.Columns[dc.HeaderText.Replace(" ", "")].Visible = true;
            }
            try
            {
                if (!File.Exists(Application.StartupPath + Path.DirectorySeparatorChar + "Trade_Profiles" + Path.DirectorySeparatorChar + "new profile.xml"))
                {
                    return;
                }
                //   DGV.Columns["FullName"].Visible = true;
                DataSet ds1 = new DataSet();
                ds1.ReadXml(Application.StartupPath + Path.DirectorySeparatorChar + "Trade_Profiles" + Path.DirectorySeparatorChar + "new profile.xml");
                for (int i = 0; i < ds1.Tables[0].Rows.Count; i++)
                {
                    if (ds1.Tables[0].Rows[i]["Input"].ToString().Replace(" ", "") == "FullName")
                    {
                        continue;
                    }
                    DGV.Columns[ds1.Tables[0].Rows[i]["Input"].ToString().Replace(" ", "")].Visible = false;
                }


                DataGridViewColumnSelector cs = new DataGridViewColumnSelector(DGV);
                cs.MaxHeight = 200;
                cs.Width     = 150;
            }
            catch (Exception ex)
            {
                MessageBox.Show("Column Load Error" + ex.Message);
            }
        }
Ejemplo n.º 2
0
 private void DGV_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
 {
     if (e.Button == System.Windows.Forms.MouseButtons.Right)
     {
         if (e.RowIndex == -1)
         {
             DGV.ContextMenuStrip = null;
             cl = new DataGridViewColumnSelector(DGV);
         }
     }
 }
Ejemplo n.º 3
0
        private void Trade_Tracker_Load(object sender, EventArgs e)
        {
            //DataRow dr2 = Global.Instance.TradeTracker.NewRow();


            //dr2["PF_ID"] = "PF_ID";

            //dr2["B/S"] = "B/S";
            //dr2["QTY"] = "QTY";

            //dr2["ACTUALPRICE"] = Convert.ToString("ACTUALPRICE");

            //dr2["GIVENPRICEBUY"] = "GIVENPRICEBUY";
            //dr2["GIVENPRICESELL"] = "GIVENPRICESELL";

            //dr2["SYMBOL"] = "SYMBOL";
            //dr2["TIME"] = "TIME";
            //dr2["Unique_id"] = "Unique_id";
            //Global.Instance.TradeTracker.Rows.Add(dr2);
            //==========================


            //========================


            //   DGV.ScrollBars = ScrollBars.Vertical;


            //Global.Instance.TradeTracker.Clear();
            DataSet ds = new DataSet();

            if (File.Exists(Application.StartupPath + Path.DirectorySeparatorChar + System.DateTime.Now.Date.ToString("dddd, MMMM d, yyyy") + "tradetrack.xml"))
            {
                ds.ReadXml(Application.StartupPath + Path.DirectorySeparatorChar + System.DateTime.Now.Date.ToString("dddd, MMMM d, yyyy") + "tradetrack.xml");
                Global.Instance.TradeTracker = ds.Tables[0];
            }
            DataView dv = Global.Instance.TradeTracker.AsEnumerable().AsDataView();

            DGV.DataSource = dv;

            DataGridViewColumnSelector cs = new DataGridViewColumnSelector(DGV);

            cs.MaxHeight = 200;
            cs.Width     = 150;

            Type         controlType = DGV.GetType();
            PropertyInfo pi          = controlType.GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic);

            pi.SetValue(DGV, true, null);



            //Trade_Tracker.Instance.DGV.Refresh();
        }
Ejemplo n.º 4
0
        private void DGV_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            if (e.Button == System.Windows.Forms.MouseButtons.Right)
            {
                if (e.RowIndex == -1)
                {
                      DGV.ContextMenuStrip = null;
                      cl = new DataGridViewColumnSelector(DGV);
                }

            }
        }
        private void frmNetBook_Load(object sender, EventArgs e)
        {
            //if (Settings.Default.Window_LocationNBook != null)
            //{
            //    this.Location = Settings.Default.Window_LocationNBook;
            //}

            //// Set window size
            //if (Settings.Default.Window_SizeNBook != null)
            //{
            //    this.Size = Settings.Default.Window_SizeNBook;
            //}
            var AbbA = LoadFormLocationAndSize(this);

            this.Location = new Point(AbbA[0], AbbA[1]);
            this.Size     = new Size(AbbA[2], AbbA[3]);

            this.FormClosing += new FormClosingEventHandler(SaveFormLocationAndSize);
            DataTable netbooks            = new DataTable();
            DataGridViewColumnSelector cs = new DataGridViewColumnSelector(DGV);

            cs.MaxHeight   = 200;
            cs.Width       = 150;
            DGV.DataSource = Global.Instance.NetBookTable;

            netposion(1, 1, 1, 1, 1);
            this.DGV.Columns["SellAvg"].DefaultCellStyle.Format = "0.##";
            this.DGV.Columns["NetQty"].DefaultCellStyle.Format  = "0.##";
            // this.DGV.Columns["SellQty"].DefaultCellStyle.Format = "0.0##";
            this.DGV.Columns["BuyAvg"].DefaultCellStyle.Format   = "0.##";
            this.DGV.Columns["NetValue"].DefaultCellStyle.Format = "0.##";
            // this.DGV.Columns["BEP"].DefaultCellStyle.Format = "0.##";


            //DataGridViewColumnSelector cs = new DataGridViewColumnSelector(DGV);
            //cs.MaxHeight = 200;
            //cs.Width = 150;

            Type         controlType = DGV.GetType();
            PropertyInfo pi          = controlType.GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic);

            pi.SetValue(DGV, true, null);
        }
Ejemplo n.º 6
0
        public void profile_load()
        {
            foreach (DataGridViewColumn dc in DGV.Columns)
            {
                this.DGV.Columns[dc.HeaderText.Replace(" ", "")].Visible = true;
            }
               try
            {
                if (!File.Exists(Application.StartupPath + Path.DirectorySeparatorChar + "Trade_Profiles" + Path.DirectorySeparatorChar + "TradeDefault.xml"))
                    return;
             //   DGV.Columns["FullName"].Visible = true;
                DataSet ds1 = new DataSet();
                ds1.ReadXml(Application.StartupPath + Path.DirectorySeparatorChar + "Trade_Profiles" + Path.DirectorySeparatorChar + "TradeDefault.xml");
                for (int i = 0; i < ds1.Tables[0].Rows.Count; i++)
                {
                    if (ds1.Tables[0].Rows[i]["Input"].ToString().Replace(" ", "") == "FullName")
                    { continue; }
                    DGV.Columns[ds1.Tables[0].Rows[i]["Input"].ToString().Replace(" ", "")].Visible = false;
                }

                DataGridViewColumnSelector cs = new DataGridViewColumnSelector(DGV);
                cs.MaxHeight = 200;
                cs.Width = 150;
            }
            catch (Exception ex)
            {
                MessageBox.Show("Column Load Error"+ex.Message );
            }
        }
Ejemplo n.º 7
0
        private void Fo_Fo_mktwatch_Load(object sender, EventArgs e)
        {
            Global.Instance.Best_Bid = true;
            Global.Instance.WTC_cnt = 0;
            var AbbA = LoadFormLocationAndSize(this);
            this.Location = new Point(AbbA[0], AbbA[1]);
            this.Size = new Size(AbbA[2], AbbA[3]);

            this.FormClosing += new FormClosingEventHandler(SaveFormLocationAndSize);
            DataGridViewColumnSelector cs = new DataGridViewColumnSelector(DGV1);
            cs.MaxHeight = 200;
            cs.Width = 150;
            Insert_txt.Visible = false;
            _makeItRed = new DataGridViewCellStyle();
            _makeItBlue = new DataGridViewCellStyle();
            _makeItBlack = new DataGridViewCellStyle();

            _makeItRed.BackColor = Color.Red;

            _makeItBlue.BackColor = Color.Blue;
            _makeItBlack.BackColor = Color.Black;
              SpreadTable = new DataTable("SPREADFO");

            SpreadTable.Columns.Add("PF", typeof(String));
            SpreadTable.Columns.Add("Token1", typeof(Int32));
            SpreadTable.Columns.Add("Token2", typeof(Int32));
            SpreadTable.Columns.Add("NEAR", typeof(String));
            SpreadTable.Columns.Add("FAR", typeof(String));
            SpreadTable.Columns.Add("NBID", typeof(Double));
            SpreadTable.Columns.Add("NASK", typeof(Double));
            SpreadTable.Columns.Add("NLTP", typeof(Double));
            SpreadTable.Columns.Add("FBID", typeof(Double));
            SpreadTable.Columns.Add("FASK", typeof(Double));
            SpreadTable.Columns.Add("FLTP", typeof(Double));

            SpreadTable.Columns.Add("BEQ", typeof(Double));
            SpreadTable.Columns.Add("SEQ", typeof(Double));
            SpreadTable.Columns.Add("V1", typeof(Double));
            SpreadTable.Columns.Add("V2", typeof(Double));

            SpreadTable.Columns.Add("S1", typeof(Double));
            SpreadTable.Columns.Add("S2", typeof(Double));

            SpreadTable.Columns.Add("TOK1_QTY", typeof(int));
            SpreadTable.Columns.Add("TOK2_QTY", typeof(int));
              //  SpreadTable.Columns.Add("SEQ", typeof(Double));

            SpreadTable.Columns.Add("NBD", typeof(Double), "FASK-NASK");
            SpreadTable.Columns.Add("NHD", typeof(Double), "FBID -NASK");
            SpreadTable.Columns.Add("FBD", typeof(Double), "FBID-NBID");
            SpreadTable.Columns.Add("FHD", typeof(Double), "FASK-NBID");

            DGV1.DataSource = SpreadTable;

            DGV1.Columns["Token1"].Visible = false;

            DGV1.Columns["Token2"].Visible = false;

            DGV1.Columns["FAR"].SortMode = DataGridViewColumnSortMode.NotSortable;
            DGV1.Columns["NEAR"].SortMode = DataGridViewColumnSortMode.NotSortable;
            DGV1.Columns["NBID"].SortMode = DataGridViewColumnSortMode.NotSortable;
            DGV1.Columns["NBID"].SortMode = DataGridViewColumnSortMode.NotSortable;

            DGV1.Columns["PF"].SortMode = DataGridViewColumnSortMode.NotSortable;
            DGV1.Columns["FLTP"].SortMode = DataGridViewColumnSortMode.NotSortable;
            DGV1.Columns["NBD"].SortMode = DataGridViewColumnSortMode.NotSortable;
            DGV1.Columns["FBD"].SortMode = DataGridViewColumnSortMode.NotSortable;

            DGV1.Columns["NHD"].SortMode = DataGridViewColumnSortMode.NotSortable;
            DGV1.Columns["FHD"].SortMode = DataGridViewColumnSortMode.NotSortable;

            DGV1.Columns["Token1"].SortMode = DataGridViewColumnSortMode.NotSortable;
            DGV1.Columns["Token2"].SortMode = DataGridViewColumnSortMode.NotSortable;

            DGV1.Columns["NASK"].SortMode = DataGridViewColumnSortMode.NotSortable;
            DGV1.Columns["NLTP"].SortMode = DataGridViewColumnSortMode.NotSortable;
            DGV1.Columns["FBID"].SortMode = DataGridViewColumnSortMode.NotSortable;
            DGV1.Columns["FASK"].SortMode = DataGridViewColumnSortMode.NotSortable;
            DGV1.Columns["BEQ"].SortMode = DataGridViewColumnSortMode.NotSortable;
            DGV1.Columns["SEQ"].SortMode = DataGridViewColumnSortMode.NotSortable;

            SetDisplayRules(this.DGV1.Columns["Token1"], "Token1");
            SetDisplayRules(this.DGV1.Columns["Token2"], "Token2");

            SetDisplayRules(this.DGV1.Columns["BEQ"], "BEQ");
            SetDisplayRules(this.DGV1.Columns["SEQ"], "SEQ");
            SetDisplayRules(this.DGV1.Columns["V1"], "V1");
            SetDisplayRules(this.DGV1.Columns["V2"], "V2");
            SetDisplayRules(this.DGV1.Columns["S1"], "S1");
            SetDisplayRules(this.DGV1.Columns["S2"], "S2");
            SetDisplayRules(this.DGV1.Columns["TOK1_QTY"], "TOK1_QTY");
            SetDisplayRules(this.DGV1.Columns["TOK2_QTY"], "TOK2_QTY");

            SetDisplayRules(this.DGV1.Columns["PF"], "PF");

            SetDisplayRules(this.DGV1.Columns["NEAR"], "NEAR");

            SetDisplayRules(this.DGV1.Columns["FAR"], "FAR");

            SetDisplayRules(this.DGV1.Columns["NBID"], "NBID");
            SetDisplayRules(this.DGV1.Columns["NASK"], "NASK");

            SetDisplayRules(this.DGV1.Columns["NLTP"], "NLTP");
            SetDisplayRules(this.DGV1.Columns["FBID"], "FBID");

            SetDisplayRules(this.DGV1.Columns["FASK"], "FASK");   // Token2Ask
            SetDisplayRules(this.DGV1.Columns["FLTP"], "FLTP");   // Token2Ltp

            SetDisplayRules(this.DGV1.Columns["NBD"], "NBD");   //NearBidDiff
            SetDisplayRules(this.DGV1.Columns["NHD"], "NHD");   // NearHitDiff

            SetDisplayRules(this.DGV1.Columns["FBD"], "FBD");   // FarBidDiff
            SetDisplayRules(this.DGV1.Columns["FHD"], "FHD");   //FarHitDiff

            this.DGV1.Columns["NBD"].DefaultCellStyle.Format = "0.0000##";
            this.DGV1.Columns["NHD"].DefaultCellStyle.Format = "0.0000##";
            this.DGV1.Columns["FBD"].DefaultCellStyle.Format = "0.0000##";
            this.DGV1.Columns["FHD"].DefaultCellStyle.Format = "0.0000##";

            /////////////////////////////////////////////////////////////////////////////////////////////////////
            this.DGV1.Columns.Add(new DataGridViewTextBoxColumn()
            {
                Name = "BNSFDIFF",
                HeaderText = "BNSFDIFF",

            });
            this.DGV1.Columns.Add(new DataGridViewTextBoxColumn()
            {
                Name = "BFSNDIFF",
                HeaderText = "BFSNDIFF",

            });

            this.DGV1.Columns.Add(new DataGridViewTextBoxColumn()
            {
                Name = "BNSFMNQ",
                HeaderText = "BNSFMNQ",
            });
            this.DGV1.Columns.Add(new DataGridViewTextBoxColumn()
            {
                Name = "BFSNMNQ",
                HeaderText = "BFSNMNQ",
            });
            this.DGV1.Columns.Add(new DataGridViewTextBoxColumn()
            {
                Name = "BNSFMXQ",
                HeaderText = "BNSFMXQ",
            });
            this.DGV1.Columns.Add(new DataGridViewTextBoxColumn()
            {
                Name = "BFSNMXQ",
                HeaderText = "BFSNMXQ",
            });

            this.DGV1.Columns.Add(new DataGridViewTextBoxColumn()
            {
                Name = "TICKS",
                HeaderText = "TICKS",
            });
              //////////////////////////////////////////////////////////////////////////////////////////////////////
               this.DGV1.Columns.Add(new DataGridViewButtonColumn()
            {
                Name = "Apply",
                HeaderText = "Apply",
                Text = "Apply",
                UseColumnTextForButtonValue = true
            });

            this.DGV1.Columns.Add(new DataGridViewTextBoxColumn()
            {
                Name = "BNSFTQ",
                HeaderText = "BNSFTQ",
                ReadOnly = true
            });

            this.DGV1.Columns.Add(new DataGridViewTextBoxColumn()
            {
                Name = "BNSFTD",
                HeaderText = "BNSFTD",
                ReadOnly = true
            });

            this.DGV1.Columns.Add(new DataGridViewTextBoxColumn()
            {
                Name = "BFSNTQ",
                HeaderText = "BFSNTQ",
                ReadOnly = true
            });
            this.DGV1.Columns.Add(new DataGridViewTextBoxColumn()
            {
                Name = "BFSNTD",
                HeaderText = "BFSNTD",
                ReadOnly = true
            });

            this.DGV1.Columns.Add(new DataGridViewTextBoxColumn()
            {
                Name = "Buy_Avg",
                HeaderText = "Buy_Avg",
                ReadOnly = true
            });
            this.DGV1.Columns.Add(new DataGridViewTextBoxColumn()
            {
                Name = "Sell_Avg",
                HeaderText = "Sell_Avg",
                ReadOnly = true
            });

            this.DGV1.Columns.Add(new DataGridViewTextBoxColumn()
            {
                Name = "WTC",
                HeaderText = "WTC",

            });
            this.DGV1.Columns.Add(new DataGridViewTextBoxColumn()
            {
                Name = "_con_WTC",
                HeaderText = "_con_WTC",

            });

            this.DGV1.Columns.Add(new DataGridViewTextBoxColumn()
            {
                Name = "_sell_WTC",
                HeaderText = "_sell_WTC",

            });

            this.DGV1.Columns.Add(new DataGridViewTextBoxColumn()
            {
                Name = "_sell_con_WTC",
                HeaderText = "_sell_con_WTC",

            });
            DGV1.Columns["WTC"].DefaultCellStyle.NullValue = 0;
            DGV1.Columns["_con_WTC"].DefaultCellStyle.NullValue = 0;
            DGV1.Columns["_sell_WTC"].DefaultCellStyle.NullValue = 0;
            DGV1.Columns["_sell_con_WTC"].DefaultCellStyle.NullValue = 0;

            DGV1.Columns["WTC"].ReadOnly = true;
            DGV1.Columns["_con_WTC"].ReadOnly = true;
            DGV1.Columns["_sell_WTC"].ReadOnly = true;
            DGV1.Columns["_sell_con_WTC"].ReadOnly = true;

            DGV1.Columns["BNSFDIFF"].DefaultCellStyle.NullValue = 0.00;
            DGV1.Columns["BFSNDIFF"].DefaultCellStyle.NullValue = 0.00;
            DGV1.Columns["BNSFMNQ"].DefaultCellStyle.NullValue = 0.00;
            DGV1.Columns["BFSNMNQ"].DefaultCellStyle.NullValue = 0.00;
            DGV1.Columns["BNSFMXQ"].DefaultCellStyle.NullValue = 0.00;
            DGV1.Columns["BFSNMXQ"].DefaultCellStyle.NullValue = 0.000;
            DGV1.Columns["TICKS"].DefaultCellStyle.NullValue = 0;

            this.DGV1.Columns["BNSFTD"].DefaultCellStyle.Format = "0.##";
            this.DGV1.Columns["BFSNTD"].DefaultCellStyle.Format = "0.##";

            this.DGV1.Columns["Buy_Avg"].DefaultCellStyle.Format = "0.##";
            this.DGV1.Columns["Sell_Avg"].DefaultCellStyle.Format = "0.##";

            _makeItRed = new DataGridViewCellStyle();
            _makeItBlue = new DataGridViewCellStyle();
            _makeItBlack = new DataGridViewCellStyle();
            _makeItRed.BackColor = Color.Red;
            _makeItBlue.BackColor = Color.Blue;
            _makeItBlack.BackColor = Color.Black;
            SpreadTable.TableNewRow += new DataTableNewRowEventHandler(SpreadTable_NewRow);
             //   NNFHandler.eOrderTRADE_ERROR += Fillqty_ingrd;

            btnStopAll.Enabled = true;
            btnStartAll.Enabled = true;
            DGV1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
            Type controlType = DGV1.GetType();
            PropertyInfo pi = controlType.GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic);
            pi.SetValue(DGV1, true, null);
            try
            {
                foreach (DataGridViewColumn dc in DGV1.Columns)
                {

                    this.DGV1.Columns[dc.HeaderText.Replace(" ", "")].Visible = true;
                }

                DataSet ds = new DataSet();
                //config.SetValue("Fo_FO_Profile", Convert.ToString(0), GetProfileName);
                var config = new Config { GroupName = null };
                var iforms = config.GetValue("Fo_FO_Profile", Convert.ToString(0));
                if (File.Exists(Application.StartupPath + Path.DirectorySeparatorChar + "Profiles" + Path.DirectorySeparatorChar + iforms+".xml"))
                {
                    ds.ReadXml(Application.StartupPath + Path.DirectorySeparatorChar + "Profiles" + Path.DirectorySeparatorChar + iforms + ".xml");
                    for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                    {
                        string st = ds.Tables[0].Rows[i]["Input"].ToString();
                        this.DGV1.Columns[ds.Tables[0].Rows[i]["Input"].ToString().Replace(" ", "")].Visible = false;
                    }
                }

            }
            catch
            {
                MessageBox.Show("Defauft Profile Not Create" , "Error");
            }
            Task.Factory.StartNew(() =>
            {

                //Thread.Sleep(100);

                if (this.InvokeRequired)
                {
                    this.BeginInvoke((ThreadStart)delegate() { defaultLoadfun(); });

                    return;
                }
                else
                {
                    this.BeginInvoke((ThreadStart)delegate() { defaultLoadfun(); });
                }

            });
        }
Ejemplo n.º 8
0
        private void frmMktWatch_Load(object sender, EventArgs e)
        {
            var AbbA = LoadFormLocationAndSize(this);
                this.Location = new Point(AbbA[0], AbbA[1]);
                this.Size = new Size(AbbA[2], AbbA[3]);

                this.FormClosing += new FormClosingEventHandler(SaveFormLocationAndSize);
                //   this.WindowState = FormWindowState.Normal;
                DataGridViewColumnSelector cs = new DataGridViewColumnSelector(DGV);
                cs.MaxHeight = 200;
                cs.Width = 150;
                ReadyDatatable();
                Exchange();
                frmmktdefaultfun();
               // Global.Instance.pData.OnDataChange += PDataOnOnDataChange;
                LZO_NanoData.LzoNanoData.Instance.OnDataChange += PDataOnOnDataChange;
        }
 private void DGV_MouseClick(object sender, MouseEventArgs e)
 {
     DGV.ContextMenuStrip = null;
      cl = null;
 }
Ejemplo n.º 10
0
        private void frmGenOrderBook_Load(object sender, EventArgs e)
        {
            try
            {

                //if (Settings.Default.Window_LocationOBook != null)
                //{
                //    this.Location = Settings.Default.Window_LocationOBook;
                //}

                //// Set window size
                //if (Settings.Default.Window_SizeOBook != null)
                //{
                //    this.Size = Settings.Default.Window_SizeOBook;
                //}
                var AbbA = LoadFormLocationAndSize(this);
                this.Location = new Point(AbbA[0], AbbA[1]);
                this.Size = new Size(AbbA[2], AbbA[3]);

                this.FormClosing += new FormClosingEventHandler(SaveFormLocationAndSize);
                DataView dv1 = Global.Instance.OrdetTable.AsEnumerable().Where(a => a.Field<string>("Status") == orderStatus.Open.ToString() || a.Field<string>("Status") == orderStatus.Modified.ToString()).AsDataView();
                DGV.DataSource = dv1;

                DataView dv2 = Global.Instance.OrdetTable.AsEnumerable().Where(a => a.Field<string>("Status") == orderStatus.Traded.ToString() || a.Field<string>("Status") == orderStatus.Cancel.ToString() || a.Field<string>("Status") == orderStatus.Rejected.ToString()).AsDataView();
                DGV2.DataSource = dv2;
                dv2.Sort = "LOGTIME DESC";

                DataGridViewColumnSelector cs = new DataGridViewColumnSelector(DGV);
                cs.MaxHeight = 200;
                cs.Width = 150;

                // new DgvFilterManager(DGV);

                profile_load();

                Type controlType = DGV.GetType();
                PropertyInfo pi = controlType.GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic);
                pi.SetValue(DGV, true, null);

                controlType = DGV2.GetType();
                pi = controlType.GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic);
                pi.SetValue(DGV2, true, null);

                DataSet ds = new DataSet();
               // string con = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + Application.StartupPath + Path.DirectorySeparatorChar + System.DateTime.Now.Date.ToString("dddd, MMMM d, yyyy") + " Default.xlsx" + ";Extended Properties=Excel 12.0;";
                /*string con = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + Application.StartupPath + Path.DirectorySeparatorChar + "31march.xlsx" + ";Extended Properties=Excel 12.0;";

                using (OleDbConnection connection = new OleDbConnection(con))
                {
                    connection.Open();
                    OleDbCommand command = new OleDbCommand("select * from [Sheet1$]", connection);
                    DataTable Sheets = connection.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null);
                    foreach (DataRow dr in Sheets.Rows)
                    {
                        string sht = dr[2].ToString().Replace("'", "");
                        OleDbDataAdapter dataAdapter = new OleDbDataAdapter("select * from [" + sht + "] where status = 'Traded'", connection);
                        dataAdapter.Fill(Global.Instance.OrdetTable);
                        break;
                    }
                    connection.Close();
                }*/
                //Task.Factory.StartNew(() => T());

            }
            catch(Exception Ex)
            {
              //  Console.WriteLine(Ex.StackTrace.ToString());
            }
        }
        private void Trade_Tracker_Load(object sender, EventArgs e)
        {
            //DataRow dr2 = Global.Instance.TradeTracker.NewRow();

            //dr2["PF_ID"] = "PF_ID";

            //dr2["B/S"] = "B/S";
            //dr2["QTY"] = "QTY";

            //dr2["ACTUALPRICE"] = Convert.ToString("ACTUALPRICE");

            //dr2["GIVENPRICEBUY"] = "GIVENPRICEBUY";
            //dr2["GIVENPRICESELL"] = "GIVENPRICESELL";

            //dr2["SYMBOL"] = "SYMBOL";
            //dr2["TIME"] = "TIME";
            //dr2["Unique_id"] = "Unique_id";
            //Global.Instance.TradeTracker.Rows.Add(dr2);
            //==========================

            //========================

             //   DGV.ScrollBars = ScrollBars.Vertical;

            //Global.Instance.TradeTracker.Clear();
            DataSet ds = new DataSet();
            if (File.Exists(Application.StartupPath + Path.DirectorySeparatorChar + System.DateTime.Now.Date.ToString("dddd, MMMM d, yyyy") + "tradetrack.xml"))
            {
                ds.ReadXml(Application.StartupPath + Path.DirectorySeparatorChar + System.DateTime.Now.Date.ToString("dddd, MMMM d, yyyy") + "tradetrack.xml");
                Global.Instance.TradeTracker = ds.Tables[0];
            }
            DataView dv = Global.Instance.TradeTracker.AsEnumerable().AsDataView();
            DGV.DataSource = dv;

            DataGridViewColumnSelector cs = new DataGridViewColumnSelector(DGV);
            cs.MaxHeight = 200;
            cs.Width = 150;

            Type controlType = DGV.GetType();
            PropertyInfo pi = controlType.GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic);
            pi.SetValue(DGV, true, null);

                //Trade_Tracker.Instance.DGV.Refresh();
        }