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

func-GetOptionCode(지수옵션 종목코드를 반환)

by hyunsoft 2022. 10. 12.

func-GetOptionCode(지수옵션 종목코드를 반환)

  • Code Sample
private void funcGetOptionCode() {
    string strActPrice = "260.0";	// – 행사가(소수점포함)
    int nCp = 2;					//– 콜풋구분 2:콜, 3:풋
    string strMonth = "202210";		//– 월물(6자리)

    string result = axKHOpenAPI.GetOptionCode(strActPrice, nCp, strMonth);

    string[] columns = new string[] { "지수옵션 월물 리스트" };
    string[] row = new string[] { result };
    List<string[]> list = new List<string[]>();
    list.Add(columns);
    list.Add(row);

   PrintHtmlTable(list);
}

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);
}

 

  • RESPONSE Data Sample
지수옵션 월물 리스트
301SC150

 

키움증권 open-api 기본 함수 목록

728x90

댓글