private void Process201007() { string strData = ""; int nData = 0; m_iYuantaAPI.YOA_SetTRInfo("210007", "OutBlock2"); string[] strSeparator1 = new string[] { "/" }; string[] strSeparator2 = new string[] { "}" }; string[] strResult = null; string strJongCode = ""; string strJongName = ""; string strJongType = ""; Color clrJongType = new Color(); ListViewItem item = null; int nDataCount = m_iYuantaAPI.YOA_GetRowCount("201007", "OutBlock2"); for (int i = 0; i < nDataCount; i++) { strResult = null; strJongCode = ""; strJongName = ""; strJongType = ""; item = new ListViewItem(); item.UseItemStyleForSubItems = false; strData = m_iYuantaAPI.YOA_GetFieldString("stk_name", i); strData.TrimEnd(); strResult = strData.Split(strSeparator1, StringSplitOptions.None); if (0 < strResult.Length) { strJongCode = strResult[0]; } if (1 < strResult.Length) { strJongName = strResult[1]; } if (2 < strResult.Length) { strJongType = strResult[2]; strJongType.TrimEnd(); if (strJongType.Equals("K")) { clrJongType = Color.Red; } else { clrJongType = Color.Blue; } } item.SubItems.Add(strJongType); item.SubItems[0].ForeColor = clrJongType; item.SubItems.Add(strJongName); strData = m_iYuantaAPI.YOA_GetFieldString("trde_tp_gubun", i); strData.TrimEnd(); strResult = strData.Split(strSeparator2, StringSplitOptions.None); if (2 < strResult.Length) { item.SubItems.Add(strResult[2]); strData = strResult[0]; if (-1 != strData.IndexOf("FF0000")) { item.SubItems[2].ForeColor = Color.Red; } else { item.SubItems[2].ForeColor = Color.Blue; } } else { item.SubItems.Add(""); } nData = m_iYuantaAPI.YOA_GetFieldLong("cntr_qty_cnt", i); item.SubItems.Add(m_mainForm.Commify(nData)); nData = m_iYuantaAPI.YOA_GetFieldLong("cntr_uv_price", i); item.SubItems.Add(m_mainForm.Commify(nData)); nData = m_iYuantaAPI.YOA_GetFieldLong("contract_amt", i); item.SubItems.Add(m_mainForm.Commify(nData)); m_mainForm.lvOrdChegyul.Items.Insert(0, item); } m_mainForm.lblOrdCnt1.Text = Convert.ToString(nDataCount); }
private void Process300002_Auto12(bool bAuto) { int nValue = 0; double dRate = 0.0; int nDataCount = 0; if (bAuto) { m_iYuantaAPI.YOA_SetTRInfo("12", "OutBlock2"); nDataCount = m_iYuantaAPI.YOA_GetRowCount("12", "OutBlock2"); } else { m_iYuantaAPI.YOA_SetTRInfo("300002", "OutBlock1"); nDataCount = m_iYuantaAPI.YOA_GetRowCount("300002", "OutBlock1"); } int nMedoTot = 0; int nMesuTot = 0; int nMedoDebiTot = 0; int nMesuDebiTot = 0; for (int i = 0; i < nDataCount; i++) { nValue = m_iYuantaAPI.YOA_GetFieldLong("medohoka", i); if (0 != nValue) { if (bAuto) { nMedoDebiTot += m_iYuantaAPI.YOA_GetFieldLong("medodebi", i); m_mainForm.lvMedoHoga.Items[9 - i].SubItems[1].Text = "0"; } else { m_mainForm.lvMedoHoga.Items[9 - i].SubItems[1].Text = "0"; } nMedoTot += m_iYuantaAPI.YOA_GetFieldLong("medovol", i); m_mainForm.lvMedoHoga.Items[9 - i].SubItems[2].Text = m_iYuantaAPI.YOA_GetFieldString("medovol", i); if (m_nPrevLastPrice < nValue) { m_mainForm.lvMedoHoga.Items[9 - i].SubItems[3].ForeColor = Color.Red; m_mainForm.lvMedoHoga.Items[9 - i].SubItems[4].ForeColor = Color.Red; } else if (m_nPrevLastPrice > nValue) { m_mainForm.lvMedoHoga.Items[9 - i].SubItems[3].ForeColor = Color.Blue; m_mainForm.lvMedoHoga.Items[9 - i].SubItems[4].ForeColor = Color.Blue; } else { m_mainForm.lvMedoHoga.Items[9 - i].SubItems[3].ForeColor = Color.Black; m_mainForm.lvMedoHoga.Items[9 - i].SubItems[4].ForeColor = Color.Black; } m_mainForm.lvMedoHoga.Items[9 - i].SubItems[3].Text = m_mainForm.Commify(Convert.ToString(nValue)); dRate = ((double)nValue / (double)m_nPrevLastPrice - 1) * 100; m_mainForm.lvMedoHoga.Items[9 - i].SubItems[4].Text = string.Format("{0:0.00}", dRate); } else { m_mainForm.lvMedoHoga.Items[9 - i].SubItems[1].Text = ""; m_mainForm.lvMedoHoga.Items[9 - i].SubItems[2].Text = ""; m_mainForm.lvMedoHoga.Items[9 - i].SubItems[3].Text = ""; m_mainForm.lvMedoHoga.Items[9 - i].SubItems[4].Text = ""; } nValue = m_iYuantaAPI.YOA_GetFieldLong("mesuhoka", i); if (0 != nValue) { if (m_nPrevLastPrice < nValue) { m_mainForm.lvMesuHoga.Items[i].SubItems[3].ForeColor = Color.Red; m_mainForm.lvMesuHoga.Items[i].SubItems[4].ForeColor = Color.Red; } else if (m_nPrevLastPrice > nValue) { m_mainForm.lvMesuHoga.Items[i].SubItems[3].ForeColor = Color.Blue; m_mainForm.lvMesuHoga.Items[i].SubItems[4].ForeColor = Color.Blue; } else { m_mainForm.lvMesuHoga.Items[i].SubItems[3].ForeColor = Color.Black; m_mainForm.lvMesuHoga.Items[i].SubItems[4].ForeColor = Color.Black; } m_mainForm.lvMesuHoga.Items[i].SubItems[3].Text = m_mainForm.Commify(Convert.ToString(nValue)); dRate = ((double)nValue / (double)m_nPrevLastPrice - 1) * 100; m_mainForm.lvMesuHoga.Items[i].SubItems[4].Text = string.Format("{0:0.00}", dRate); nMesuTot += m_iYuantaAPI.YOA_GetFieldLong("mesuvol", i); m_mainForm.lvMesuHoga.Items[i].SubItems[5].Text = m_iYuantaAPI.YOA_GetFieldString("mesuvol", i); if (bAuto) { nMesuDebiTot += m_iYuantaAPI.YOA_GetFieldLong("mesudebi", i); m_mainForm.lvMedoHoga.Items[i].SubItems[6].Text = "0"; } else { m_mainForm.lvMedoHoga.Items[i].SubItems[6].Text = "0"; } } else { m_mainForm.lvMesuHoga.Items[i].SubItems[3].Text = ""; m_mainForm.lvMesuHoga.Items[i].SubItems[4].Text = ""; m_mainForm.lvMesuHoga.Items[i].SubItems[5].Text = ""; m_mainForm.lvMesuHoga.Items[i].SubItems[6].Text = ""; } } int nTot = nMesuTot - nMedoTot; m_mainForm.lvHogaFooter.Items[0].SubItems[1].Text = m_mainForm.Commify(nMedoDebiTot); m_mainForm.lvHogaFooter.Items[0].SubItems[2].Text = m_mainForm.Commify(nMedoTot); m_mainForm.lvHogaFooter.Items[0].SubItems[3].Text = m_mainForm.Commify(nTot); m_mainForm.lvHogaFooter.Items[0].SubItems[4].Text = m_mainForm.Commify(nMesuTot); m_mainForm.lvHogaFooter.Items[0].SubItems[5].Text = m_mainForm.Commify(nMesuDebiTot); m_mainForm.lvHogaFooter.Items[0].SubItems[2].ForeColor = Color.Blue; m_mainForm.lvHogaFooter.Items[0].SubItems[4].ForeColor = Color.Red; if (0 < nTot) { m_mainForm.lvHogaFooter.Items[0].SubItems[3].ForeColor = Color.Red; } else if (0 < nTot) { m_mainForm.lvHogaFooter.Items[0].SubItems[3].ForeColor = Color.Blue; } else { m_mainForm.lvHogaFooter.Items[0].SubItems[3].ForeColor = Color.Black; } if (!bAuto) { ListViewItem item = null; char attr; m_mainForm.lvConTick.BeginUpdate(); m_iYuantaAPI.YOA_SetTRInfo("300002", "OutBlock5"); nDataCount = m_iYuantaAPI.YOA_GetRowCount("300002", "OutBlock5"); for (int i = 0; i < nDataCount; i++) { item = new ListViewItem(); item.UseItemStyleForSubItems = false; item.SubItems.Add(m_iYuantaAPI.YOA_GetFieldString("time", i)); item.SubItems.Add(m_mainForm.Commify(m_iYuantaAPI.YOA_GetFieldString("curjuka", i))); item.SubItems.Add(m_mainForm.Commify(m_iYuantaAPI.YOA_GetFieldString("nowvol", i))); attr = (char)m_iYuantaAPI.YOA_GetTRFieldAttr("300002", "OutBlock5", "nowvol", i); if ('S' == attr) { item.SubItems[3].ForeColor = Color.Red; } else if ('B' == attr) { item.SubItems[3].ForeColor = Color.Blue; } else { item.SubItems[3].ForeColor = Color.Black; } m_mainForm.lvConTick.Items.Add(item); } m_mainForm.lvConTick.EndUpdate(); RegistAuto(); } }