커뮤니티
항셍관련지표2
2019-04-18 14:14:51
226
글번호 127958
안녕하세요 관리자님!!
아래서식은 관리자님이 작성해주신 수식인데 차트에 실행하니 선이 표현이 안됩니다.
기간을 극단적으로 줄여도 나오질 않습니다. 다시한번 검토 부탁드립니다.
- 아 래 -
input : P(520);
var : OO(0),CC(0),ww(0),cnt(0);
var : sum(0),mav(0),sumsqrt(0),stdv(0);
Array : W1[600](0),W2[600](0),W3[600](0),W4[600](0),W5[600](0);
if (sdate != sdate[1] and stime >= 101500) or
(sdate == sdate[1] and stime >= 101500 and stime[1] < 101500) Then
{
ww = DayOfWeek(sdate);
OO = O;
if ww == 1 then
{
for cnt = 1 to 599
{
W1[cnt] = W1[cnt-1][1];
}
}
if ww == 21 then
{
for cnt = 1 to 599
{
W2[cnt] = W1[cnt-1][1];
}
}
if ww == 3 then
{
for cnt = 1 to 599
{
W3[cnt] = W1[cnt-1][1];
}
}
if ww == 4 then
{
for cnt = 1 to 599
{
W4[cnt] = W1[cnt-1][1];
}
}
if ww == 5 then
{
for cnt = 1 to 599
{
W5[cnt] = W1[cnt-1][1];
}
}
}
if stime >= 101500 or stime <= 20000 Then
CC = C;
if ww == 1 Then
{
W1[0] = OO-CC;
if W1[p] > 0 then
{
sum = 0;
for cnt = 0 to P-1
{
sum = sum + W1[cnt];
}
mav = sum/P;
SumSqrt = 0;
For cnt = 0 To P - 1
{
SumSqrt = SumSqrt + (W1[cnt]-mav)^2;
}
Stdv = SquareRoot(SumSqrt / P);
plot1(mav);
plot2(mav+stdv*2);
plot3(mav+stdv*1);
plot4(mav-stdv*1);
plot5(mav-stdv*2);
}
}
if ww == 2 Then
{
W2[0] = OO-CC;
W1[0] = OO-CC;
if W2[p] > 0 then
{
sum = 0;
for cnt = 0 to P-1
{
sum = sum + W2[cnt];
}
mav = sum/P;
SumSqrt = 0;
For cnt = 0 To P - 1
{
SumSqrt = SumSqrt + (W2[cnt]-mav)^2;
}
Stdv = SquareRoot(SumSqrt / P);
plot1(mav);
plot2(mav+stdv*2);
plot3(mav+stdv*1);
plot4(mav-stdv*1);
plot5(mav-stdv*2);
}
}
if ww == 3 Then
{
W3[0] = OO-CC;
if W3[p] > 0 then
{
sum = 0;
for cnt = 0 to P-1
{
sum = sum + W3[cnt];
}
mav = sum/P;
SumSqrt = 0;
For cnt = 0 To P - 1
{
SumSqrt = SumSqrt + (W3[cnt]-mav)^2;
}
Stdv = SquareRoot(SumSqrt / P);
plot1(mav);
plot2(mav+stdv*2);
plot3(mav+stdv*1);
plot4(mav-stdv*1);
plot5(mav-stdv*2);
}
}
if ww == 4 Then
{
W4[0] = OO-CC;
if W4[p] > 0 then
{
sum = 0;
for cnt = 0 to P-1
{
sum = sum + W4[cnt];
}
mav = sum/P;
SumSqrt = 0;
For cnt = 0 To P - 1
{
SumSqrt = SumSqrt + (W4[cnt]-mav)^2;
}
Stdv = SquareRoot(SumSqrt / P);
plot1(mav);
plot2(mav+stdv*2);
plot3(mav+stdv*1);
plot4(mav-stdv*1);
plot5(mav-stdv*2);
}
}
if ww == 5 Then
{
W5[0] = OO-CC;
if W5[p] > 0 then
{
sum = 0;
for cnt = 0 to P-1
{
sum = sum + W5[cnt];
}
mav = sum/P;
SumSqrt = 0;
For cnt = 0 To P - 1
{
SumSqrt = SumSqrt + (W5[cnt]-mav)^2;
}
Stdv = SquareRoot(SumSqrt / P);
plot1(mav);
plot2(mav+stdv*2);
plot3(mav+stdv*1);
plot4(mav-stdv*1);
plot5(mav-stdv*2);
}
}
답변 1
예스스탁 예스스탁 답변
2019-04-19 09:40:51
안녕하세요
예스스탁입니다.
식을 수정했습니다.
input : P(520);
var : OO(0),CC(0),ww(0),cnt(0);
var : sum(0),mav(0),sumsqrt(0),stdv(0);
Array : W1[600](-9999999),W2[600](-9999999),W3[600](-9999999),W4[600](-9999999),W5[600](-9999999);
if (sdate != sdate[1] and stime >= 101500) or
(sdate == sdate[1] and stime >= 101500 and stime[1] < 101500) Then
{
ww = DayOfWeek(sdate);
TL_new(sdate,stime,999999999,sdate,stime,0);
OO = O;
if ww == 1 then
{
for cnt = 1 to 599
{
W1[cnt] = W1[cnt-1][1];
}
}
if ww == 2 then
{
for cnt = 1 to 599
{
W2[cnt] = W1[cnt-1][1];
}
}
if ww == 3 then
{
for cnt = 1 to 599
{
W3[cnt] = W1[cnt-1][1];
}
}
if ww == 4 then
{
for cnt = 1 to 599
{
W4[cnt] = W1[cnt-1][1];
}
}
if ww == 5 then
{
for cnt = 1 to 599
{
W5[cnt] = W1[cnt-1][1];
}
}
}
if stime >= 101500 or stime <= 20000 Then
CC = C;
if ww == 1 Then
{
W1[0] = OO-CC;
if W1[p] != -9999999 then
{
sum = 0;
for cnt = 0 to P-1
{
sum = sum + W1[cnt];
}
mav = sum/P;
SumSqrt = 0;
For cnt = 0 To P - 1
{
SumSqrt = SumSqrt + (W1[cnt]-mav)^2;
}
Stdv = SquareRoot(SumSqrt / P);
plot1(mav);
plot2(mav+stdv*2);
plot3(mav+stdv*1);
plot4(mav-stdv*1);
plot5(mav-stdv*2);
}
}
if ww == 2 Then
{
W2[0] = OO-CC;
if W2[p] != -9999999 then
{
sum = 0;
for cnt = 0 to P-1
{
sum = sum + W2[cnt];
}
mav = sum/P;
SumSqrt = 0;
For cnt = 0 To P - 1
{
SumSqrt = SumSqrt + (W2[cnt]-mav)^2;
}
Stdv = SquareRoot(SumSqrt / P);
plot1(mav);
plot2(mav+stdv*2);
plot3(mav+stdv*1);
plot4(mav-stdv*1);
plot5(mav-stdv*2);
}
}
if ww == 3 Then
{
W3[0] = OO-CC;
if W3[p] != -9999999 then
{
sum = 0;
for cnt = 0 to P-1
{
sum = sum + W3[cnt];
}
mav = sum/P;
SumSqrt = 0;
For cnt = 0 To P - 1
{
SumSqrt = SumSqrt + (W3[cnt]-mav)^2;
}
Stdv = SquareRoot(SumSqrt / P);
plot1(mav);
plot2(mav+stdv*2);
plot3(mav+stdv*1);
plot4(mav-stdv*1);
plot5(mav-stdv*2);
}
}
if ww == 4 Then
{
W4[0] = OO-CC;
if W4[p] != -9999999 then
{
sum = 0;
for cnt = 0 to P-1
{
sum = sum + W4[cnt];
}
mav = sum/P;
SumSqrt = 0;
For cnt = 0 To P - 1
{
SumSqrt = SumSqrt + (W4[cnt]-mav)^2;
}
Stdv = SquareRoot(SumSqrt / P);
plot1(mav);
plot2(mav+stdv*2);
plot3(mav+stdv*1);
plot4(mav-stdv*1);
plot5(mav-stdv*2);
}
}
if ww == 5 Then
{
W5[0] = OO-CC;
if W5[p] != -9999999 then
{
sum = 0;
for cnt = 0 to P-1
{
sum = sum + W5[cnt];
}
mav = sum/P;
SumSqrt = 0;
For cnt = 0 To P - 1
{
SumSqrt = SumSqrt + (W5[cnt]-mav)^2;
}
Stdv = SquareRoot(SumSqrt / P);
plot1(mav);
plot2(mav+stdv*2);
plot3(mav+stdv*1);
plot4(mav-stdv*1);
plot5(mav-stdv*2);
}
}
즐거운 하루되세요
> 카카 님이 쓴 글입니다.
> 제목 : 항셍관련지표2
> 안녕하세요 관리자님!!
아래서식은 관리자님이 작성해주신 수식인데 차트에 실행하니 선이 표현이 안됩니다.
기간을 극단적으로 줄여도 나오질 않습니다. 다시한번 검토 부탁드립니다.
- 아 래 -
input : P(520);
var : OO(0),CC(0),ww(0),cnt(0);
var : sum(0),mav(0),sumsqrt(0),stdv(0);
Array : W1[600](0),W2[600](0),W3[600](0),W4[600](0),W5[600](0);
if (sdate != sdate[1] and stime >= 101500) or
(sdate == sdate[1] and stime >= 101500 and stime[1] < 101500) Then
{
ww = DayOfWeek(sdate);
OO = O;
if ww == 1 then
{
for cnt = 1 to 599
{
W1[cnt] = W1[cnt-1][1];
}
}
if ww == 21 then
{
for cnt = 1 to 599
{
W2[cnt] = W1[cnt-1][1];
}
}
if ww == 3 then
{
for cnt = 1 to 599
{
W3[cnt] = W1[cnt-1][1];
}
}
if ww == 4 then
{
for cnt = 1 to 599
{
W4[cnt] = W1[cnt-1][1];
}
}
if ww == 5 then
{
for cnt = 1 to 599
{
W5[cnt] = W1[cnt-1][1];
}
}
}
if stime >= 101500 or stime <= 20000 Then
CC = C;
if ww == 1 Then
{
W1[0] = OO-CC;
if W1[p] > 0 then
{
sum = 0;
for cnt = 0 to P-1
{
sum = sum + W1[cnt];
}
mav = sum/P;
SumSqrt = 0;
For cnt = 0 To P - 1
{
SumSqrt = SumSqrt + (W1[cnt]-mav)^2;
}
Stdv = SquareRoot(SumSqrt / P);
plot1(mav);
plot2(mav+stdv*2);
plot3(mav+stdv*1);
plot4(mav-stdv*1);
plot5(mav-stdv*2);
}
}
if ww == 2 Then
{
W2[0] = OO-CC;
W1[0] = OO-CC;
if W2[p] > 0 then
{
sum = 0;
for cnt = 0 to P-1
{
sum = sum + W2[cnt];
}
mav = sum/P;
SumSqrt = 0;
For cnt = 0 To P - 1
{
SumSqrt = SumSqrt + (W2[cnt]-mav)^2;
}
Stdv = SquareRoot(SumSqrt / P);
plot1(mav);
plot2(mav+stdv*2);
plot3(mav+stdv*1);
plot4(mav-stdv*1);
plot5(mav-stdv*2);
}
}
if ww == 3 Then
{
W3[0] = OO-CC;
if W3[p] > 0 then
{
sum = 0;
for cnt = 0 to P-1
{
sum = sum + W3[cnt];
}
mav = sum/P;
SumSqrt = 0;
For cnt = 0 To P - 1
{
SumSqrt = SumSqrt + (W3[cnt]-mav)^2;
}
Stdv = SquareRoot(SumSqrt / P);
plot1(mav);
plot2(mav+stdv*2);
plot3(mav+stdv*1);
plot4(mav-stdv*1);
plot5(mav-stdv*2);
}
}
if ww == 4 Then
{
W4[0] = OO-CC;
if W4[p] > 0 then
{
sum = 0;
for cnt = 0 to P-1
{
sum = sum + W4[cnt];
}
mav = sum/P;
SumSqrt = 0;
For cnt = 0 To P - 1
{
SumSqrt = SumSqrt + (W4[cnt]-mav)^2;
}
Stdv = SquareRoot(SumSqrt / P);
plot1(mav);
plot2(mav+stdv*2);
plot3(mav+stdv*1);
plot4(mav-stdv*1);
plot5(mav-stdv*2);
}
}
if ww == 5 Then
{
W5[0] = OO-CC;
if W5[p] > 0 then
{
sum = 0;
for cnt = 0 to P-1
{
sum = sum + W5[cnt];
}
mav = sum/P;
SumSqrt = 0;
For cnt = 0 To P - 1
{
SumSqrt = SumSqrt + (W5[cnt]-mav)^2;
}
Stdv = SquareRoot(SumSqrt / P);
plot1(mav);
plot2(mav+stdv*2);
plot3(mav+stdv*1);
plot4(mav-stdv*1);
plot5(mav-stdv*2);
}
}