커뮤니티
그물망챠트 조건식
2019-07-22 13:47:02
196
글번호 130533
항상 감사드립니다
아래조건의 조건식을 작성하고 싶습니다.
아래조건식은 그물망챠트를 나타낸것인데요.
10개의 그물망챠트중
red > 10 이상이면 t=1
blue > 10 이상이면 t=2
1= < cyan < 10 이면 t=3
으로 나타내고 싶습니다.
input:period(9),횡보율(0.5);
var1=ema(c,period+5);
if var1>var1[1]*(1+횡보율/100) then plot1(var1,"이동평균1",red); else if var1<var1[1]*(1-횡보율/100) then plot1 (var1,"이동평균1",blue); else plot1 (var1,"이동평균1",cyan);
var2=ema(c,period+10);
if var2>var2[1]*(1+횡보율/100) then plot2(var2,"이동평균2",red); else if var2<var2[1]*(1-횡보율/100) then plot2 (var2,"이동평균2",blue); else plot2 (var2,"이동평균2",cyan);
var3=ema(c,period+15);
if var3>var3[1]*(1+횡보율/100) then plot3(var3,"이동평균3",red); else if var3<var3[1]*(1-횡보율/100) then plot3 (var3,"이동평균3",blue); else plot3 (var3,"이동평균3",cyan);
var4=ema(c,period+20);
if var4>var4[1]*(1+횡보율/100) then plot4(var4,"이동평균4",red); else if var4<var4[1]*(1-횡보율/100) then plot4 (var4,"이동평균4",blue); else plot4 (var4,"이동평균4",cyan);
var5=ema(c,period+25);
if var5>var5[1]*(1+횡보율/100) then plot5(var5,"이동평균5",red); else if var5<var5[1]*(1-횡보율/100) then plot5 (var5,"이동평균5",blue); else plot5 (var5,"이동평균5",cyan);
var6=ema(c,period+30);
if var6>var6[1]*(1+횡보율/100) then plot6(var6,"이동평균6",red); else if var6<var6[1]*(1-횡보율/100) then plot6 (var6,"이동평균6",blue); else plot6 (var6,"이동평균6",cyan);
var7=ema(c,period+35);
if var7>var7[1]*(1+횡보율/100) then plot7(var7,"이동평균7",red); else if var7<var7[1]*(1-횡보율/100) then plot7 (var7,"이동평균7",blue); else plot7 (var7,"이동평균7",cyan);
var8=ema(c,period+40);
if var8>var8[1]*(1+횡보율/100) then plot8(var8,"이동평균8",red); else if var8<var8[1]*(1-횡보율/100) then plot8 (var8,"이동평균8",blue); else plot8 (var8,"이동평균8",cyan);
var9=ema(c,period+45);
if var9>var9[1]*(1+횡보율/100) then plot9(var9,"이동평균9",red); else if var9<var9[1]*(1-횡보율/100) then plot9 (var9,"이동평균9",blue); else plot9 (var9,"이동평균9",cyan);
var10=ema(c,period+50);
if var10>var10[1]*(1+횡보율/100) then plot10(var10,"이동평균10",red); else if var10<var10[1]*(1-횡보율/100) then plot10 (var10,"이동평균10",blue); else plot10 (var10,"이동평균10",cyan);
답변 1
예스스탁 예스스탁 답변
2019-07-23 13:54:11
안녕하세요
예스스탁입니다.
input:period(9),횡보율(0.5);
var : t(0);
var1=ema(c,period+5);
var2=ema(c,period+10);
var3=ema(c,period+15);
var4=ema(c,period+20);
var5=ema(c,period+25);
var6=ema(c,period+30);
var7=ema(c,period+35);
var8=ema(c,period+40);
var9=ema(c,period+45);
var10=ema(c,period+50);
value1 = 0;
value2 = 0;
value3 = 0;
if var1>var1[1]*(1+횡보율/100) then value1 = value1+1;
else if var1<var1[1]*(1-횡보율/100) then value2 = value2+1;
else value3 = value3+1;
if var2>var2[1]*(1+횡보율/100) then value1 = value1+1;
else if var2<var2[1]*(1-횡보율/100) then value2 = value2+1;
else value3 = value3+1;
if var3>var3[1]*(1+횡보율/100) then value1 = value1+1;
else if var3<var3[1]*(1-횡보율/100) then value2 = value2+1;
else value3 = value3+1;
if var4>var4[1]*(1+횡보율/100) then value1 = value1+1;
else if var4<var4[1]*(1-횡보율/100) then value2 = value2+1;
else value3 = value3+1;
if var5>var5[1]*(1+횡보율/100) then value1 = value1+1;
else if var5<var5[1]*(1-횡보율/100) then value2 = value2+1;
else value3 = value3+1;
if var6>var6[1]*(1+횡보율/100) then value1 = value1+1;
else if var6<var6[1]*(1-횡보율/100) then value2 = value2+1;
else value3 = value3+1;
if var7>var7[1]*(1+횡보율/100) then value1 = value1+1;
else if var7<var7[1]*(1-횡보율/100) then value2 = value2+1;
else value3 = value3+1;
if var8>var8[1]*(1+횡보율/100) then value1 = value1+1;
else if var8<var8[1]*(1-횡보율/100) then value2 = value2+1;
else value3 = value3+1;
if var9>var9[1]*(1+횡보율/100) then value1 = value1+1;
else if var9<var9[1]*(1-횡보율/100) then value2 = value2+1;
else value3 = value3+1;
if var10>var10[1]*(1+횡보율/100) then value1 = value1+1;
else if var1<var1[1]*(1-횡보율/100) then value2 = value2+1;
else value3 = value3+1;
if value1 == 10 Then
t = 1;
else if value2 == 10 Then
t = 2;
Else
t = 3;
plot1(t);
즐거운 하루되세요
> 조민철 님이 쓴 글입니다.
> 제목 : 그물망챠트 조건식
> 항상 감사드립니다
아래조건의 조건식을 작성하고 싶습니다.
아래조건식은 그물망챠트를 나타낸것인데요.
10개의 그물망챠트중
red > 10 이상이면 t=1
blue > 10 이상이면 t=2
1= < cyan < 10 이면 t=3
으로 나타내고 싶습니다.
input:period(9),횡보율(0.5);
var1=ema(c,period+5);
if var1>var1[1]*(1+횡보율/100) then plot1(var1,"이동평균1",red); else if var1<var1[1]*(1-횡보율/100) then plot1 (var1,"이동평균1",blue); else plot1 (var1,"이동평균1",cyan);
var2=ema(c,period+10);
if var2>var2[1]*(1+횡보율/100) then plot2(var2,"이동평균2",red); else if var2<var2[1]*(1-횡보율/100) then plot2 (var2,"이동평균2",blue); else plot2 (var2,"이동평균2",cyan);
var3=ema(c,period+15);
if var3>var3[1]*(1+횡보율/100) then plot3(var3,"이동평균3",red); else if var3<var3[1]*(1-횡보율/100) then plot3 (var3,"이동평균3",blue); else plot3 (var3,"이동평균3",cyan);
var4=ema(c,period+20);
if var4>var4[1]*(1+횡보율/100) then plot4(var4,"이동평균4",red); else if var4<var4[1]*(1-횡보율/100) then plot4 (var4,"이동평균4",blue); else plot4 (var4,"이동평균4",cyan);
var5=ema(c,period+25);
if var5>var5[1]*(1+횡보율/100) then plot5(var5,"이동평균5",red); else if var5<var5[1]*(1-횡보율/100) then plot5 (var5,"이동평균5",blue); else plot5 (var5,"이동평균5",cyan);
var6=ema(c,period+30);
if var6>var6[1]*(1+횡보율/100) then plot6(var6,"이동평균6",red); else if var6<var6[1]*(1-횡보율/100) then plot6 (var6,"이동평균6",blue); else plot6 (var6,"이동평균6",cyan);
var7=ema(c,period+35);
if var7>var7[1]*(1+횡보율/100) then plot7(var7,"이동평균7",red); else if var7<var7[1]*(1-횡보율/100) then plot7 (var7,"이동평균7",blue); else plot7 (var7,"이동평균7",cyan);
var8=ema(c,period+40);
if var8>var8[1]*(1+횡보율/100) then plot8(var8,"이동평균8",red); else if var8<var8[1]*(1-횡보율/100) then plot8 (var8,"이동평균8",blue); else plot8 (var8,"이동평균8",cyan);
var9=ema(c,period+45);
if var9>var9[1]*(1+횡보율/100) then plot9(var9,"이동평균9",red); else if var9<var9[1]*(1-횡보율/100) then plot9 (var9,"이동평균9",blue); else plot9 (var9,"이동평균9",cyan);
var10=ema(c,period+50);
if var10>var10[1]*(1+횡보율/100) then plot10(var10,"이동평균10",red); else if var10<var10[1]*(1-횡보율/100) then plot10 (var10,"이동평균10",blue); else plot10 (var10,"이동평균10",cyan);
다음글
이전글