private void Process204006()
        {
            m_iYuantaAPI.YOA_SetTRInfo("204006", "OutBlock1");
            m_mainForm.lvAcctInfo1.Items[0].SubItems[1].Text = m_mainForm.Commify(m_iYuantaAPI.YOA_GetFieldDouble("yesu_amt1", 0));
            m_mainForm.lvAcctInfo1.Items[0].SubItems[2].Text = m_mainForm.Commify(m_iYuantaAPI.YOA_GetFieldDouble("maedosu_amt1", 0));
            m_mainForm.lvAcctInfo1.Items[0].SubItems[3].Text = m_mainForm.Commify(m_iYuantaAPI.YOA_GetFieldDouble("yeonche_amt1", 0));
            m_mainForm.lvAcctInfo1.Items[1].SubItems[1].Text = m_mainForm.Commify(m_iYuantaAPI.YOA_GetFieldDouble("yesu_amt2", 0));
            m_mainForm.lvAcctInfo1.Items[1].SubItems[2].Text = m_mainForm.Commify(m_iYuantaAPI.YOA_GetFieldDouble("maedosu_amt2", 0));
            m_mainForm.lvAcctInfo1.Items[1].SubItems[3].Text = m_mainForm.Commify(m_iYuantaAPI.YOA_GetFieldDouble("yeonche_amt2", 0));
            m_mainForm.lvAcctInfo1.Items[0].SubItems[0].Text = m_iYuantaAPI.YOA_GetFieldString("d1_date", 0);
            m_mainForm.lvAcctInfo1.Items[1].SubItems[0].Text = m_iYuantaAPI.YOA_GetFieldString("d1_date", 0);

            m_mainForm.lvAcctInfo3.Items[0].SubItems[1].Text = m_mainForm.Commify(m_iYuantaAPI.YOA_GetFieldDouble("yesu_amt1", 0));
            m_mainForm.lvAcctInfo3.Items[1].SubItems[1].Text = m_mainForm.Commify(m_iYuantaAPI.YOA_GetFieldDouble("we_margin_hyun_amt", 0));
            m_mainForm.lvAcctInfo3.Items[2].SubItems[1].Text = m_mainForm.Commify(m_iYuantaAPI.YOA_GetFieldDouble("we_margin_dae_amt", 0));
            m_mainForm.lvAcctInfo3.Items[3].SubItems[1].Text = m_mainForm.Commify(m_iYuantaAPI.YOA_GetFieldDouble("hyun_misu_amt", 0));
            m_mainForm.lvAcctInfo3.Items[4].SubItems[1].Text = m_mainForm.Commify(m_iYuantaAPI.YOA_GetFieldDouble("dan_jumun_amt", 0));
            m_mainForm.lvAcctInfo3.Items[5].SubItems[1].Text = m_mainForm.Commify(m_iYuantaAPI.YOA_GetFieldDouble("daeyounggum_amt", 0));
            m_mainForm.lvAcctInfo3.Items[6].SubItems[1].Text = m_mainForm.Commify(m_iYuantaAPI.YOA_GetFieldDouble("jumun_poss_hyun_amt", 0));
            m_mainForm.lvAcctInfo3.Items[7].SubItems[1].Text = m_mainForm.Commify(m_iYuantaAPI.YOA_GetFieldDouble("chul_poss_amt", 0));
            m_mainForm.lvAcctInfo3.Items[8].SubItems[1].Text = m_mainForm.Commify(m_iYuantaAPI.YOA_GetFieldDouble("supyo_ip_amt", 0));
            m_mainForm.lvAcctInfo3.Items[9].SubItems[1].Text = m_mainForm.Commify(m_iYuantaAPI.YOA_GetFieldDouble("gita_supyo_amt", 0));

            m_mainForm.lvAcctInfo4.Items[0].SubItems[1].Text = m_mainForm.Commify(m_iYuantaAPI.YOA_GetFieldDouble("sin_settle_bo_amt", 0));
            m_mainForm.lvAcctInfo4.Items[1].SubItems[1].Text = m_mainForm.Commify(m_iYuantaAPI.YOA_GetFieldDouble("sin_bo_hyun_amt", 0));
            m_mainForm.lvAcctInfo4.Items[2].SubItems[1].Text = m_mainForm.Commify(m_iYuantaAPI.YOA_GetFieldDouble("sin_bo_dae_amt", 0));
            m_mainForm.lvAcctInfo4.Items[3].SubItems[1].Text = m_mainForm.Commify(m_iYuantaAPI.YOA_GetFieldDouble("sin_dam_hyun_amt", 0));
            m_mainForm.lvAcctInfo4.Items[4].SubItems[1].Text = m_mainForm.Commify(m_iYuantaAPI.YOA_GetFieldDouble("sin_dam_dae_amt", 0));
            m_mainForm.lvAcctInfo4.Items[5].SubItems[1].Text = m_mainForm.Commify(m_iYuantaAPI.YOA_GetFieldDouble("cho_dam_hyun_amt", 0));
            m_mainForm.lvAcctInfo4.Items[6].SubItems[1].Text = m_mainForm.Commify(m_iYuantaAPI.YOA_GetFieldDouble("cho_dam_dae_amt", 0));
            m_mainForm.lvAcctInfo4.Items[7].SubItems[1].Text = m_mainForm.Commify(m_iYuantaAPI.YOA_GetFieldDouble("kwon_dae_amt", 0));
            m_mainForm.lvAcctInfo4.Items[8].SubItems[1].Text = m_mainForm.Commify(m_iYuantaAPI.YOA_GetFieldDouble("yung_gum_amt", 0));
            m_mainForm.lvAcctInfo4.Items[9].SubItems[1].Text = m_mainForm.Commify(m_iYuantaAPI.YOA_GetFieldDouble("daeju_amt", 0));
        }
        public void ReceiveData(int nReqID)
        {
            string strTRID = m_mapRequestTR[nReqID];

            if (-1 != strTRID.CompareTo("300001"))
            {
                m_mainForm.txtBTJongName.Text = m_iYuantaAPI.YOA_GetTRFieldString("300001", "OutBlock1", "jongname", 0); // GetTRFieldString 은 set,get동시
                m_mainForm.txtBTCurJuka.Text  = m_iYuantaAPI.YOA_GetTRFieldString("300001", "OutBlock1", "curjuka", 0);
                m_iYuantaAPI.YOA_SetTRInfo("300001", "OutBlock1");                                                       // SetTRInfo -> GetFieldString 값 접근
                m_mainForm.txtBTDebi.Text     = m_iYuantaAPI.YOA_GetFieldString("debi", 0);
                m_mainForm.txtBTDebiRate.Text = m_iYuantaAPI.YOA_GetFieldString("debirate", 0);
                m_mainForm.txtBTVolume.Text   = m_iYuantaAPI.YOA_GetFieldString("volume", 0);

                m_mainForm.lbLog.Items.Insert(0, "[300001]주식현재가 응답을 수신하였습니다.");
                //Console.WriteLine("2");
            }
        }
        private void Process300001_Auto11(bool bAuto)
        {
            if (bAuto)
            {
                m_iYuantaAPI.YOA_SetTRInfo("11", "OutBlock1");
            }
            else
            {
                m_iYuantaAPI.YOA_SetTRInfo("300001", "OutBlock1");
            }

            if (!bAuto)
            {
                m_mainForm.lblOrdJongName.Text = m_iYuantaAPI.YOA_GetFieldString("jongname", 0);
            }

            int nColor = m_iYuantaAPI.YOA_GetFieldAttr("curjuka", 0);

            m_mainForm.lvOrdJongInfo.Items[0].SubItems[1].Text = m_mainForm.Commify(m_iYuantaAPI.YOA_GetFieldLong("curjuka", 0));

            if (2 == nColor)
            {
                m_mainForm.lvOrdJongInfo.Items[0].ForeColor = Color.Red;
                m_mainForm.lvOrdJongInfo.Items[1].ForeColor = Color.Red;
                m_mainForm.lvOrdJongInfo.Items[2].ForeColor = Color.Red;
            }
            else if (5 == nColor)
            {
                m_mainForm.lvOrdJongInfo.Items[0].ForeColor = Color.Blue;
                m_mainForm.lvOrdJongInfo.Items[1].ForeColor = Color.Blue;
                m_mainForm.lvOrdJongInfo.Items[2].ForeColor = Color.Blue;
            }
            else
            {
                m_mainForm.lvOrdJongInfo.Items[0].ForeColor = Color.Black;
                m_mainForm.lvOrdJongInfo.Items[1].ForeColor = Color.Black;
                m_mainForm.lvOrdJongInfo.Items[2].ForeColor = Color.Black;
            }

            int    nDebi = m_iYuantaAPI.YOA_GetFieldLong("debi", 0);
            string strValue;

            if (0 < nDebi)
            {
                strValue = "▲  " + m_mainForm.Commify(nDebi);
            }
            else if (0 > nDebi)
            {
                nDebi    = -nDebi;
                strValue = "▼  " + m_mainForm.Commify(nDebi);
            }
            else
            {
                strValue = m_mainForm.Commify(Convert.ToString(nDebi));
            }
            m_mainForm.lvOrdJongInfo.Items[1].SubItems[1].Text = strValue;

            strValue = string.Format("{0:0.00}", m_iYuantaAPI.YOA_GetFieldDouble("debirate", 0));
            m_mainForm.lvOrdJongInfo.Items[2].SubItems[1].Text = strValue;

            strValue = m_mainForm.Commify(m_iYuantaAPI.YOA_GetFieldString("volume", 0));
            m_mainForm.lvOrdJongInfo.Items[3].SubItems[1].Text = strValue;

            nColor   = m_iYuantaAPI.YOA_GetFieldAttr("startjuka", 0);
            strValue = m_mainForm.Commify(m_iYuantaAPI.YOA_GetFieldString("startjuka", 0));
            m_mainForm.lvOrdJongInfo.Items[4].SubItems[1].Text = strValue;


            if (2 == nColor)
            {
                m_mainForm.lvOrdJongInfo.Items[4].ForeColor = Color.Red;
            }
            else if (5 == nColor)
            {
                m_mainForm.lvOrdJongInfo.Items[4].ForeColor = Color.Blue;
            }
            else
            {
                m_mainForm.lvOrdJongInfo.Items[4].ForeColor = Color.Black;
            }

            nColor   = m_iYuantaAPI.YOA_GetFieldAttr("highjuka", 0);
            strValue = m_mainForm.Commify(m_iYuantaAPI.YOA_GetFieldString("highjuka", 0));
            m_mainForm.lvOrdJongInfo.Items[5].SubItems[1].Text = strValue;

            if (2 == nColor)
            {
                m_mainForm.lvOrdJongInfo.Items[5].ForeColor = Color.Red;
            }
            else if (5 == nColor)
            {
                m_mainForm.lvOrdJongInfo.Items[5].ForeColor = Color.Blue;
            }
            else
            {
                m_mainForm.lvOrdJongInfo.Items[5].ForeColor = Color.Black;
            }

            nColor   = m_iYuantaAPI.YOA_GetFieldAttr("lowjuka", 0);
            strValue = m_mainForm.Commify(m_iYuantaAPI.YOA_GetFieldString("lowjuka", 0));
            m_mainForm.lvOrdJongInfo.Items[6].SubItems[1].Text = strValue;

            if (2 == nColor)
            {
                m_mainForm.lvOrdJongInfo.Items[6].ForeColor = Color.Red;
            }
            else if (5 == nColor)
            {
                m_mainForm.lvOrdJongInfo.Items[6].ForeColor = Color.Blue;
            }
            else
            {
                m_mainForm.lvOrdJongInfo.Items[6].ForeColor = Color.Black;
            }

            if (!bAuto)
            {
                m_nPrevLastPrice = m_iYuantaAPI.YOA_GetFieldLong("prevlastjuka", 0);
                m_mainForm.lvOrdJongInfo.Items[7].SubItems[1].Text = m_mainForm.Commify(m_iYuantaAPI.YOA_GetFieldString("prevlastjuka", 0));

                RegistAuto();
            }
        }
// 300001 국내주식 현재가
        private void Process300001_Auto11(bool bAuto)
        {
            if (bAuto)  // AUTO 실시간 여부
            {
                m_iYuantaAPI.YOA_SetTRInfo("11", "OutBlock1");
            }
            else        // 한번 현재가
            {
                m_iYuantaAPI.YOA_SetTRInfo("300001", "OutBlock1");
            }

            if (!bAuto)
            {
                m_mainForm.lblJongName.Text = m_iYuantaAPI.YOA_GetFieldString("jongname", 0);
            }

            //추가
            m_mainForm.LogMessage("\n종목명 : " + m_iYuantaAPI.YOA_GetFieldString("jongname", 0));

            int nColor = m_iYuantaAPI.YOA_GetFieldAttr("curjuka", 0);

            //추가
            //string strnColor = nColor.ToString();
            m_mainForm.lvJongInfo.Items[0].SubItems[1].Text = m_mainForm.Commify(m_iYuantaAPI.YOA_GetFieldLong("curjuka", 0));
            m_mainForm.lvDaily.Items[0].SubItems[2].Text    = m_mainForm.Commify(m_iYuantaAPI.YOA_GetFieldLong("curjuka", 0));

            //추가
            m_mainForm.LogMessage("\n현재가 : " + m_mainForm.Commify(m_iYuantaAPI.YOA_GetFieldLong("curjuka", 0)));

            if (2 == nColor)
            {
                m_mainForm.lvJongInfo.Items[0].ForeColor          = Color.Red;
                m_mainForm.lvJongInfo.Items[1].ForeColor          = Color.Red;
                m_mainForm.lvJongInfo.Items[2].ForeColor          = Color.Red;
                m_mainForm.lvDaily.Items[0].SubItems[2].ForeColor = Color.Red;
                m_mainForm.lvDaily.Items[0].SubItems[3].ForeColor = Color.Red;
                m_mainForm.lvDaily.Items[0].SubItems[4].ForeColor = Color.Red;
                m_mainForm.lvDaily.Items[0].SubItems[5].ForeColor = Color.Red;
            }
            else if (5 == nColor)
            {
                m_mainForm.lvJongInfo.Items[0].ForeColor          = Color.Blue;
                m_mainForm.lvJongInfo.Items[1].ForeColor          = Color.Blue;
                m_mainForm.lvJongInfo.Items[2].ForeColor          = Color.Blue;
                m_mainForm.lvDaily.Items[0].SubItems[2].ForeColor = Color.Blue;
                m_mainForm.lvDaily.Items[0].SubItems[3].ForeColor = Color.Blue;
                m_mainForm.lvDaily.Items[0].SubItems[4].ForeColor = Color.Blue;
                m_mainForm.lvDaily.Items[0].SubItems[5].ForeColor = Color.Blue;
            }
            else
            {
                m_mainForm.lvJongInfo.Items[0].ForeColor          = Color.Black;
                m_mainForm.lvJongInfo.Items[1].ForeColor          = Color.Black;
                m_mainForm.lvJongInfo.Items[2].ForeColor          = Color.Black;
                m_mainForm.lvDaily.Items[0].SubItems[2].ForeColor = Color.Black;
                m_mainForm.lvDaily.Items[0].SubItems[3].ForeColor = Color.Black;
                m_mainForm.lvDaily.Items[0].SubItems[4].ForeColor = Color.Black;
                m_mainForm.lvDaily.Items[0].SubItems[5].ForeColor = Color.Black;
            }

            int    nDebi = m_iYuantaAPI.YOA_GetFieldLong("debi", 0);
            string strValue;

            if (0 < nDebi)
            {
                strValue = "▲  " + m_mainForm.Commify(nDebi);
                m_mainForm.lvDaily.Items[0].SubItems[3].Text = "▲";
            }
            else if (0 > nDebi)
            {
                nDebi    = -nDebi;
                strValue = "▼  " + m_mainForm.Commify(nDebi);
                m_mainForm.lvDaily.Items[0].SubItems[3].Text = "▼";
            }
            else
            {
                strValue = m_mainForm.Commify(Convert.ToString(nDebi));
            }
            //추가
            m_mainForm.LogMessage("\n전일대비 : " + strValue);

            m_mainForm.lvJongInfo.Items[1].SubItems[1].Text = strValue;
            m_mainForm.lvDaily.Items[0].SubItems[4].Text    = m_mainForm.Commify(nDebi);

            strValue = string.Format("{0:0.00}", m_iYuantaAPI.YOA_GetFieldDouble("debirate", 0));
            m_mainForm.lvJongInfo.Items[2].SubItems[1].Text = strValue;
            m_mainForm.lvDaily.Items[0].SubItems[5].Text    = strValue;
            //추가
            m_mainForm.LogMessage("\n등락률 : " + strValue);

            strValue = m_mainForm.Commify(m_iYuantaAPI.YOA_GetFieldString("volume", 0));
            m_mainForm.lvJongInfo.Items[3].SubItems[1].Text = strValue;
            m_mainForm.lvDaily.Items[0].SubItems[6].Text    = strValue;

            //추가
            m_mainForm.LogMessage("\n거래량 : " + strValue);

            nColor   = m_iYuantaAPI.YOA_GetFieldAttr("startjuka", 0);
            strValue = m_mainForm.Commify(m_iYuantaAPI.YOA_GetFieldString("startjuka", 0));
            m_mainForm.lvJongInfo.Items[4].SubItems[1].Text = strValue;
            m_mainForm.lvDaily.Items[0].SubItems[7].Text    = strValue;
            //추가
            m_mainForm.LogMessage("\n시가 : " + strValue);

            if (2 == nColor)
            {
                m_mainForm.lvJongInfo.Items[4].ForeColor          = Color.Red;
                m_mainForm.lvDaily.Items[0].SubItems[7].ForeColor = Color.Red;
            }
            else if (5 == nColor)
            {
                m_mainForm.lvJongInfo.Items[4].ForeColor          = Color.Blue;
                m_mainForm.lvDaily.Items[0].SubItems[7].ForeColor = Color.Blue;
            }
            else
            {
                m_mainForm.lvJongInfo.Items[4].ForeColor          = Color.Black;
                m_mainForm.lvDaily.Items[0].SubItems[7].ForeColor = Color.Black;
            }

            nColor   = m_iYuantaAPI.YOA_GetFieldAttr("highjuka", 0);
            strValue = m_mainForm.Commify(m_iYuantaAPI.YOA_GetFieldString("highjuka", 0));
            //추가
            m_mainForm.LogMessage("\n고가 : " + strValue);
            m_mainForm.lvJongInfo.Items[5].SubItems[1].Text = strValue;
            m_mainForm.lvDaily.Items[0].SubItems[8].Text    = strValue;
            if (2 == nColor)
            {
                m_mainForm.lvJongInfo.Items[5].ForeColor          = Color.Red;
                m_mainForm.lvDaily.Items[0].SubItems[8].ForeColor = Color.Red;
            }
            else if (5 == nColor)
            {
                m_mainForm.lvJongInfo.Items[5].ForeColor          = Color.Blue;
                m_mainForm.lvDaily.Items[0].SubItems[8].ForeColor = Color.Blue;
            }
            else
            {
                m_mainForm.lvJongInfo.Items[5].ForeColor          = Color.Black;
                m_mainForm.lvDaily.Items[0].SubItems[8].ForeColor = Color.Black;
            }

            nColor   = m_iYuantaAPI.YOA_GetFieldAttr("lowjuka", 0);
            strValue = m_mainForm.Commify(m_iYuantaAPI.YOA_GetFieldString("lowjuka", 0));
            //추가
            m_mainForm.LogMessage("\n저가 : " + strValue);
            m_mainForm.lvJongInfo.Items[6].SubItems[1].Text = strValue;
            m_mainForm.lvDaily.Items[0].SubItems[9].Text    = strValue;
            if (2 == nColor)
            {
                m_mainForm.lvJongInfo.Items[6].ForeColor          = Color.Red;
                m_mainForm.lvDaily.Items[0].SubItems[9].ForeColor = Color.Red;
            }
            else if (5 == nColor)
            {
                m_mainForm.lvJongInfo.Items[6].ForeColor          = Color.Blue;
                m_mainForm.lvDaily.Items[0].SubItems[9].ForeColor = Color.Blue;
            }
            else
            {
                m_mainForm.lvJongInfo.Items[6].ForeColor          = Color.Black;
                m_mainForm.lvDaily.Items[0].SubItems[9].ForeColor = Color.Black;
            }

            if (bAuto)
            {
                int nRowCnt = m_mainForm.lvConTick.Items.Count;
                if (19 < nRowCnt)
                {
                    m_mainForm.lvConTick.Items.RemoveAt(nRowCnt - 1);
                }

                ListViewItem item = new ListViewItem();
                item.UseItemStyleForSubItems = false;
                item.SubItems.Add(m_iYuantaAPI.YOA_GetFieldString("time2", 0));
                item.SubItems.Add(m_mainForm.Commify(m_iYuantaAPI.YOA_GetFieldString("curjuka", 0)));
                item.SubItems.Add(m_mainForm.Commify(m_iYuantaAPI.YOA_GetFieldString("nowvol", 0)));
                //추가
                m_mainForm.LogMessage("\n체결량 : " + m_iYuantaAPI.YOA_GetFieldString("nowvol", 0));
                m_mainForm.LogMessage("-----------------------------------------------------------------");
                char szColor = (char)m_iYuantaAPI.YOA_GetTRFieldAttr("11", "OutBlock1", "nowvol", 0);
                if ('S' == szColor)
                {
                    item.SubItems[3].ForeColor = Color.Red;
                }
                else if ('B' == szColor)
                {
                    item.SubItems[3].ForeColor = Color.Blue;
                }
                else
                {
                    item.SubItems[3].ForeColor = Color.Black;
                }

                m_mainForm.lvConTick.Items.Insert(0, item);
            }
            else
            {
                m_nPrevLastPrice = m_iYuantaAPI.YOA_GetFieldLong("prevlastjuka", 0);
                //추가
                m_mainForm.LogMessage("\n전일종가 : " + m_iYuantaAPI.YOA_GetFieldLong("prevlastjuka", 0));
                m_mainForm.LogMessage("-----------------------------------------------------------------");
                m_mainForm.lvJongInfo.Items[7].SubItems[1].Text = m_mainForm.Commify(m_nPrevLastPrice);
            }
        }