본문 바로가기
키움자동매매

tr-opt10047(체결강도추이일별요청)

by Knowledge Store In Hyunsoft 2022. 10. 9.

tr-opt10047(체결강도추이일별요청)

  • REQUEST Code
string trStockCd = "005930"; //삼성전자
string trCd = "opt10047";

// 종목코드 = 전문 조회할 종목코드
axKHOpenAPI.SetInputValue("종목코드", trStockCd);
// 틱구분 = 설정값 1
axKHOpenAPI.SetInputValue("틱구분", "1");
// 체결강도구분 = 설정값 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 "opt10047": // 체결강도추이일별요청 
            funcOpt10047(sender, e);
            break;
    }
}

// 체결강도추이일별요청 
private void funcOpt10047(object sender, AxKHOpenAPILib._DKHOpenAPIEvents_OnReceiveTrDataEvent e) {
    try {
        string[] columns = new string[] { "일자", "현재가", "전일대비", "전일대비기호", "등락율", "거래량", "누적거래대금", "누적거래량", "체결강도", "체결강도5분", "체결강도20분", "체결강도60분" };

        List<string[]> list = new List<string[]>();
        list.Add(columns);
        Console.WriteLine("<!-- Start funcOpt10047 (체결강도추이일별요청) -->");
        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 funcOpt10047 (체결강도추이일별요청) -->");
    }
    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
일자 현재가 전일대비 전일대비기호 등락율 거래량 누적거래대금 누적거래량 체결강도 체결강도5분 체결강도20분 체결강도60분
20221007 -56200 -100 5 -0.18   949027 16886813 97.87      
20221006 +56300 +300 2 +0.54   848082 14944446 121.44      
20221005 +56000 +800 2 +1.45   1261934 22458970 89.15      
20221004 +55200 +2100 2 +3.95   1056853 19148435 126.31      
20220930 +53100 +500 2 +0.95   1187344 22503249 101.11      
20220929 -52600 -300 5 -0.57   737731 13882080 86.01      
20220928 -52900 -1300 5 -2.40   1064666 19991129 69.81      
20220927 +54200 +300 2 +0.56   897144 16631289 110.23      
20220926 -53900 -600 5 -1.10   807353 15008449 91.74      
20220923 +54500 +100 2 +0.18   575504 10555964 110.11      
20220922 -54400 -900 5 -1.63   696058 12786510 106.27      
20220921 -55300 -500 5 -0.90   655017 11863700 73.51      
20220920 -55800 -600 5 -1.06   788332 14041465 81.37      
20220919 +56400 +200 2 +0.36   693637 12278653 107.14      
20220916 +56200 +200 2 +0.36   752456 13456503 127.97      
20220915 -56000 -800 5 -1.41   657642 11664819 58.34      
20220914 -56800 -1300 5 -2.24   709906 12524961 135.63      
20220913 +58100 +2500 2 +4.50   991016 17166581 170.40      
20220908 -55600 -400 5 -0.71   1006366 18000016 88.15      
20220907 -56000 -1100 5 -1.93   975695 17384854 55.97      
20220906 57100 0 3 0.00   429152 7503086 86.25      
20220905 -57100 -400 5 -0.70   653884 11425977 85.05      
20220902 -57500 -900 5 -1.54   872040 15040310 60.07      
20220901 -58400 -1300 5 -2.18   872375 14905777 86.56      
20220831 +59700 +900 2 +1.53   841320 14203512 154.50      
20220830 +58800 +200 2 +0.34   567628 9690044 103.49      
20220829 -58600 -1400 5 -2.33   577684 9841329 116.08      
20220826 +60000 +300 2 +0.50   573040 9499995 90.91      
20220825 +59700 +700 2 +1.19   342781 5767902 111.88      
20220824 -59000 -100 5 -0.17   525407 8888486 95.05      
20220823 -59100 -900 5 -1.50   535657 9041629 61.21      
20220822 -60000 -900 5 -1.48   495732 8259865 83.52      
20220819 -60900 -600 5 -0.98   421909 6923679 105.75      
20220818 +61500 +1100 2 +1.82   997987 16372754 166.50      
20220817 -60400 -600 5 -0.98   550059 9061518 54.96      
20220816 +61000 +800 2 +1.33   917516 15036727 110.44      
20220812 +60200 +300 2 +0.50   648793 10786658 134.20      
20220811 +59900 +800 2 +1.35   903739 15141941 109.57      
20220810 -59100 -900 5 -1.50   1065593 18084349 105.98      
20220809 -60000 -800 5 -1.32   1094260 18251170 58.01      
20220808 -60800 -700 5 -1.14   689020 11313150 63.34      
20220805 61500 0 3 0.00   588583 9567620 94.46      
20220804 +61500 +200 2 +0.33   561836 9125439 86.84      
20220803 -61300 -400 5 -0.65   615481 10053861 79.72      
20220802 +61700 +400 2 +0.65   837567 13614895 106.50      
20220801 -61300 -100 5 -0.16   803035 13154816 81.79      
20220729 -61400 -500 5 -0.81   932918 15093120 66.44      
20220728 +61900 +100 2 +0.16   667085 10745302 84.83      
20220727 +61800 +100 2 +0.16   449990 7320997 86.60      
20220726 +61700 +600 2 +0.98   405310 6597211 161.80      
20220725 -61100 -200 5 -0.33   565540 9193681 113.49      
20220722 -61300 -500 5 -0.81   631873 10261310 79.18      
20220721 +61800 +1300 2 +2.15   754855 12291374 136.83      
20220720 -60500 -400 5 -0.66   1025939 16782238 61.31      
20220719 -60900 -1000 5 -1.62   925920 15248261 81.95      
20220718 +61900 +1900 2 +3.17   1277727 20832517 136.49      
20220715 +60000 +2500 2 +4.35   1104045 18685583 147.29      
20220714 -57500 -500 5 -0.86   869131 15067012 123.34      
20220713 -58000 -100 5 -0.17   631712 10841315 78.39      
20220712 -58100 -700 5 -1.19   544403 9336061 78.90      

 

키움 open-api TR 목록

728x90

댓글