예제 #1
0
        private void BuyOrder(DataGridViewRow Dr)
        {
            using (var frmord = new FrmOrderEntry())
            {
                frmord.lblOrderMsg.Text = "Buy " + Dr.Cells["Symbol"].Value + "(" + Dr.Cells["UniqueIdentifier"].Value +
                                          ")  ";
                frmord.lblOrderMsg.BackColor = Color.Blue;
                frmord.LEG_PRICE = Convert.ToDouble(Dr.Cells["Bid"].Value);
                frmord.LEG_SIZE = 1; //Convert.ToInt32(Dr.Cells["BidQ"].Value);
                // frmord.DesktopLocation = new Point(100, 100);
                int x = (Screen.PrimaryScreen.WorkingArea.Width - frmord.Width) / 2;
                int y = (Screen.PrimaryScreen.WorkingArea.Height - frmord.Height) - 50;
                frmord.Location = new Point(x, y);

                var v = Convert.ToInt32(Dr.Cells["ExpiryDate"].Value);
                if (frmord.ShowDialog(this) == DialogResult.OK)
                {
                    if (frmord.FormDialogResult == (int)OrderEntryButtonCase.SUBMIT)
                    {

                        NNFInOut.Instance.BOARD_LOT_IN_TR(Convert.ToInt32(Dr.Cells["UniqueIdentifier"].Value),
                              Dr.Cells["InstrumentName"].Value.ToString(),
                             Dr.Cells["Symbol"].Value.ToString(),
                             Convert.ToInt32(Dr.Cells["ExpiryDate"].Value),
                              Convert.ToInt32(Dr.Cells["StrikePrice"].Value),
                              Dr.Cells["OptionType"].Value.ToString(),
                              1,
                              frmord.LEG_SIZE * Convert.ToInt32(Dr.Cells["Lotsize"].Value),
                                Convert.ToInt32(frmord.LEG_PRICE * 100)
                                                        );

                    }
                }
            }
        }
예제 #2
0
        private void ModifyOrder(DataGridViewRow Dr)
        {
            using (var frmord = new FrmOrderEntry())
            {
               // int lotSize = CSV_Class.cimlist.Where(q => q.Token == Convert.ToInt32(Dr.Cells["TokenNo"])).Select(a => a.BoardLotQuantity).First();

                frmord.lblOrderMsg.Text = "Modify " + Dr.Cells["Symbol"].Value + " " + Dr.Cells["Buy_SellIndicator"].Value.ToString() + "(" + Dr.Cells["OrderNumber"].Value + ")  ";
                frmord.lblOrderMsg.BackColor = Dr.Cells["Buy_SellIndicator"].Value.ToString() == "BUY" ? Color.Blue : Color.Red;
                frmord.LEG_PRICE = Convert.ToDouble(Dr.Cells["Price"].Value);
                frmord.LEG_SIZE = Convert.ToInt32(Dr.Cells["Volume"].Value);
                int x = (Screen.PrimaryScreen.WorkingArea.Width - frmord.Width) / 2;
                int y = (Screen.PrimaryScreen.WorkingArea.Height - frmord.Height) - 50;
                frmord.Location = new Point(x, y);

                if (frmord.ShowDialog(this) == DialogResult.OK)
                {
                    if (frmord.FormDialogResult == (int)OrderEntryButtonCase.SUBMIT)
                    {

                        NNFInOut.Instance.ORDER_MOD_IN_TR( Convert.ToInt64(Dr.Cells["OrderNumber"].Value),
                             frmord.LEG_SIZE*CSV_Class.cimlist.Where(q => q.Token == Convert.ToInt32(Dr.Cells["TokenNo"].Value)).Select(a => a.BoardLotQuantity).First() ,
                               Convert.ToInt32(frmord.LEG_PRICE*100));
                    }
                    }
                }
        }