예제 #1
0
파일: OptionBoard.cs 프로젝트: phs008/ebest
        private void ReceveData(XAQueryClass myXAQueryClass)
        {
            CallCodeList = new List <string>();
            PutCodeList  = new List <string>();

            for (int i = 0; i < dataGridView2.Rows.Count; i++)
            {
                CallCodeList.Add("");
                PutCodeList.Add("");
            }



            int cnt_t2301OutBlock1 = myXAQueryClass.GetBlockCount("t2301OutBlock1");

            for (int i = 0; i < cnt_t2301OutBlock1; i++)
            {
                for (int j = 0; j < dataGridView2.Rows.Count; j++)
                {
                    if (dataGridView2.Rows[j].Cells[0].Value.ToString() + "0" == myXAQueryClass.GetFieldData("t2301OutBlock1", "actprice", i))//행사가
                    {
                        CallCodeList[j] = myXAQueryClass.GetFieldData("t2301OutBlock1", "optcode", i);
                        foreach (DataColumn col in CallTable.Columns)
                        {
                            CallTable.Rows[j][col] = myXAQueryClass.GetFieldData("t2301OutBlock1", col.ColumnName, i);
                        }
                        CallTable.Rows[j]["change"] = 전일대비구분포함(myXAQueryClass.GetFieldData("t2301OutBlock1", "sign", i)) + CallTable.Rows[j]["change"].ToString();
                    }
                }
            }

            int cnt_t2301OutBlock2 = myXAQueryClass.GetBlockCount("t2301OutBlock2");

            for (int i = 0; i < cnt_t2301OutBlock2; i++)
            {
                for (int j = 0; j < dataGridView2.Rows.Count; j++)
                {
                    if (dataGridView2.Rows[j].Cells[0].Value.ToString() + "0" == myXAQueryClass.GetFieldData("t2301OutBlock2", "actprice", i))//행사가
                    {
                        PutCodeList[j] = myXAQueryClass.GetFieldData("t2301OutBlock2", "optcode", i);

                        foreach (DataColumn col in PutTable.Columns)
                        {
                            PutTable.Rows[j][col] = myXAQueryClass.GetFieldData("t2301OutBlock2", col.ColumnName, i);
                        }

                        PutTable.Rows[j]["change"] = 전일대비구분포함(myXAQueryClass.GetFieldData("t2301OutBlock2", "sign", i)) + PutTable.Rows[j]["change"].ToString();
                    }
                }
            }

            //real등록
            myOC0.CallBackMethod += ReceiveRealData_OC0;
            myOH0.CallBackMethod += ReceiveRealData_OH0;
            myOMG.CallBackMethod += ReceiveRealData_OMG;

            foreach (DataRow row in CallTable.Rows)
            {
                Dictionary <string, string> InputDataTable = new Dictionary <string, string>();
                InputDataTable.Add("optcode", row["optcode"].ToString());
                myOC0.AdviseExcute(InputDataTable);
                myOH0.AdviseExcute(InputDataTable);
                myOMG.AdviseExcute(InputDataTable);
            }

            foreach (DataRow row in PutTable.Rows)
            {
                Dictionary <string, string> InputDataTable = new Dictionary <string, string>();
                InputDataTable.Add("optcode", row["optcode"].ToString());
                myOC0.AdviseExcute(InputDataTable);
                myOH0.AdviseExcute(InputDataTable);
                myOMG.AdviseExcute(InputDataTable);
            }
        }
예제 #2
0
        private void ReceiveData_t2105(XAQueryClass myXAQueryClass)
        {
            if (myXAQueryClass.GetFieldData("t2105OutBlock", "shcode", 0) == strCode)
            {
                string[] Str = new string[] {
                    myXAQueryClass.GetFieldData("t2105OutBlock", "offerho1", 0),           //매도호가1
                    myXAQueryClass.GetFieldData("t2105OutBlock", "bidho1", 0),             //매수호가1
                    myXAQueryClass.GetFieldData("t2105OutBlock", "offerrem1", 0),          //매도호가수량1
                    myXAQueryClass.GetFieldData("t2105OutBlock", "bidrem1", 0),            //매수호가수량1
                    myXAQueryClass.GetFieldData("t2105OutBlock", "dcnt1", 0),              //매도호가건수1
                    myXAQueryClass.GetFieldData("t2105OutBlock", "scnt1", 0),              //매수호가건수1
                    myXAQueryClass.GetFieldData("t2105OutBlock", "offerho2", 0),           //매도호가2
                    myXAQueryClass.GetFieldData("t2105OutBlock", "bidho2", 0),             //매수호가2
                    myXAQueryClass.GetFieldData("t2105OutBlock", "offerrem2", 0),          //매도호가수량2
                    myXAQueryClass.GetFieldData("t2105OutBlock", "bidrem2", 0),            //매수호가수량2
                    myXAQueryClass.GetFieldData("t2105OutBlock", "dcnt2", 0),              //매도호가건수2
                    myXAQueryClass.GetFieldData("t2105OutBlock", "scnt2", 0),              //매수호가건수2
                    myXAQueryClass.GetFieldData("t2105OutBlock", "offerho3", 0),           //매도호가3
                    myXAQueryClass.GetFieldData("t2105OutBlock", "bidho3", 0),             //매수호가3
                    myXAQueryClass.GetFieldData("t2105OutBlock", "offerrem3", 0),          //매도호가수량3
                    myXAQueryClass.GetFieldData("t2105OutBlock", "bidrem3", 0),            //매수호가수량3
                    myXAQueryClass.GetFieldData("t2105OutBlock", "dcnt3", 0),              //매도호가건수3
                    myXAQueryClass.GetFieldData("t2105OutBlock", "scnt3", 0),              //매수호가건수3
                    myXAQueryClass.GetFieldData("t2105OutBlock", "offerho4", 0),           //매도호가4
                    myXAQueryClass.GetFieldData("t2105OutBlock", "bidho4", 0),             //매수호가4
                    myXAQueryClass.GetFieldData("t2105OutBlock", "offerrem4", 0),          //매도호가수량4
                    myXAQueryClass.GetFieldData("t2105OutBlock", "bidrem4", 0),            //매수호가수량4
                    myXAQueryClass.GetFieldData("t2105OutBlock", "dcnt4", 0),              //매도호가건수4
                    myXAQueryClass.GetFieldData("t2105OutBlock", "scnt4", 0),              //매수호가건수4
                    myXAQueryClass.GetFieldData("t2105OutBlock", "offerho5", 0),           //매도호가5
                    myXAQueryClass.GetFieldData("t2105OutBlock", "bidho5", 0),             //매수호가5
                    myXAQueryClass.GetFieldData("t2105OutBlock", "offerrem5", 0),          //매도호가수량5
                    myXAQueryClass.GetFieldData("t2105OutBlock", "bidrem5", 0),            //매수호가수량5
                    myXAQueryClass.GetFieldData("t2105OutBlock", "dcnt5", 0),              //매도호가건수5
                    myXAQueryClass.GetFieldData("t2105OutBlock", "scnt5", 0),              //매수호가건수5
                    myXAQueryClass.GetFieldData("t2105OutBlock", "dvol", 0),               //매도호가총수량
                    myXAQueryClass.GetFieldData("t2105OutBlock", "svol", 0),               //매수호가총수량
                    myXAQueryClass.GetFieldData("t2105OutBlock", "toffernum", 0),          //총매도호가건수
                    myXAQueryClass.GetFieldData("t2105OutBlock", "tbidnum", 0),            //총매수호가건수
                    myXAQueryClass.GetFieldData("t2105OutBlock", "time", 0)                //수신시간
                };
                DataUpdate(Str);

                currprice = double.Parse(myXAQueryClass.GetFieldData("t2105OutBlock", "price", 0));
                CurrPriceUpdate();

                if (strCode.Substring(0, 3) == "101")
                {
                    Real해제();

                    myFH0.CallBackMethod += ReceiveRealData_FH0;
                    myFC0.CallBackMethod += ReceiveRealData_FC0;

                    Dictionary <string, string> InputDataTable = new Dictionary <string, string>();
                    InputDataTable.Add("futcode", strCode);
                    myFH0.AdviseExcute(InputDataTable);
                    myFC0.AdviseExcute(InputDataTable);
                }
                else if (strCode.Substring(0, 3) == "201" || strCode.Substring(0, 3) == "301")
                {
                    Real해제();

                    myOH0.CallBackMethod += ReceiveRealData_OH0;
                    myOC0.CallBackMethod += ReceiveRealData_OC0;

                    Dictionary <string, string> InputDataTable = new Dictionary <string, string>();
                    InputDataTable.Add("optcode", strCode);
                    myOH0.AdviseExcute(InputDataTable);
                    myOC0.AdviseExcute(InputDataTable);
                }
            }
        }