tr-opt50008(프로그램매매추이차트요청)
- REQUEST Code
string trCd = "opt50008";
// 종목코드 = P00101:코스피, P10102:코스닥
axKHOpenAPI.SetInputValue("종목코드", "P00101");
// 시간구분 = 1 (다른값 허용안함)
axKHOpenAPI.SetInputValue("시간구분", "1");
axKHOpenAPI.CommRqData("RQName", trCd, 0, GetScrNum());
- RESPONSE Code
//TR 조회 요구에 대한 데이터 수신 이벤트
private void axKHOpenAPI_OnReceiveTrData(object sender, AxKHOpenAPILib._DKHOpenAPIEvents_OnReceiveTrDataEvent e) {
switch (e.sTrCode.ToLower()) {
case "opt50008": // 프로그램매매추이차트요청
funcOpt50008(sender, e);
break;
}
}
// 프로그램매매추이차트요청
private void funcOpt50008(object sender, AxKHOpenAPILib._DKHOpenAPIEvents_OnReceiveTrDataEvent e) {
try {
string[] columns = new string[] { "체결시간", "투자자별매도금액", "투자자별매수금액", "투자자별순매수금액" };
List<string[]> list = new List<string[]>();
list.Add(columns);
Console.WriteLine("<!-- Start funcOpt50008 (프로그램매매추이차트요청) -->");
int nCnt = axKHOpenAPI.GetRepeatCnt(e.sTrCode, e.sRQName);
for (int ni = 0; ni < nCnt; ni++) {
string[] row = new string[columns.Length];
for (int i = 0; i < columns.Length; i++) {
row[i] = axKHOpenAPI.GetCommData(e.sTrCode, e.sRQName, ni, columns[i]).Trim();
}
list.Add(row);
}
PrintHtmlTable(list);
Console.WriteLine("<!-- End funcOpt50008 (프로그램매매추이차트요청) -->");
}
catch (Exception e1) {
Console.WriteLine(e1.StackTrace);
}
}
public void PrintHtmlTable(List<string[]> list) {
string table = "<table>\r\n";
for (int i = 0; i < list.Count; i++) {
table +="<tr>";
for (int j = 0; j < list[i].Length; j++) {
table += string.Format("<td>{0}</td>", list[i][j]);
}
table +="</tr>\r\n";
}
table +="</table>";
Console.WriteLine(table);
tbLog.Text = table;
}
- RESPONSE Data Sample
체결시간 | 투자자별매도금액 | 투자자별매수금액 | 투자자별순매수금액 |
180311 | 2304348 | 2132356 | -171992 |
160002 | 1833688 | 1935539 | 101851 |
155146 | 1833688 | 1935539 | 101851 |
154335 | 1833686 | 1935538 | 101852 |
154040 | 1833685 | 1935538 | 101853 |
153506 | 1833655 | 1935537 | 101882 |
153243 | 1833655 | 1935537 | 101882 |
153028 | 1821256 | 1912680 | 91425 |
153022 | 1806211 | 1890352 | 84141 |
153012 | 1776732 | 1843208 | 66476 |
152953 | 1692959 | 1724760 | 31801 |
152936 | 1692959 | 1724760 | 31801 |
152926 | 1692959 | 1724760 | 31801 |
152918 | 1692959 | 1724760 | 31801 |
152909 | 1692959 | 1724760 | 31801 |
152856 | 1692959 | 1724760 | 31801 |
152846 | 1692959 | 1724760 | 31801 |
152828 | 1692959 | 1724760 | 31801 |
152811 | 1692959 | 1724760 | 31801 |
152751 | 1692959 | 1724760 | 31801 |
152737 | 1692959 | 1724760 | 31801 |
152719 | 1692959 | 1724760 | 31801 |
152701 | 1692959 | 1724760 | 31801 |
152645 | 1692959 | 1724760 | 31801 |
152634 | 1692959 | 1724760 | 31801 |
152619 | 1692959 | 1724760 | 31801 |
152604 | 1692959 | 1724760 | 31801 |
152545 | 1692959 | 1724760 | 31801 |
152533 | 1692959 | 1724760 | 31801 |
152517 | 1692959 | 1724760 | 31801 |
152505 | 1692959 | 1724760 | 31801 |
152449 | 1692959 | 1724760 | 31801 |
152428 | 1692959 | 1724760 | 31801 |
152409 | 1692959 | 1724760 | 31801 |
152352 | 1692959 | 1724760 | 31801 |
152332 | 1692959 | 1724760 | 31801 |
152315 | 1692959 | 1724760 | 31801 |
152259 | 1692959 | 1724760 | 31801 |
152237 | 1692959 | 1724760 | 31801 |
152222 | 1692959 | 1724760 | 31801 |
152207 | 1692959 | 1724760 | 31801 |
152151 | 1692959 | 1724760 | 31801 |
152131 | 1692959 | 1724760 | 31801 |
152120 | 1692959 | 1724760 | 31801 |
152109 | 1692959 | 1724760 | 31801 |
152100 | 1692959 | 1724760 | 31801 |
152051 | 1692959 | 1724760 | 31801 |
152040 | 1692959 | 1724760 | 31801 |
152021 | 1692959 | 1724760 | 31801 |
152013 | 1692959 | 1724760 | 31801 |
151947 | 1691694 | 1724027 | 32333 |
151859 | 1685427 | 1717110 | 31683 |
151839 | 1683908 | 1715046 | 31138 |
151815 | 1681634 | 1712319 | 30685 |
151746 | 1677565 | 1709251 | 31686 |
151732 | 1676300 | 1707601 | 31301 |
151719 | 1673485 | 1706459 | 32974 |
151645 | 1670374 | 1702862 | 32489 |
151619 | 1666713 | 1699590 | 32877 |
151552 | 1664121 | 1697711 | 33590 |
151538 | 1663142 | 1696648 | 33505 |
151512 | 1657943 | 1693332 | 35389 |
151444 | 1656088 | 1690713 | 34625 |
151428 | 1655188 | 1689747 | 34559 |
151404 | 1652905 | 1687713 | 34808 |
151335 | 1649710 | 1685506 | 35797 |
151319 | 1647999 | 1682959 | 34959 |
151251 | 1645691 | 1678937 | 33245 |
151232 | 1644236 | 1677381 | 33144 |
151208 | 1642502 | 1674863 | 32361 |
151152 | 1641165 | 1673652 | 32487 |
151130 | 1639621 | 1671457 | 31836 |
151109 | 1638517 | 1670162 | 31645 |
151054 | 1637386 | 1669260 | 31873 |
151028 | 1635497 | 1666646 | 31149 |
151006 | 1633186 | 1664825 | 31640 |
150944 | 1631076 | 1663292 | 32216 |
150919 | 1628920 | 1661270 | 32350 |
150856 | 1627552 | 1659874 | 32322 |
150844 | 1626767 | 1658955 | 32188 |
150827 | 1625283 | 1656669 | 31386 |
150806 | 1623507 | 1653159 | 29652 |
150751 | 1621878 | 1650624 | 28746 |
150739 | 1621267 | 1649436 | 28169 |
150720 | 1619656 | 1646859 | 27203 |
150700 | 1618243 | 1645433 | 27190 |
150643 | 1617207 | 1643444 | 26237 |
150627 | 1615889 | 1642013 | 26123 |
150605 | 1613741 | 1637412 | 23670 |
150546 | 1612367 | 1635574 | 23207 |
150523 | 1609970 | 1633160 | 23190 |
150454 | 1602250 | 1627525 | 25275 |
150439 | 1600908 | 1625977 | 25069 |
150425 | 1600336 | 1625258 | 24922 |
150416 | 1599719 | 1624761 | 25042 |
150404 | 1599118 | 1624093 | 24975 |
150338 | 1595777 | 1618004 | 22227 |
150322 | 1594638 | 1616751 | 22113 |
150308 | 1593370 | 1615884 | 22514 |
150248 | 1592305 | 1614250 | 21945 |
키움 open-api TR 목록
728x90
댓글