148 lines
5.6 KiB
C#
148 lines
5.6 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace MMoneyCoderSharp.Data.Request.봉차트
|
|
{
|
|
internal class CandleKOSPI : ACandleData
|
|
{
|
|
public CandleKOSPI(DBDefine.봉차트세부종목 recvDataType, DBDefine.데이터기간 recvDataLength) : base(recvDataType, recvDataLength)
|
|
{
|
|
|
|
|
|
}
|
|
|
|
protected override void setQuery()
|
|
{
|
|
|
|
#region 예상지수
|
|
|
|
this.queryForecastToday = @"SELECT
|
|
'코스피 예상' NAME,
|
|
round(f_part_idx / 100, 2) part_idx,
|
|
f_chg_type chg_type,
|
|
ABS(round(f_part_chg / 100, 2)) part_chg,
|
|
round((f_part_chg / decode(f_chg_type, '+', f_part_idx - f_part_chg, '-', f_part_idx + f_part_chg, 1)) * 100, 2) rate
|
|
FROM t_fo_index
|
|
WHERE f_part_code = '001'";
|
|
|
|
this.queryForecastLast = @"select
|
|
F_DATA_DAY,
|
|
F_PART_CODE,
|
|
F_CHG_TYPE chg_type,
|
|
F_PART_CHG / 100 part_chg,
|
|
F_PART_HIGH_IDX / 100 part_high_idx,
|
|
F_PART_LOW_IDX / 100 part_low_idx,
|
|
F_PART_INIT_IDX / 100 part_init_idx,
|
|
F_PART_IDX / 100 part_idx,
|
|
F_PART_MA5_IDX / 100 part_ma5_idx,
|
|
F_PART_MA20_IDX / 100 part_ma20_idx
|
|
from (
|
|
select a.F_DATA_DAY, a.F_PART_CODE,
|
|
a.F_CHG_TYPE, a.F_PART_CHG,
|
|
a.F_PART_HIGH_IDX, a.F_PART_LOW_IDX, a.F_PART_INIT_IDX,
|
|
a.F_PART_IDX, a.F_PART_MA5_IDX, a.F_PART_MA20_IDX
|
|
from t_index_his_day a
|
|
where a.f_part_code = '001'
|
|
order by a.F_DATA_DAY desc
|
|
)
|
|
where rownum <= {0} order by F_DATA_DAY asc";
|
|
|
|
#endregion
|
|
|
|
#region 지수
|
|
|
|
this.queryIndexNow = @"SELECT
|
|
round(f_part_idx/100,2) part_idx,
|
|
f_chg_type chg_type,
|
|
round(f_part_chg/100,2) part_chg,
|
|
round((f_part_chg / decode(f_chg_type, '+', f_part_idx - f_part_chg, '-', f_part_idx + f_part_chg, 1)) * 100, 2) rate
|
|
FROM t_index
|
|
WHERE f_part_code = '001'";
|
|
|
|
this.queryIndexToday = @"select
|
|
a.F_DATA_DAY,
|
|
a.F_DATA_TIME,
|
|
a.F_PART_CODE,
|
|
a.F_CHG_TYPE chg_type,
|
|
a.F_PART_CHG / 100 part_chg,
|
|
a.F_PART_HIGH_IDX / 100 part_high_idx,
|
|
a.F_PART_LOW_IDX / 100 part_low_idx,
|
|
a.F_PART_INIT_IDX / 100 part_init_idx,
|
|
a.F_PART_IDX / 100 part_idx
|
|
from t_index_his_5M a
|
|
where a.f_part_code = '001'
|
|
and a.f_data_day = (select max(open_day) from v_open_day)
|
|
order by a.F_DATA_DAY, a.F_DATA_TIME";
|
|
|
|
this.queryIndexLast = @"select
|
|
F_DATA_DAY,
|
|
F_PART_CODE,
|
|
F_CHG_TYPE chg_type,
|
|
F_PART_CHG / 100 part_chg,
|
|
F_PART_HIGH_IDX / 100 part_high_idx, F_PART_LOW_IDX / 100 part_low_idx, F_PART_INIT_IDX / 100 part_init_idx,
|
|
F_PART_IDX / 100 part_idx, F_PART_MA5_IDX / 100 part_ma5_idx, F_PART_MA20_IDX / 100 part_ma20_idx
|
|
from (
|
|
select a.F_DATA_DAY, a.F_PART_CODE,
|
|
a.F_CHG_TYPE, a.F_PART_CHG,
|
|
a.F_PART_HIGH_IDX, a.F_PART_LOW_IDX, a.F_PART_INIT_IDX,
|
|
a.F_PART_IDX, a.F_PART_MA5_IDX, a.F_PART_MA20_IDX
|
|
from t_index_his_day a
|
|
where a.f_part_code = '001'
|
|
order by a.F_DATA_DAY desc
|
|
)
|
|
where rownum <= {0} order by F_DATA_DAY asc";
|
|
|
|
#endregion
|
|
|
|
#region 거래량
|
|
|
|
this.queryQuantityToday = @"select
|
|
a.F_DATA_DAY,
|
|
a.F_DATA_TIME,
|
|
a.F_PART_CODE,
|
|
a.F_CHG_TYPE chg_type,
|
|
a.F_PART_CHG / 100 part_chg,
|
|
a.F_PART_HIGH_IDX / 100 part_high_idx,
|
|
a.F_PART_LOW_IDX / 100 part_low_idx,
|
|
a.F_PART_INIT_IDX / 100 part_init_idx,
|
|
a.F_PART_IDX / 100 part_idx,
|
|
a.F_PART_VOL part_vol
|
|
from t_index_his_5M a
|
|
where a.f_part_code = '001'
|
|
and a.f_data_day = (select max(open_day) from v_open_day)
|
|
order by a.F_DATA_DAY, a.F_DATA_TIME";
|
|
|
|
|
|
this.queryQuantityLast = @"select
|
|
F_DATA_DAY,
|
|
F_PART_CODE,
|
|
F_CHG_TYPE chg_type,
|
|
F_PART_CHG / 100 part_chg,
|
|
F_PART_VOL part_vol,
|
|
F_PART_HIGH_IDX / 100 part_high_idx,
|
|
F_PART_LOW_IDX / 100 part_low_idx,
|
|
F_PART_INIT_IDX / 100 part_init_idx,
|
|
F_PART_IDX / 100 part_idx,
|
|
F_PART_MA5_IDX / 100 part_ma5_idx,
|
|
F_PART_MA20_IDX / 100 part_ma20_idx
|
|
from (
|
|
select a.F_DATA_DAY, a.F_PART_CODE,
|
|
a.F_CHG_TYPE, a.F_PART_CHG, a.f_part_vol,
|
|
a.F_PART_HIGH_IDX, a.F_PART_LOW_IDX, a.F_PART_INIT_IDX,
|
|
a.F_PART_IDX, a.F_PART_MA5_IDX, a.F_PART_MA20_IDX
|
|
from t_index_his_day a
|
|
where a.f_part_code = '001'
|
|
order by a.F_DATA_DAY desc
|
|
)
|
|
where rownum <= {0} order by F_DATA_DAY asc";
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
}
|
|
}
|