void t0441_ReceiveData(string szTrCode) { int cnt = t0441.GetBlockCount("t0441OutBlock1"); for (int i = 0; i < cnt; i++) { DataRow newrow = table_잔고현황.NewRow(); newrow["종목코드"] = t0441.GetFieldData("t0441OutBlock1", "expcode", i); newrow["종목명"] = 종목명불러오기(t0441.GetFieldData("t0441OutBlock1", "expcode", i)); newrow["매매구분"] = t0441.GetFieldData("t0441OutBlock1", "medosu", i); newrow["잔고수량"] = t0441.GetFieldData("t0441OutBlock1", "jqty", i); newrow["청산가능수량"] = t0441.GetFieldData("t0441OutBlock1", "cqty", i); newrow["평균진입단가"] = t0441.GetFieldData("t0441OutBlock1", "pamt", i); newrow["현재가"] = t0441.GetFieldData("t0441OutBlock1", "price", i); newrow["평가손익"] = t0441.GetFieldData("t0441OutBlock1", "dtsunik1", i); table_잔고현황.Rows.Add(newrow); 현재가요청(newrow["종목코드"].ToString()); } if (t0441.IsNext) { 연속키_t0441_cts_expcode = t0441.GetFieldData("t0441OutBlock", "cts_expcode", 0); 연속키_t0441_cts_medocd = t0441.GetFieldData("t0441OutBlock", "cts_medocd", 0); myTimer_t0441.Interval = 1000; myTimer_t0441.Start(); } else { myTimer_t0441.Stop(); } }
void t0434_ReceiveData(string szTrCode) { int cnt = t0434.GetBlockCount("t0434OutBlock1"); for (int i = 0; i < cnt; i++) { DataRow newrow_체결 = table_체결현황.NewRow(); DataRow newrow_미체결 = table_미체결현황.NewRow(); string 주문번호 = int.Parse(t0434.GetFieldData("t0434OutBlock1", "ordno", i)).ToString(); string 매도매수 = t0434.GetFieldData("t0434OutBlock1", "medosu", i); string 주문수량 = t0434.GetFieldData("t0434OutBlock1", "qty", i); string 주문가격 = t0434.GetFieldData("t0434OutBlock1", "price", i); string 체결수량 = t0434.GetFieldData("t0434OutBlock1", "cheqty", i); string 체결가격 = t0434.GetFieldData("t0434OutBlock1", "cheprice", i); string 미체결수량 = t0434.GetFieldData("t0434OutBlock1", "ordrem", i); string 종목코드 = t0434.GetFieldData("t0434OutBlock1", "expcode", i); string 종목명 = 종목명불러오기(t0434.GetFieldData("t0434OutBlock1", "expcode", i)); if (int.Parse(체결수량) > 0) { newrow_체결["주문번호"] = 주문번호; newrow_체결["종목코드"] = 종목코드; newrow_체결["종목명"] = 종목명; newrow_체결["매매구분"] = 매도매수; newrow_체결["주문가격"] = 주문가격; newrow_체결["주문수량"] = 주문수량; newrow_체결["체결가격"] = 체결가격; newrow_체결["체결수량"] = 체결수량; table_체결현황.Rows.Add(newrow_체결); } if (int.Parse(미체결수량) > 0) { newrow_미체결["주문번호"] = 주문번호; newrow_미체결["종목코드"] = 종목코드; newrow_미체결["종목명"] = 종목명; newrow_미체결["매매구분"] = 매도매수; newrow_미체결["주문가격"] = 주문가격; newrow_미체결["주문수량"] = 주문수량; newrow_미체결["미체결수량"] = 미체결수량; table_미체결현황.Rows.Add(newrow_미체결); } } if (t0434.IsNext) { 연속키_t0434_cts_ordno = t0434.GetFieldData("t0434OutBlock", "cts_ordno", 0); myTimer_t0434.Interval = 1000; myTimer_t0434.Start(); } else { myTimer_t0434.Stop(); } }
private void ReceveData(XAQueryClass myXAQueryClass) { foreach (DataGridViewRow row in dataGridView1.Rows) { if (row.Cells["AccNUm"].Value.ToString() == myXAQueryClass.GetFieldData("CACBQ21900OutBlock1", "AcntNo", 0).Trim()) { row.Cells["AccName"].Value = myXAQueryClass.GetFieldData("CACBQ21900OutBlock2", "AcntNm", 0).Trim(); //계좌명 row.Cells["Item"].Value = myXAQueryClass.GetFieldData("CACBQ21900OutBlock2", "PrdtDtlNm", 0).Trim(); //상품상세명 } } }
void myXAQueryClass_t2101_ReceiveData(string szTrCode) { string 단축코드 = myXAQueryClass_t2101.GetFieldData("t2101InBlock", "focode", 0); string 행사가 = myXAQueryClass_t2101.GetFieldData("t2101OutBlock", "actprice", 0); string 상한가 = myXAQueryClass_t2101.GetFieldData("t2101OutBlock", "uplmtprice", 0); //상한가 string 하한가 = myXAQueryClass_t2101.GetFieldData("t2101OutBlock", "dnlmtprice", 0); //하한가 if (Form1.Master선옵종목.ContainsKey(단축코드) && Form1.Master선옵종목[단축코드].Count == 3) { Form1.Master선옵종목[단축코드].Add(상한가); Form1.Master선옵종목[단축코드].Add(하한가); Form1.Master선옵종목[단축코드].Add(행사가); //Console.WriteLine(단축코드 + "\t" + 상한가 + "\t" + 하한가 + "\t" + 행사가); } }
void myXAQueryClass_ReceiveData(string szTrCode) { string 계좌번호 = myXAQueryClass.GetFieldData("CACBQ21900OutBlock1", "AcntNo", 0); string 계좌명 = myXAQueryClass.GetFieldData("CACBQ21900OutBlock2", "AcntNm", 0); string 상품 = myXAQueryClass.GetFieldData("CACBQ21900OutBlock2", "PrdtDtlNm", 0); foreach (DataGridViewRow row in dataGridView1.Rows) { if (row.Cells["계좌번호"].Value.ToString() == 계좌번호) { row.Cells["계좌명"].Value = 계좌명; row.Cells["상품"].Value = 상품; break; } } }
private void Query_ReceiveData(string szTrCode) { if (szTrCode.Length > 0) { if (szTrCode == "CSPAT00600") { // 거래관련 정보인 경우 여기에서 거래처리 string orderNo = query.GetFieldData("CSPAT00600OutBlock2", "OrdNo", 0); database.StringSet("TRDataState", szTrCode); // 거래항목 database.StringSet("RecentOrderNo", orderNo); // 주문번호 셋업 LogBox.Items.Add("Data In: " + szTrCode); } else { // 그 외는 여기에서 처리 database.StringSet("TRDataState", szTrCode); LogBox.Items.Add("Data In: " + szTrCode); } } else { LogBox.Items.Add("데이터 전송 에러!"); LogBox.Items.Add("TR 데이터 코드: " + szTrCode); database.StringSet("TRDataState", "ERR"); } }
void myXAQueryClass_t1101_ReceiveData(string szTrCode) { string _code = myXAQueryClass_t1101.GetFieldData("t1101OutBlock", "shcode", 0); string 상한가 = myXAQueryClass_t1101.GetFieldData("t1101OutBlock", "uplmtprice", 0); string 하한가 = myXAQueryClass_t1101.GetFieldData("t1101OutBlock", "dnlmtprice", 0); if (Form1.Master주식종목[_code].Count == 3) { Form1.Master주식종목[_code].Add(상한가); Form1.Master주식종목[_code].Add(하한가); } if (_code == 마지막code) { myTimer = null; myTimer_1 = null; } }
private void ReceveData(XAQueryClass myXAQueryClass) { string[] names = Enum.GetNames(typeof(ColumnName)); int cnt_t0441OutBlock1 = myXAQueryClass.GetBlockCount("t0441OutBlock1"); for (int i = 0; i < cnt_t0441OutBlock1; i++) { DataRow newrow = table.NewRow(); foreach (string colname in names) { newrow[colname] = myXAQueryClass.GetFieldData("t0441OutBlock1", colname, i); } table.Rows.Add(newrow); } 매매손익 = double.Parse(myXAQueryClass.GetFieldData("t0441OutBlock", "tdtsunik", 0)); 총손익계산(); 현재가Real요청(); }
void myXAQueryClass_t9944_ReceiveData(string szTrCode) { int cnt_t9944OutBlock = myXAQueryClass_t9944.GetBlockCount("t9944OutBlock"); for (int i = 0; i < cnt_t9944OutBlock; i++) { List <string> list = new List <string>(); string 단축코드 = myXAQueryClass_t9944.GetFieldData("t9944OutBlock", "shcode", i); string yyyy = ""; if (단축코드.Substring(3, 1) == "H") { yyyy = "2013"; } else if (단축코드.Substring(3, 1) == "J") { yyyy = "2014"; } else if (단축코드.Substring(3, 1) == "K") { yyyy = "2015"; } string 종목명 = myXAQueryClass_t9944.GetFieldData("t9944OutBlock", "hname", i); string 확장코드 = myXAQueryClass_t9944.GetFieldData("t9944OutBlock", "expcode", i); string 만기년월 = yyyy + 종목명.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries)[1].Replace("월", ""); list.Add(종목명); list.Add(확장코드); list.Add(만기년월); if (!Form1.Master선옵종목.ContainsKey(단축코드)) { Form1.Master선옵종목.Add(단축코드, list); } 마지막코드 = 단축코드; } myTimer.Tick += new EventHandler(myTimer_Tick); myTimer.Interval = 220; myTimer.Start(); }
void myXAQueryClass_t9943_ReceiveData(string szTrCode) { int cnt_t9943OutBlock = myXAQueryClass_t9943.GetBlockCount("t9943OutBlock"); for (int i = 0; i < cnt_t9943OutBlock; i++) { List <string> list = new List <string>(); string 단축코드 = myXAQueryClass_t9943.GetFieldData("t9943OutBlock", "shcode", i); if (단축코드.Substring(0, 1) == "4") { continue; } string yyyy = ""; if (단축코드.Substring(3, 1) == "H") { yyyy = "2013"; } else if (단축코드.Substring(3, 1) == "J") { yyyy = "2014"; } else if (단축코드.Substring(3, 1) == "K") { yyyy = "2015"; } string 종목명 = myXAQueryClass_t9943.GetFieldData("t9943OutBlock", "hname", i); string 확장코드 = myXAQueryClass_t9943.GetFieldData("t9943OutBlock", "expcode", i); string 만기년월 = yyyy + 종목명.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries)[1].Replace("월물", ""); list.Add(종목명); list.Add(확장코드); list.Add(만기년월); if (!Form1.Master선옵종목.ContainsKey(단축코드)) { Form1.Master선옵종목.Add(단축코드, list); } } }
/// <summary> /// CallBack /// </summary> /// <param name="myXAQueryClass"></param> private void ReceiveData(XAQueryClass myXAQueryClass) { string result = ""; try { string hname = myXAQueryClass.GetFieldData("t1102OutBlock", "hname", 0); string price = myXAQueryClass.GetFieldData("t1102OutBlock", "price", 0); string sign = myXAQueryClass.GetFieldData("t1102OutBlock", "sign", 0); string change = myXAQueryClass.GetFieldData("t1102OutBlock", "change", 0); string diff = myXAQueryClass.GetFieldData("t1102OutBlock", "diff", 0); if (CStringUtil.IsNullOrEmpty(hname) == false) { StringBuilder param = new StringBuilder(); param.Append(hname); param.Append(CConst.DB_PARAM_DELIMITER).Append(price); param.Append(CConst.DB_PARAM_DELIMITER).Append(sign); param.Append(CConst.DB_PARAM_DELIMITER).Append(change); param.Append(CConst.DB_PARAM_DELIMITER).Append(diff); WebSql.SelectSql(3102, param.ToString()); result = param.ToString(); } } catch (Exception e) { result = "데이터 가져오기 실패"; CLog.debug(logger, "CAgent.ReceiveData: " + e.Message + ", XASession: " + XASession.GetErrorMessage(XASession.GetLastError())); } if (form != null) { form.DisplayReturnMessage(result); } }
private void ReceveData(XAQueryClass myXAQueryClass) { string[] names = Enum.GetNames(typeof(ColumnName)); int cnt_t0434OutBlock1 = myXAQueryClass.GetBlockCount("t0434OutBlock1"); for (int i = 0; i < cnt_t0434OutBlock1; i++) { DataRow newrow = table.NewRow(); foreach (string colname in names) { newrow[colname] = myXAQueryClass.GetFieldData("t0434OutBlock1", colname, i); } table.Rows.Add(newrow); } }
void t0424_ReceiveData(string szTrCode)//주식잔고2 { int cnt = t0424.GetBlockCount("t0424OutBlock1"); for (int i = 0; i < cnt; i++) { string 종목코드 = t0424.GetFieldData("t0424OutBlock1", "expcode", i).Trim(); string 잔고수량 = t0424.GetFieldData("t0424OutBlock1", "janqty", i); string 매도가능수량 = t0424.GetFieldData("t0424OutBlock1", "mdposqt", i); string 평균단가 = t0424.GetFieldData("t0424OutBlock1", "pamt", i); string 종목명 = t0424.GetFieldData("t0424OutBlock1", "hname", i); string 현재가 = t0424.GetFieldData("t0424OutBlock1", "price", i); string 평가손익 = t0424.GetFieldData("t0424OutBlock1", "dtsunik", i); DataRow newrow = table_잔고현황.NewRow(); newrow["종목코드"] = 종목코드; newrow["잔고수량"] = 잔고수량; newrow["매도가능수량"] = 매도가능수량; newrow["평균단가"] = 평균단가; newrow["종목명"] = 종목명; newrow["현재가"] = 현재가; newrow["평가손익"] = 평가손익; table_잔고현황.Rows.Add(newrow); 현재가요청(종목코드); } if (t0424.IsNext) { 연속key_t0424 = t0424.GetFieldData("t0424OutBlock", "cts_expcode", 0); myTimer_t0424.Interval = 1000; myTimer_t0424.Start(); } else { myTimer_t0424.Stop(); } }
void myXAQueryClass_t9945_ReceiveData(string szTrCode) { int cnt = myXAQueryClass_t9945.GetBlockCount("t9945OutBlock"); for (int i = 0; i < cnt; i++) { string 종목명 = myXAQueryClass_t9945.GetFieldData("t9945OutBlock", "hname", i); string 단축코드 = myXAQueryClass_t9945.GetFieldData("t9945OutBlock", "shcode", i).Trim(); string 확장코드 = myXAQueryClass_t9945.GetFieldData("t9945OutBlock", "expcode", i).Trim(); string 소속부 = ""; if (myXAQueryClass_t9945.GetFieldData("t9945InBlock", "gubun", 0) == "1") { 소속부 = "거래소"; } else if (myXAQueryClass_t9945.GetFieldData("t9945InBlock", "gubun", 0) == "2") { 소속부 = "코스닥"; } List <string> value = new List <string>(); value.Add(종목명); value.Add(확장코드); value.Add(소속부); Form1.Master주식종목.Add(단축코드, value); 종목수++; //Console.WriteLine(종목수 + "\t" + 단축코드 + "\t" + 종목명 + "\t" + 확장코드 + "\t" + 소속부); 마지막code = 단축코드; } if (myXAQueryClass_t9945.GetFieldData("t9945InBlock", "gubun", 0) == "1") { myXAQueryClass_t1101.ResFileName = @"C:\ETRADE\xingAPI\Res\t1101.res"; myXAQueryClass_t1101.ReceiveData += new _IXAQueryEvents_ReceiveDataEventHandler(myXAQueryClass_t1101_ReceiveData); myXAQueryClass_t1101.ReceiveMessage += new _IXAQueryEvents_ReceiveMessageEventHandler(myXAQueryClass_t1101_ReceiveMessage); myTimer_1.Interval = 220; myTimer_1.Tick += new EventHandler(myTimer_1_Tick); myTimer_1.Start(); } }
private void ReceveData(XAQueryClass myXAQueryClass) { label8.Text = string.Format("{0:#,0}", int.Parse(myXAQueryClass.GetFieldData("CFOBQ10500OutBlock2", "DpsamtTotamt", 0))); //예탁금총액 label9.Text = string.Format("{0:#,0}", int.Parse(myXAQueryClass.GetFieldData("CFOBQ10500OutBlock2", "Dps", 0))); //예수금 label10.Text = string.Format("{0:#,0}", int.Parse(myXAQueryClass.GetFieldData("CFOBQ10500OutBlock2", "SubstAmt", 0))); //대용금액 label12.Text = string.Format("{0:#,0}", int.Parse(myXAQueryClass.GetFieldData("CFOBQ10500OutBlock2", "FilupDpsamtTotamt", 0))); //충당예탁금총액 label13.Text = string.Format("{0:#,0}", int.Parse(myXAQueryClass.GetFieldData("CFOBQ10500OutBlock2", "FilupDps", 0))); //충당예수금 label34.Text = string.Format("{0:#,0}", int.Parse(myXAQueryClass.GetFieldData("CFOBQ10500OutBlock2", "FutsPnlAmt", 0))); //선물손익금액 label28.Text = string.Format("{0:#,0}", int.Parse(myXAQueryClass.GetFieldData("CFOBQ10500OutBlock2", "WthdwAbleAmt", 0))); //인출가능금액 label29.Text = string.Format("{0:#,0}", int.Parse(myXAQueryClass.GetFieldData("CFOBQ10500OutBlock2", "PsnOutAbleCurAmt", 0))); //인출가능현금액 label30.Text = string.Format("{0:#,0}", int.Parse(myXAQueryClass.GetFieldData("CFOBQ10500OutBlock2", "PsnOutAbleSubstAmt", 0))); //인출가능대용금액 label16.Text = string.Format("{0:#,0}", int.Parse(myXAQueryClass.GetFieldData("CFOBQ10500OutBlock2", "Mgn", 0))); //증거금액 label17.Text = string.Format("{0:#,0}", int.Parse(myXAQueryClass.GetFieldData("CFOBQ10500OutBlock2", "MnyMgn", 0))); //현금증거금액 label20.Text = string.Format("{0:#,0}", int.Parse(myXAQueryClass.GetFieldData("CFOBQ10500OutBlock2", "OrdAbleAmt", 0))); //주문가능금액 label21.Text = string.Format("{0:#,0}", int.Parse(myXAQueryClass.GetFieldData("CFOBQ10500OutBlock2", "MnyOrdAbleAmt", 0))); //현금주문가능금액 label24.Text = string.Format("{0:#,0}", int.Parse(myXAQueryClass.GetFieldData("CFOBQ10500OutBlock2", "AddMgn", 0))); //추가증거금액 label25.Text = string.Format("{0:#,0}", int.Parse(myXAQueryClass.GetFieldData("CFOBQ10500OutBlock2", "MnyAddMgn", 0))); //현금추가증거금액 label32.Text = string.Format("{0:#,0}", int.Parse(myXAQueryClass.GetFieldData("CFOBQ10500OutBlock2", "AmtPrdayChckInAmt", 0))); //금전일수표입금액 label36.Text = string.Format("{0:#,0}", int.Parse(myXAQueryClass.GetFieldData("CFOBQ10500OutBlock2", "FnoPrdaySubstSellAmt", 0))); //선물옵션전일대용매도금액 label40.Text = string.Format("{0:#,0}", int.Parse(myXAQueryClass.GetFieldData("CFOBQ10500OutBlock2", "FnoCrdaySubstSellAmt", 0))); //선물옵션금일대용매도금액 label38.Text = string.Format("{0:#,0}", int.Parse(myXAQueryClass.GetFieldData("CFOBQ10500OutBlock2", "FnoPrdayFdamt", 0))); //선물옵션전일가입금액 label42.Text = string.Format("{0:#,0}", int.Parse(myXAQueryClass.GetFieldData("CFOBQ10500OutBlock2", "FnoCrdayFdamt", 0))); //선물옵션금일가입금액 }
void CSPAT00800_ReceiveData(string szTrCode) { toolStripStatusLabel1.Text = CSPAT00800.GetFieldData("CSPAT00800OutBlock2", "OrdNo", 0); }
void t0425_ReceiveData(string szTrCode)//주식 체결/미체결 { int cnt = t0425.GetBlockCount("t0425OutBlock1"); for (int i = 0; i < cnt; i++) { string 주문번호 = t0425.GetFieldData("t0425OutBlock1", "ordno", i); string 종목코드 = t0425.GetFieldData("t0425OutBlock1", "expcode", i); string 주문수량 = t0425.GetFieldData("t0425OutBlock1", "qty", i); string 주문가격 = t0425.GetFieldData("t0425OutBlock1", "price", i); string 체결수량 = t0425.GetFieldData("t0425OutBlock1", "cheqty", i); string 체결가격 = t0425.GetFieldData("t0425OutBlock1", "cheprice", i); string 미체결수량 = t0425.GetFieldData("t0425OutBlock1", "ordrem", i); string 매매구분 = t0425.GetFieldData("t0425OutBlock1", "medosu", i); string 종목명 = 종목명불러오기(종목코드); //Console.WriteLine("체결수량 : " + 체결수량 + ", 미체결수량 : " + 미체결수량); if (int.Parse(체결수량) > 0) { //Console.WriteLine("if (int.Parse(체결수량) > 0)"); DataRow newrow = table_체결현황.NewRow(); newrow["주문번호"] = 주문번호; newrow["종목코드"] = 종목코드; newrow["매매구분"] = 매매구분; newrow["주문가격"] = 주문가격; newrow["주문수량"] = 주문수량; newrow["체결수량"] = 체결수량; newrow["체결가격"] = 체결가격; newrow["종목명"] = 종목명; table_체결현황.Rows.Add(newrow); } if (int.Parse(미체결수량) > 0) { //Console.WriteLine("if (int.Parse(미체결수량) > 0)"); DataRow newrow1 = table_미체결현황.NewRow(); newrow1["주문번호"] = 주문번호; newrow1["종목코드"] = 종목코드; newrow1["매매구분"] = 매매구분; newrow1["주문가격"] = 주문가격; newrow1["주문수량"] = 주문수량; newrow1["미체결수량"] = 미체결수량; newrow1["종목명"] = 종목명; table_미체결현황.Rows.Add(newrow1); } } if (t0425.IsNext) { 연속key_t0425 = t0425.GetFieldData("t0425OutBlock", "cts_ordno", 0); myTimer_t0425.Interval = 1000; myTimer_t0425.Start(); } else { myTimer_t0425.Stop(); } }
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); } } }
public string GetFieldData(string blockName, string fieldName, int index) { return(_xaQuery.GetFieldData(blockName, fieldName, index)); }
private void ReceveData(XAQueryClass myXAQueryClass) { double jnilclose = double.Parse(myXAQueryClass.GetFieldData("t2101OutBlock", "jnilclose", 0)); //전일종가 double uplmtprice = double.Parse(myXAQueryClass.GetFieldData("t2101OutBlock", "uplmtprice", 0)); //상한가 double dnlmtprice = double.Parse(myXAQueryClass.GetFieldData("t2101OutBlock", "dnlmtprice", 0)); //하한가 double 현재가 = double.Parse(myXAQueryClass.GetFieldData("t2101OutBlock", "price", 0)); //현재가 항목List작성(double.Parse(myXAQueryClass.GetFieldData("t2101OutBlock", "jnilclose", 0)), "전일종가"); 항목List작성(double.Parse(myXAQueryClass.GetFieldData("t2101OutBlock", "price", 0)), "현재가"); 항목List작성(double.Parse(myXAQueryClass.GetFieldData("t2101OutBlock", "open", 0)), "시가"); 항목List작성(double.Parse(myXAQueryClass.GetFieldData("t2101OutBlock", "high", 0)), "고가"); 항목List작성(double.Parse(myXAQueryClass.GetFieldData("t2101OutBlock", "low", 0)), "저가"); 항목List작성(double.Parse(myXAQueryClass.GetFieldData("t2101OutBlock", "high52w", 0)), "52최고가"); 항목List작성(double.Parse(myXAQueryClass.GetFieldData("t2101OutBlock", "low52w", 0)), "52최저가"); 항목List작성(double.Parse(myXAQueryClass.GetFieldData("t2101OutBlock", "listhprice", 0)), "상장최고가"); 항목List작성(double.Parse(myXAQueryClass.GetFieldData("t2101OutBlock", "listlprice", 0)), "상장최저가"); 항목List작성(double.Parse(myXAQueryClass.GetFieldData("t2101OutBlock", "recprice", 0)), "기준가"); 항목List작성(double.Parse(myXAQueryClass.GetFieldData("t2101OutBlock", "theoryprice", 0)), "이론가"); 항목List작성(double.Parse(myXAQueryClass.GetFieldData("t2101OutBlock", "theorypriceg", 0)), "이론가"); 항목List작성(double.Parse(myXAQueryClass.GetFieldData("t2101OutBlock", "yeprice", 0)), "예상체결가"); label1.Text = "상한(" + uplmtprice + ")"; label2.Text = "하한(" + dnlmtprice + ")"; table.Clear(); double gab = 0.01d; if (uplmtprice >= 3.05d) { gab = 0.05d; } int indxcnt = 0; int 현재가indx = 0; for (double 호가 = uplmtprice - gab; 호가 > dnlmtprice; 호가 = 호가 - gab) { DataRow newrow = table.NewRow(); double hoga = Math.Round(호가, 2); if (hoga <= dnlmtprice) { break; } newrow["호가"] = string.Format("{0:0.#0}", hoga); if (hoga > jnilclose) { newrow["등락율"] = "+" + Math.Round((100d * (hoga - jnilclose) / jnilclose), 2) + "%"; } else { newrow["등락율"] = Math.Round((100d * (hoga - jnilclose) / jnilclose), 2) + "%"; } foreach (KeyValuePair <double, string> 항목 in 항목List) { if (hoga == 항목.Key) { newrow["항목"] = 항목.Value; } } table.Rows.Add(newrow); if (hoga <= 3.00d) { gab = 0.01d; } indxcnt++; if (hoga == 현재가) { 현재가indx = indxcnt; } } dataGridView1.FirstDisplayedScrollingRowIndex = Math.Max(0, 현재가indx - 6); }
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); } }