커뮤니티
오류수정 부탁
2019-06-29 12:08:57
160
글번호 129866
아래 시스템식에서 선업되지 않은 이름 i가 사용되었습니다. 라는 오류가 떠서 오류수정부탁 드립니다.
Input:n(5),미완성사용(True);
Var:j(0),k(0),고점표시(0),저점표시(0);
Array:고[20](0),저[20](0),고Bar[20](0),저Bar[20](0),
고idx[20](0),저idx[20](0);
#---------------------------------------------------------#
# Index()와 마찬가지로 1봉이 바뀔 때마다 1씩 증가
#---------------------------------------------------------#
for j = 1 to 19 {
저Bar[j] = 저Bar[j] + 1;
고Bar[j] = 고Bar[j] + 1;
고iDx[j] = I - 고Bar[j];
저idx[j] = I - 저Bar[j];
}
고점표시=(O[n]+C[n])/2;
저점표시=(O[n]+C[n])/2;
#=========================================================#
# 주처리 (Main Routine) 파동선 계산
#=========================================================#
# 전고점(Peak) 계산
#---------------------------------------------------------#
//Highest(H,2)[3] <= H[2] and H[2] > Highest(H,2)
if Highest(H,n)[n+1] <= H[n] and H[n] > Highest(H,n) then {
if 미완성사용 == True then {
for j = 18 downto 1 { //배열값을 순차적으로 바꿔준다
고[j+1] = 고[j];
고Bar[j+1] = 고Bar[j];
고idx[j+1] = 고idx[j];
}
고[1]= H[n];
고Bar[1] = n;
고idx[1] = I - 고Bar[1];
고점표시 = 고[1]*1.005;
if 저Bar[1] > 고Bar[2] then {
for j = 18 downto 1 {
저[j+1]= 저[j];
저Bar[j+1] = 저Bar[j];
저idx[j+1] = 저idx[j];
}
k = n + 1;
for j = n+ 2 to 고Bar[2]-1 {
if L[k] > L[j] then k = j;
}
저[1]= L[K];
저Bar[1] = k;
저idx[1] = i - 저Bar[1];
}
}
if 미완성사용 == False then {
if 고Bar[1] > 저Bar[1] then {
for j = 18 downto 1 {
고[j+1] = 고[j];
고Bar[j+1] = 고Bar[j];
고Idx[j+1] = 고Idx[j];
}
}
if 고Bar[1] > 저Bar[1] or 고[1] <= H[n] then {
고[1]= H[n];
고Bar[1] = n;
고Idx[1] = i -고Bar[1];
고점표시 = 고[1]*1.005;
}
}
}
if Lowest(L,n)[n+1] >= L[n] and L[n] < Lowest(L,n) then {
if 미완성사용 == True then {
for j = 18 downto 1 {
저[j+1] = 저[j];
저Bar[j+1] = 저Bar[j];
저Idx[j+1] = 저Idx[j];
}
저[1]= L[n];
저Bar[1] = n;
저Idx[1] = i - 저Bar[1];
저점표시 = 저[1]*0.995;
if 고Bar[1] > 저Bar[2] then {
for j = 18 downto 1 {
고[j+1]= 고[j];
고Bar[j+1] = 고Bar[j];
고Idx[j+1] = 고Idx[j];
}
k = n + 1;
for j = n + 2 to 저Bar[2]-1 {
if H[k] < H[j] then k = j;
}
고[1]= H[k];
고Bar[1] = k;
고Idx[1] = i - 고Bar[1];
}
}
if 미완성사용 == False then {
if 저Bar[1] > 고Bar[1] then {
for j = 18 downto 1 {
저[j+1]= 저[j];
저Bar[j+1] = 저Bar[j];
저Idx[j+1] = 저Idx[j];
}
}
if 저Bar[1] > 고Bar[1] or 저[1] >= L[n] then {
저[1]= L[n];
저Bar[1] = n;
저Idx[1] = i - 저Bar[1];
저점표시 = 저[1]*0.995;
}
}
}
if 고점표시 > H[n] then Plot1(고점표시,"전고점",RED);
if 저점표시 < L[n] then Plot2(저점표시,"전저점",BLUE);
if 고Bar[1]==n and 고[1] > 0 then Plot3(고[1]);
if 저Bar[1]==n and 저[1] > 0 then Plot3(저[1]);
if 저Bar[1]==n and 저[1] > 0 then Plot4(저[1]);
if 고Bar[1]==n and 고[1] > 0 then Plot4(고[1]);
답변 1
예스스탁 예스스탁 답변
2019-07-01 10:38:39
안녕하세요
예스스탁입니다.
Input:n(5),미완성사용(True);
Var:j(0),k(0),고점표시(0),저점표시(0);
Array:고[20](0),저[20](0),고Bar[20](0),저Bar[20](0),
고idx[20](0),저idx[20](0);
#---------------------------------------------------------#
# Index()와 마찬가지로 1봉이 바뀔 때마다 1씩 증가
#---------------------------------------------------------#
for j = 1 to 19 {
저Bar[j] = 저Bar[j] + 1;
고Bar[j] = 고Bar[j] + 1;
고iDx[j] = Index - 고Bar[j];
저idx[j] = Index - 저Bar[j];
}
고점표시=(O[n]+C[n])/2;
저점표시=(O[n]+C[n])/2;
#=========================================================#
# 주처리 (Main Routine) 파동선 계산
#=========================================================#
# 전고점(Peak) 계산
#---------------------------------------------------------#
//Highest(H,2)[3] <= H[2] and H[2] > Highest(H,2)
if Highest(H,n)[n+1] <= H[n] and H[n] > Highest(H,n) then {
if 미완성사용 == True then {
for j = 18 downto 1 { //배열값을 순차적으로 바꿔준다
고[j+1] = 고[j];
고Bar[j+1] = 고Bar[j];
고idx[j+1] = 고idx[j];
}
고[1]= H[n];
고Bar[1] = n;
고idx[1] = Index - 고Bar[1];
고점표시 = 고[1]*1.005;
if 저Bar[1] > 고Bar[2] then {
for j = 18 downto 1 {
저[j+1]= 저[j];
저Bar[j+1] = 저Bar[j];
저idx[j+1] = 저idx[j];
}
k = n + 1;
for j = n+ 2 to 고Bar[2]-1 {
if L[k] > L[j] then k = j;
}
저[1]= L[K];
저Bar[1] = k;
저idx[1] = Index - 저Bar[1];
}
}
if 미완성사용 == False then {
if 고Bar[1] > 저Bar[1] then {
for j = 18 downto 1 {
고[j+1] = 고[j];
고Bar[j+1] = 고Bar[j];
고Idx[j+1] = 고Idx[j];
}
}
if 고Bar[1] > 저Bar[1] or 고[1] <= H[n] then {
고[1]= H[n];
고Bar[1] = n;
고Idx[1] = Index -고Bar[1];
고점표시 = 고[1]*1.005;
}
}
}
if Lowest(L,n)[n+1] >= L[n] and L[n] < Lowest(L,n) then {
if 미완성사용 == True then {
for j = 18 downto 1 {
저[j+1] = 저[j];
저Bar[j+1] = 저Bar[j];
저Idx[j+1] = 저Idx[j];
}
저[1]= L[n];
저Bar[1] = n;
저Idx[1] = Index - 저Bar[1];
저점표시 = 저[1]*0.995;
if 고Bar[1] > 저Bar[2] then {
for j = 18 downto 1 {
고[j+1]= 고[j];
고Bar[j+1] = 고Bar[j];
고Idx[j+1] = 고Idx[j];
}
k = n + 1;
for j = n + 2 to 저Bar[2]-1 {
if H[k] < H[j] then k = j;
}
고[1]= H[k];
고Bar[1] = k;
고Idx[1] = Index - 고Bar[1];
}
}
if 미완성사용 == False then {
if 저Bar[1] > 고Bar[1] then {
for j = 18 downto 1 {
저[j+1]= 저[j];
저Bar[j+1] = 저Bar[j];
저Idx[j+1] = 저Idx[j];
}
}
if 저Bar[1] > 고Bar[1] or 저[1] >= L[n] then {
저[1]= L[n];
저Bar[1] = n;
저Idx[1] = Index - 저Bar[1];
저점표시 = 저[1]*0.995;
}
}
}
if 고점표시 > H[n] then Plot1(고점표시,"전고점",RED);
if 저점표시 < L[n] then Plot2(저점표시,"전저점",BLUE);
if 고Bar[1]==n and 고[1] > 0 then Plot3(고[1]);
if 저Bar[1]==n and 저[1] > 0 then Plot3(저[1]);
if 저Bar[1]==n and 저[1] > 0 then Plot4(저[1]);
if 고Bar[1]==n and 고[1] > 0 then Plot4(고[1]);
즐거운 하루되세요
> 이대표 님이 쓴 글입니다.
> 제목 : 오류수정 부탁
> 아래 시스템식에서 선업되지 않은 이름 i가 사용되었습니다. 라는 오류가 떠서 오류수정부탁 드립니다.
Input:n(5),미완성사용(True);
Var:j(0),k(0),고점표시(0),저점표시(0);
Array:고[20](0),저[20](0),고Bar[20](0),저Bar[20](0),
고idx[20](0),저idx[20](0);
#---------------------------------------------------------#
# Index()와 마찬가지로 1봉이 바뀔 때마다 1씩 증가
#---------------------------------------------------------#
for j = 1 to 19 {
저Bar[j] = 저Bar[j] + 1;
고Bar[j] = 고Bar[j] + 1;
고iDx[j] = I - 고Bar[j];
저idx[j] = I - 저Bar[j];
}
고점표시=(O[n]+C[n])/2;
저점표시=(O[n]+C[n])/2;
#=========================================================#
# 주처리 (Main Routine) 파동선 계산
#=========================================================#
# 전고점(Peak) 계산
#---------------------------------------------------------#
//Highest(H,2)[3] <= H[2] and H[2] > Highest(H,2)
if Highest(H,n)[n+1] <= H[n] and H[n] > Highest(H,n) then {
if 미완성사용 == True then {
for j = 18 downto 1 { //배열값을 순차적으로 바꿔준다
고[j+1] = 고[j];
고Bar[j+1] = 고Bar[j];
고idx[j+1] = 고idx[j];
}
고[1]= H[n];
고Bar[1] = n;
고idx[1] = I - 고Bar[1];
고점표시 = 고[1]*1.005;
if 저Bar[1] > 고Bar[2] then {
for j = 18 downto 1 {
저[j+1]= 저[j];
저Bar[j+1] = 저Bar[j];
저idx[j+1] = 저idx[j];
}
k = n + 1;
for j = n+ 2 to 고Bar[2]-1 {
if L[k] > L[j] then k = j;
}
저[1]= L[K];
저Bar[1] = k;
저idx[1] = i - 저Bar[1];
}
}
if 미완성사용 == False then {
if 고Bar[1] > 저Bar[1] then {
for j = 18 downto 1 {
고[j+1] = 고[j];
고Bar[j+1] = 고Bar[j];
고Idx[j+1] = 고Idx[j];
}
}
if 고Bar[1] > 저Bar[1] or 고[1] <= H[n] then {
고[1]= H[n];
고Bar[1] = n;
고Idx[1] = i -고Bar[1];
고점표시 = 고[1]*1.005;
}
}
}
if Lowest(L,n)[n+1] >= L[n] and L[n] < Lowest(L,n) then {
if 미완성사용 == True then {
for j = 18 downto 1 {
저[j+1] = 저[j];
저Bar[j+1] = 저Bar[j];
저Idx[j+1] = 저Idx[j];
}
저[1]= L[n];
저Bar[1] = n;
저Idx[1] = i - 저Bar[1];
저점표시 = 저[1]*0.995;
if 고Bar[1] > 저Bar[2] then {
for j = 18 downto 1 {
고[j+1]= 고[j];
고Bar[j+1] = 고Bar[j];
고Idx[j+1] = 고Idx[j];
}
k = n + 1;
for j = n + 2 to 저Bar[2]-1 {
if H[k] < H[j] then k = j;
}
고[1]= H[k];
고Bar[1] = k;
고Idx[1] = i - 고Bar[1];
}
}
if 미완성사용 == False then {
if 저Bar[1] > 고Bar[1] then {
for j = 18 downto 1 {
저[j+1]= 저[j];
저Bar[j+1] = 저Bar[j];
저Idx[j+1] = 저Idx[j];
}
}
if 저Bar[1] > 고Bar[1] or 저[1] >= L[n] then {
저[1]= L[n];
저Bar[1] = n;
저Idx[1] = i - 저Bar[1];
저점표시 = 저[1]*0.995;
}
}
}
if 고점표시 > H[n] then Plot1(고점표시,"전고점",RED);
if 저점표시 < L[n] then Plot2(저점표시,"전저점",BLUE);
if 고Bar[1]==n and 고[1] > 0 then Plot3(고[1]);
if 저Bar[1]==n and 저[1] > 0 then Plot3(저[1]);
if 저Bar[1]==n and 저[1] > 0 then Plot4(저[1]);
if 고Bar[1]==n and 고[1] > 0 then Plot4(고[1]);
다음글
이전글