예스스탁
예스스탁 답변
2020-06-15 17:44:48
안녕하세요
예스스탁입니다.
15분봉 차트에서 5분봉은 계산을 할수 없습니다.
수식으로 타주기는 차트의 주기보다 배수로 큰 경우에만 계산이 가능합니다.
차트에 적용하시면 기본차트 주기 볼밴과 타주기 5개를 그리게 작성된 식입니다.
input : P(20),Dv(2);
input : ntime1(15),ntime2(30),ntime3(60),ntime4(120),ntime5(400);
var : bbmd(0),bbdn(0),bbup(0);
var : cnt(0),S1(0),D1(0),TM(0),TF1(0),TF2(0),TF3(0),TF4(0),TF5(0);
var : SumSqrt1(0),Stdv1(0),sum1(0),BBmd1(0),Bbup1(0),BBdn1(0);
var : SumSqrt2(0),Stdv2(0),sum2(0),BBmd2(0),Bbup2(0),BBdn2(0);
var : SumSqrt3(0),Stdv3(0),sum3(0),BBmd3(0),Bbup3(0),BBdn3(0);
var : SumSqrt4(0),Stdv4(0),sum4(0),BBmd4(0),Bbup4(0),BBdn4(0);
var : SumSqrt5(0),Stdv5(0),sum5(0),BBmd5(0),Bbup5(0),BBdn5(0);
Array : C1[100](0),C2[100](0),C3[100](0),C4[100](0),C5[100](0);
bbmd = ma(C,P);
bbup = BollBandUp(P,dv);
bbdn = BollBandDown(P,dv);
plot1(bbmd,"중단",RED);
plot2(bbup,"상단",RED);
plot3(bbdn,"하단",RED);
if Bdate != Bdate[1] Then
{
S1 = TimeToMinutes(stime);
D1 = sdate;
}
if D1 > 0 then
{
if sdate == D1 Then
TM = TimeToMinutes(stime)-S1;
Else
TM = TimeToMinutes(stime)+1440-S1;
TF1 = TM%ntime1;
TF2 = TM%ntime2;
TF3 = TM%ntime3;
TF4 = TM%ntime4;
TF5 = TM%ntime5;
if Bdate != Bdate[1] or
(Bdate == Bdate[1] and ntime1 > 1 and TF1 < TF1[1]) or
(Bdate == Bdate[1] and ntime1 > 1 and TM >= TM[1]+ntime1) or
(Bdate == Bdate[1] and ntime1 == 1 and TM > TM[1]) Then
{
for cnt = 1 to 99
{
C1[cnt] = C1[cnt-1][1];
}
}
C1[0] = C;
if Bdate != Bdate[1] or
(Bdate == Bdate[1] and ntime2 > 1 and TF2 < TF2[1]) or
(Bdate == Bdate[1] and ntime2 > 1 and TM >= TM[1]+ntime2) or
(Bdate == Bdate[1] and ntime2 == 1 and TM > TM[1]) Then
{
for cnt = 1 to 99
{
C2[cnt] = C2[cnt-1][1];
}
}
C2[0] = C;
if Bdate != Bdate[1] or
(Bdate == Bdate[1] and ntime3 > 1 and TF3 < TF3[1]) or
(Bdate == Bdate[1] and ntime3 > 1 and TM >= TM[1]+ntime3) or
(Bdate == Bdate[1] and ntime3 == 1 and TM > TM[1]) Then
{
for cnt = 1 to 99
{
C3[cnt] = C3[cnt-1][1];
}
}
C3[0] = C;
if Bdate != Bdate[1] or
(Bdate == Bdate[1] and ntime4 > 1 and TF4 < TF4[1]) or
(Bdate == Bdate[1] and ntime4 > 1 and TM >= TM[1]+ntime4) or
(Bdate == Bdate[1] and ntime4 == 1 and TM > TM[1]) Then
{
for cnt = 1 to 99
{
C4[cnt] = C4[cnt-1][1];
}
}
C4[0] = C;
if Bdate != Bdate[1] or
(Bdate == Bdate[1] and ntime5 > 1 and TF5 < TF5[1]) or
(Bdate == Bdate[1] and ntime5 > 1 and TM >= TM[1]+ntime5) or
(Bdate == Bdate[1] and ntime5 == 1 and TM > TM[1]) Then
{
for cnt = 1 to 99
{
C5[cnt] = C5[cnt-1][1];
}
}
C5[0] = C;
if C1[P] > 0 then
{
sum1 = 0;
for cnt = 0 to P-1
{
sum1 = sum1 + C1[cnt];
}
BBmd1 = sum1/P;
SumSqrt1 = 0;
For cnt = 0 To P - 1
{
SumSqrt1 = SumSqrt1 + (C1[cnt] - BBmd1)^2;
}
Stdv1 = SquareRoot(SumSqrt1 / P);
BBup1 = BBmd1 + (Dv * Stdv1);
BBdn1 = BBmd1 - (Dv * Stdv1);
plot4(BBmd1,"중단1",WHITE);
plot5(BBup1,"상단1",WHITE);
plot6(BBdn1,"하단1",WHITE);
}
if C2[P] > 0 then
{
sum2 = 0;
for cnt = 0 to P-1
{
sum2 = sum2 + C2[cnt];
}
BBmd2 = sum2/P;
SumSqrt2 = 0;
For cnt = 0 To P - 1 {
SumSqrt2 = SumSqrt2 + (C2[cnt] - BBmd2)^2;
}
Stdv2 = SquareRoot(SumSqrt2 / P);
BBup2 = BBmd2 + (Dv * Stdv2);
BBdn2 = BBmd2 - (Dv * Stdv2);
plot7(BBmd2,"중단2",BLUE);
plot8(BBup2,"상단2",BLUE);
plot9(BBdn2,"하단2",BLUE);
}
if C3[P] > 0 then
{
sum3 = 0;
for cnt = 0 to P-1
{
sum3 = sum3 + C3[cnt];
}
BBmd3 = sum3/P;
SumSqrt3 = 0;
For cnt = 0 To P - 1 {
SumSqrt3 = SumSqrt3 + (C3[cnt] - BBmd3)^2;
}
Stdv3 = SquareRoot(SumSqrt3 / P);
BBup3 = BBmd3 + (Dv * Stdv3);
BBdn3 = BBmd3 - (Dv * Stdv3);
plot10(BBmd3,"중단3",BLACK);
plot11(BBup3,"상단3",BLACK);
plot12(BBdn3,"하단3",BLACK);
}
if C4[P] > 0 then
{
sum4 = 0;
for cnt = 0 to P-1
{
sum4 = sum4 + C4[cnt];
}
BBmd4 = sum4/P;
SumSqrt4 = 0;
For cnt = 0 To P - 1 {
SumSqrt4 = SumSqrt4 + (C4[cnt] - BBmd4)^2;
}
Stdv4 = SquareRoot(SumSqrt4 / P);
BBup4 = BBmd4 + (Dv * Stdv4);
BBdn4 = BBmd4 - (Dv * Stdv4);
plot13(BBmd4,"중단4",YELLOW);
plot14(BBup4,"상단4",YELLOW);
plot15(BBdn4,"하단4",YELLOW);
}
if C5[P] > 0 then
{
sum5 = 0;
for cnt = 0 to P-1
{
sum5 = sum5 + C5[cnt];
}
BBmd5 = sum5/P;
SumSqrt5 = 0;
For cnt = 0 To P - 1 {
SumSqrt5 = SumSqrt5 + (C5[cnt] - BBmd5)^2;
}
Stdv5 = SquareRoot(SumSqrt5 / P);
BBup5 = BBmd5 + (Dv * Stdv5);
BBdn5 = BBmd5 - (Dv * Stdv5);
plot16(BBmd5,"중단5",GREEN);
plot17(BBup5,"상단5",GREEN);
plot18(BBdn5,"하단5",GREEN);
}
}
즐거운 하루되세요
> softtoug 님이 쓴 글입니다.
> 제목 : 지표문의
> 안녕하세요
지표문의 드립니다.
검토 부탁드립니니다.
볼린져 밴드를 그물망 챠트 처럼 보고 싶습니다.
5 분봉
15 분봉
30 분봉
60 분봉
120 분봉
400 분봉
상기 6개의 봉챠트의 볼린져 밴드를
15분봉 챠트에 한번에 표현되게 부탁드립니다.
색상은 각 분봉의 볼린져 밴드가 한가지 색상으로
상단 하단 중앙이 표현되며
하기와 같이 부탁드립니다.
5 분봉 - 빨강
15 분봉 - 흰색
30 분봉 - 파랑
60 분봉 - 검정색
120 분봉 - 노랑
400 분봉 - 연두
감사합니다.