Beispiel #1
0
    public static string get_chart_graphic(string sTitle, int w, int h, CHART_TYPE type, string sHaxis, string sVaxis)
    {
        StringBuilder sb = new StringBuilder();

        sb.Append("{");

        sb.Append("'chart_graphic':");
        // sb.Append("[");

        sb.Append("{");
        sb.Append("'w': '" + w.ToString() + "',");
        sb.Append("'h': '" + h.ToString() + "',");
        sb.Append("'type': '" + type.ToString() + "',");
        sb.Append("'title': '" + sTitle + "',");
        sb.Append("'h_axis': '" + sHaxis + "',");
        sb.Append("'v_axis': '" + sVaxis + "'");
        sb.Append("}");

        // sb.Append("]");
        sb.Append("}");

        string sRetVal = sb.ToString().Replace("'", "\"");

        return(sRetVal);
    }
Beispiel #2
0
        private List <ChartData> CreateMany(string label, CHART_TYPE type, int length)
        {
            List <ChartData> list = new List <ChartData>();

            for (int i = 0; i < length; i++)
            {
                list.Add(new ChartData()
                {
                    Id        = RandomNumber(0, Int32.MaxValue),
                    Label     = label,
                    TipoChart = type,
                    Value     = RandomNumber(0, 100)
                });
            }
            return(list);
        }
Beispiel #3
0
        public void RequestItem(string ItemCode, ReceiveAfter delFunc, CHART_TYPE typeChart = CHART_TYPE.TICK_30)
        {
            if (!string.IsNullOrEmpty(ItemCode))
            {
                afterEventFunction        = delFunc;
                chartItemCodeTextBox.Text = ItemCode;
                ItemName.Text             = axKHOpenAPI1.GetMasterCodeName(ItemCode);

                switch (typeChart)
                {
                case  CHART_TYPE.TICK_30:
                    Task requestItemInfoTask = new Task(() =>
                    {
                        axKHOpenAPI1.SetInputValue("종목코드", ItemCode);
                        axKHOpenAPI1.SetInputValue("틱범위", "30");
                        axKHOpenAPI1.SetInputValue("수정주가구분", "0");
                        int result = axKHOpenAPI1.CommRqData(ConstName.RECEIVE_TR_DATA_TICK_CHART + ":" + screenNumber, "opt10079", 0, "1080");
                        if (result != ErrorCode.정상처리)
                        {
                            Core.CoreEngine.GetInstance().SendLogErrorMessage("ERROR : " + result.ToString());
                        }
                    });
                    Core.CoreEngine.GetInstance().requestTrDataManager.RequestTrData(requestItemInfoTask);
                    break;

                case CHART_TYPE.MINUTE_5:
                    Task requestItemInfoTaskMinute = new Task(() =>
                    {
                        axKHOpenAPI1.SetInputValue("종목코드", ItemCode);
                        axKHOpenAPI1.SetInputValue("틱범위", "5");
                        axKHOpenAPI1.SetInputValue("수정주가구분", "0");
                        int result = axKHOpenAPI1.CommRqData(ConstName.RECEIVE_TR_DATA_MINUTE_CHART + ":" + screenNumber, "opt10080", 0, "1080");
                        if (result != ErrorCode.정상처리)
                        {
                            Core.CoreEngine.GetInstance().SendLogErrorMessage("ERROR : " + result.ToString());
                        }
                    });
                    Core.CoreEngine.GetInstance().requestTrDataManager.RequestTrData(requestItemInfoTaskMinute);
                    break;

                default:
                    break;
                }
            }
        }
Beispiel #4
0
        public void RequestKosdap(ReceiveAfter delFunc, CHART_TYPE typeChart = CHART_TYPE.MINUTE_5)
        {
            refreshCheck.Checked = true;
            afterEventFunction   = delFunc;
            ItemName.Text        = "코스닥지수";
            Task requestItemInfoTask = new Task(() =>
            {
                axKHOpenAPI1.SetInputValue("업종코드", "101");
                axKHOpenAPI1.SetInputValue("틱범위", "5:5분");
                axKHOpenAPI1.SetInputValue("수정주가구분", "1");

                int result = axKHOpenAPI1.CommRqData(ConstName.RECEIVE_TR_DATA_KOSPI_MINUTE_CHART + ":" + screenNumber, "OPT20005", 0, "1080");
                if (result != ErrorCode.정상처리)
                {
                    Core.CoreEngine.GetInstance().SendLogErrorMessage("ERROR : " + result.ToString());
                }
            });

            Core.CoreEngine.GetInstance().requestTrDataManager.RequestTrData(requestItemInfoTask);
            KospiInfo info = new KospiInfo();

            UpDownInfoText.Text = info.GetStockKosdaq();
        }
    public static string get_chart_graphic(string sTitle, int w, int h, CHART_TYPE type, string sHaxis, string sVaxis)
    {
        StringBuilder sb = new StringBuilder();

        sb.Append("{");

        sb.Append("'chart_graphic':");
        // sb.Append("[");

        sb.Append("{");
        sb.Append("'w': '" + w.ToString() + "',");
        sb.Append("'h': '" + h.ToString() + "',");
        sb.Append("'type': '" + type.ToString() + "',");
        sb.Append("'title': '" + sTitle + "',");
        sb.Append("'h_axis': '" + sHaxis + "',");
        sb.Append("'v_axis': '" + sVaxis + "'");
        sb.Append("}");

        // sb.Append("]");
        sb.Append("}");

        string sRetVal = sb.ToString().Replace("'", "\"");

        return sRetVal;
    }
Beispiel #6
0
 private void Tick_5_minute_CheckedChanged(object sender, EventArgs e)
 {
     curTypeChart = CHART_TYPE.MINUTE_5;
 }
Beispiel #7
0
 private void Tick_30_tick_CheckedChanged(object sender, EventArgs e)
 {
     curTypeChart = CHART_TYPE.TICK_30;
 }