커뮤니티
기간이 150이상에 대하여 nthlowestbar nthhighestbar
2017-12-26 11:13:23
174
글번호 115251
기간이 150이상에 대하여 그리고 한번에 1번째부터 5번째 이상의 bar를 추출 적용할수 있는 nthlowestbar nthhighestbar의 식을 부탁드립니다. 기간과 bar추출갯수를 임의로 선택할수 있게 부탁드려요
답변 1
예스스탁 예스스탁 답변
2017-12-27 14:03:06
안녕하세요
예스스탁입니다.
Var : cnt(0),i1(0),i2(0),tempmax(0),tempmaxindex(0),tempmin(0),tempminindex(0);
Array : V1[150](0),V2[150](0),NthHighBar[150](0),NthLowBar[150](0);
//데이터는 모두 배열변수에 저장
for cnt = 0 to 149{
v1[cnt] = H[cnt];
v2[cnt] = L[cnt];
}
for i1 = 1 to 10 //nth 갯수
{
tempmax = -999999999;
tempmin = 999999999;
for i2 = 0 to 149 //비교 데이터 갯수
{
if (V1[i2] > tempmax ) then
{
tempmax = v1[i2];
tempmaxIndex = i2;
}
if (V2[i2] < tempmin ) then
{
tempmin = v2[i2];
tempminIndex = i2;
}
}
NthHighBar[i1] = tempmaxIndex;
V1[tempmaxIndex] = -999999999;
NthLowBar[i1] = tempminIndex;
V2[tempminIndex] = 999999999;
}
즐거운 하루되세요
> 이지화 님이 쓴 글입니다.
> 제목 : 기간이 150이상에 대하여 nthlowestbar nthhighestbar
> 기간이 150이상에 대하여 그리고 한번에 1번째부터 5번째 이상의 bar를 추출 적용할수 있는 nthlowestbar nthhighestbar의 식을 부탁드립니다. 기간과 bar추출갯수를 임의로 선택할수 있게 부탁드려요