커뮤니티
수식 수정 부탁드립니다
2015-11-01 02:41:37
316
글번호 91895
수식 수정 2가지 입니다
(1)아래 식을 적용해본 결과
천정에서 -40,-80,...선이 완료된 후에는
바닥에서 +40,+80,...선이 출력되는 방식입니다
천정에서 -40,-80,...선과
바닥에서 +40,+80,...선이 번갈아 출력되지 않고
하나의 면적에 천정 지지선과 바닥 저항선이 동시에 출력되는 방식으로 수정 부탁드립니다
그리고 -40 글자는 blue, +40 글자는 red 색깔로 표시하는 수식도 추가부탁드립니다
감사합니다
----------------------------------------------------------------
input : N(40);
var : HH(0),LL(0),T(0),HD(0),HT(0),LD(0),LT(0),HL(0),LH(0);
var : Tx1(0),tx2(0),tx3(0),tx4(0),tx5(0);
var : tx6(0),tx7(0),tx8(0),tx9(0),Tx10(0);
if bdate != bdate[1] then{
T = 0;
HH = H;
LL = L;
}
if H > HH and Bdate == Bdate[1] Then{
T = 1;
HH = H;
Condition1 = false;
Condition2 = false;
Condition3 = false;
Condition4 = false;
Condition5 = false;
Condition6 = false;
Condition7 = false;
Condition8 = false;
Condition9 = false;
}
if L < LL and Bdate == Bdate[1] Then{
T = -1;
LL = L;
Condition1 = false;
Condition2 = false;
Condition3 = false;
Condition4 = false;
Condition5 = false;
Condition6 = false;
Condition7 = false;
Condition8 = false;
Condition9 = false;
}
if T == 1 Then{
var1 = dayhigh-PriceScale*(N*1);
var2 = dayhigh-PriceScale*(N*2);
var3 = dayhigh-PriceScale*(N*3);
var4 = dayhigh-PriceScale*(N*4);
var5 = dayhigh-PriceScale*(N*5);
var6 = dayhigh-PriceScale*(N*6);
var7 = dayhigh-PriceScale*(N*7);
var8 = dayhigh-PriceScale*(N*8);
var9 = dayhigh-PriceScale*(N*9);
plot1(var1,"1",blue);
plot2(var2,"2",blue);
plot3(var3,"3",blue);
plot4(var4,"4",blue);
plot5(var5,"5",blue);
plot6(var6,"6",blue);
plot7(var7,"7",blue);
plot8(var8,"8",blue);
plot9(var9,"9",blue);
Text_Delete(tx1);
Text_Delete(tx2);
Text_Delete(tx3);
Text_Delete(tx4);
Text_Delete(tx5);
Text_Delete(tx6);
Text_Delete(tx7);
Text_Delete(tx8);
Text_Delete(tx9);
tx1 = Text_New(sdate,stime,var1,"-"+NumToStr(N*1,0));
tx2 = Text_New(sdate,stime,var2,"-"+NumToStr(N*2,0));
tx3 = Text_New(sdate,stime,var3,"-"+NumToStr(N*3,0));
tx4 = Text_New(sdate,stime,var4,"-"+NumToStr(N*4,0));
tx5 = Text_New(sdate,stime,var5,"-"+NumToStr(N*5,0));
tx6 = Text_New(sdate,stime,var6,"-"+NumToStr(N*6,0));
tx7 = Text_New(sdate,stime,var7,"-"+NumToStr(N*7,0));
tx8 = Text_New(sdate,stime,var8,"-"+NumToStr(N*8,0));
tx9 = Text_New(sdate,stime,var9,"-"+NumToStr(N*9,0));
if Condition1 == false and CrossDown(c,var1) Then{
tx10 = Text_New(sdate,stime,H,"-"+NumToStr(N*1,0));
Condition1 = true;
}
if Condition2 == false and CrossDown(c,var2) Then{
tx10 = Text_New(sdate,stime,H,"-"+NumToStr(N*2,0));
Condition1 = true;
}
if Condition3 == false and CrossDown(c,var3) Then{
tx10 = Text_New(sdate,stime,H,"-"+NumToStr(N*3,0));
Condition3 = true;
}
if Condition4 == false and CrossDown(c,var4) Then{
tx10 = Text_New(sdate,stime,H,"-"+NumToStr(N*4,0));
Condition4 = true;
}
if Condition5 == false and CrossDown(c,var5) Then{
tx10 = Text_New(sdate,stime,H,"-"+NumToStr(N*5,0));
Condition5 = true;
}
if Condition6 == false and CrossDown(c,var6) Then{
tx10 = Text_New(sdate,stime,H,"-"+NumToStr(N*6,0));
Condition6 = true;
}
if Condition7 == false and CrossDown(c,var7) Then{
tx10 = Text_New(sdate,stime,H,"-"+NumToStr(N*7,0));
Condition7 = true;
}
if Condition8 == false and CrossDown(c,var8) Then{
tx10 = Text_New(sdate,stime,H,"-"+NumToStr(N*8,0));
Condition8 = true;
}
if Condition9 == false and CrossDown(c,var9) Then{
tx10 = Text_New(sdate,stime,H,"-"+NumToStr(N*8,0));
Condition9 = true;
}
Text_SetStyle(tx1,2,2);
Text_SetStyle(tx2,2,2);
Text_SetStyle(tx3,2,2);
Text_SetStyle(tx4,2,2);
Text_SetStyle(tx5,2,2);
Text_SetStyle(tx6,2,2);
Text_SetStyle(tx7,2,2);
Text_SetStyle(tx8,2,2);
Text_SetStyle(tx9,2,2);
Text_SetStyle(tx10,2,2);
}
if T == -1 Then{
var1 = daylow+PriceScale*(N*1);
var2 = daylow+PriceScale*(N*2);
var3 = daylow+PriceScale*(N*3);
var4 = daylow+PriceScale*(N*4);
var5 = daylow+PriceScale*(N*5);
var6 = daylow+PriceScale*(N*6);
var7 = daylow+PriceScale*(N*7);
var8 = daylow+PriceScale*(N*8);
var9 = daylow+PriceScale*(N*9);
plot1(var1,"1",red);
plot2(var2,"2",red);
plot3(var3,"3",red);
plot4(var4,"4",red);
plot5(var5,"5",red);
plot6(var6,"6",red);
plot7(var7,"7",red);
plot8(var8,"8",red);
plot9(var9,"9",red);
Text_Delete(tx1);
Text_Delete(tx2);
Text_Delete(tx3);
Text_Delete(tx4);
Text_Delete(tx5);
Text_Delete(tx6);
Text_Delete(tx7);
Text_Delete(tx8);
Text_Delete(tx9);
tx1 = Text_New(sdate,stime,var1,"+"+NumToStr(N*1,0));
tx2 = Text_New(sdate,stime,var2,"+"+NumToStr(N*2,0));
tx3 = Text_New(sdate,stime,var3,"+"+NumToStr(N*3,0));
tx4 = Text_New(sdate,stime,var4,"+"+NumToStr(N*4,0));
tx5 = Text_New(sdate,stime,var5,"+"+NumToStr(N*5,0));
tx6 = Text_New(sdate,stime,var6,"+"+NumToStr(N*6,0));
tx7 = Text_New(sdate,stime,var7,"+"+NumToStr(N*7,0));
tx8 = Text_New(sdate,stime,var8,"+"+NumToStr(N*8,0));
tx9 = Text_New(sdate,stime,var9,"+"+NumToStr(N*9,0));
if Condition1 == false and Crossup(c,var1) Then{
tx10 = Text_New(sdate,stime,H,"+"+NumToStr(N*1,0));
Condition1 = true;
}
if Condition2 == false and Crossup(c,var2) Then{
tx10 = Text_New(sdate,stime,H,"+"+NumToStr(N*2,0));
Condition1 = true;
}
if Condition3 == false and Crossup(c,var3) Then{
tx10 = Text_New(sdate,stime,H,"+"+NumToStr(N*3,0));
Condition3 = true;
}
if Condition4 == false and Crossup(c,var4) Then{
tx10 = Text_New(sdate,stime,H,"+"+NumToStr(N*4,0));
Condition4 = true;
}
if Condition5 == false and Crossup(c,var5) Then{
tx10 = Text_New(sdate,stime,H,"+"+NumToStr(N*5,0));
Condition5 = true;
}
if Condition6 == false and Crossup(c,var6) Then{
tx10 = Text_New(sdate,stime,H,"+"+NumToStr(N*6,0));
Condition6 = true;
}
if Condition7 == false and Crossup(c,var7) Then{
tx10 = Text_New(sdate,stime,H,"+"+NumToStr(N*7,0));
Condition7 = true;
}
if Condition8 == false and Crossup(c,var8) Then{
tx10 = Text_New(sdate,stime,H,"+"+NumToStr(N*8,0));
Condition8 = true;
}
if Condition9 == false and Crossup(c,var9) Then{
tx10 = Text_New(sdate,stime,H,"+"+NumToStr(N*8,0));
Condition9 = true;
}
Text_SetStyle(tx1,2,2);
Text_SetStyle(tx2,2,2);
Text_SetStyle(tx3,2,2);
Text_SetStyle(tx4,2,2);
Text_SetStyle(tx5,2,2);
Text_SetStyle(tx6,2,2);
Text_SetStyle(tx7,2,2);
Text_SetStyle(tx8,2,2);
Text_SetStyle(tx9,2,2);
Text_SetStyle(tx10,2,2);
}
------------------------------------------
(2)
아래식은 p1과 p2 크로스 시점에 진입식입니다
아래식을
p1과 p2 골든 크로스 가격을 현재가가 골든크로스 하거나 터치할때 매수
p1과 p2 데드 크로스 가격을 현재가가 데드크로스 하거나 터치할때 매도
진입식으로 수정 부탁드립니다
감사합니다
var:p1(0),p2(0);
p1=ma(c,10)
p2=ma(c,20)
if Crossup( p1,p2)
then{
buy();
}
if CrossDown( p1,p2)
then{
sell();
}
답변 1
예스스탁 예스스탁 답변
2015-11-02 10:27:20
안녕하세요
예스스탁입니다.
1.
input : N(40);
var : HH(0),LL(0),HD(0),HT(0),LD(0),LT(0),HL(0),LH(0);
var : Tx1(0),tx2(0),tx3(0),tx4(0),tx5(0);
var : tx6(0),tx7(0),tx8(0),tx9(0),Tx10(0);
var : Tx11(0),tx12(0),tx13(0),tx14(0),tx15(0);
var : tx16(0),tx17(0),tx18(0),tx19(0),Tx20(0);
if bdate != bdate[1] then{
HH = H;
LL = L;
Condition1 = false;
Condition2 = false;
Condition3 = false;
Condition4 = false;
Condition5 = false;
Condition6 = false;
Condition7 = false;
Condition8 = false;
Condition9 = false;
Condition11 = false;
Condition12 = false;
Condition13 = false;
Condition14 = false;
Condition15 = false;
Condition16 = false;
Condition17 = false;
Condition18 = false;
Condition19 = false;
}
if H > HH and Bdate == Bdate[1] Then{
HH = H;
Condition1 = false;
Condition2 = false;
Condition3 = false;
Condition4 = false;
Condition5 = false;
Condition6 = false;
Condition7 = false;
Condition8 = false;
Condition9 = false;
}
if L < LL and Bdate == Bdate[1] Then{
LL = L;
Condition11 = false;
Condition12 = false;
Condition13 = false;
Condition14 = false;
Condition15 = false;
Condition16 = false;
Condition17 = false;
Condition18 = false;
Condition19 = false;
}
var1 = dayhigh-PriceScale*(N*1);
var2 = dayhigh-PriceScale*(N*2);
var3 = dayhigh-PriceScale*(N*3);
var4 = dayhigh-PriceScale*(N*4);
var5 = dayhigh-PriceScale*(N*5);
var6 = dayhigh-PriceScale*(N*6);
var7 = dayhigh-PriceScale*(N*7);
var8 = dayhigh-PriceScale*(N*8);
var9 = dayhigh-PriceScale*(N*9);
plot1(var1,"1",blue);
plot2(var2,"2",blue);
plot3(var3,"3",blue);
plot4(var4,"4",blue);
plot5(var5,"5",blue);
plot6(var6,"6",blue);
plot7(var7,"7",blue);
plot8(var8,"8",blue);
plot9(var9,"9",blue);
Text_Delete(tx1);
Text_Delete(tx2);
Text_Delete(tx3);
Text_Delete(tx4);
Text_Delete(tx5);
Text_Delete(tx6);
Text_Delete(tx7);
Text_Delete(tx8);
Text_Delete(tx9);
tx1 = Text_New(sdate,stime,var1,"-"+NumToStr(N*1,0));
tx2 = Text_New(sdate,stime,var2,"-"+NumToStr(N*2,0));
tx3 = Text_New(sdate,stime,var3,"-"+NumToStr(N*3,0));
tx4 = Text_New(sdate,stime,var4,"-"+NumToStr(N*4,0));
tx5 = Text_New(sdate,stime,var5,"-"+NumToStr(N*5,0));
tx6 = Text_New(sdate,stime,var6,"-"+NumToStr(N*6,0));
tx7 = Text_New(sdate,stime,var7,"-"+NumToStr(N*7,0));
tx8 = Text_New(sdate,stime,var8,"-"+NumToStr(N*8,0));
tx9 = Text_New(sdate,stime,var9,"-"+NumToStr(N*9,0));
if Condition1 == false and CrossDown(c,var1) Then{
tx10 = Text_New(sdate,stime,H,"-"+NumToStr(N*1,0));
Condition1 = true;
}
if Condition2 == false and CrossDown(c,var2) Then{
tx10 = Text_New(sdate,stime,H,"-"+NumToStr(N*2,0));
Condition1 = true;
}
if Condition3 == false and CrossDown(c,var3) Then{
tx10 = Text_New(sdate,stime,H,"-"+NumToStr(N*3,0));
Condition3 = true;
}
if Condition4 == false and CrossDown(c,var4) Then{
tx10 = Text_New(sdate,stime,H,"-"+NumToStr(N*4,0));
Condition4 = true;
}
if Condition5 == false and CrossDown(c,var5) Then{
tx10 = Text_New(sdate,stime,H,"-"+NumToStr(N*5,0));
Condition5 = true;
}
if Condition6 == false and CrossDown(c,var6) Then{
tx10 = Text_New(sdate,stime,H,"-"+NumToStr(N*6,0));
Condition6 = true;
}
if Condition7 == false and CrossDown(c,var7) Then{
tx10 = Text_New(sdate,stime,H,"-"+NumToStr(N*7,0));
Condition7 = true;
}
if Condition8 == false and CrossDown(c,var8) Then{
tx10 = Text_New(sdate,stime,H,"-"+NumToStr(N*8,0));
Condition8 = true;
}
if Condition9 == false and CrossDown(c,var9) Then{
tx10 = Text_New(sdate,stime,H,"-"+NumToStr(N*8,0));
Condition9 = true;
}
Text_SetStyle(tx1,2,2);
Text_SetStyle(tx2,2,2);
Text_SetStyle(tx3,2,2);
Text_SetStyle(tx4,2,2);
Text_SetStyle(tx5,2,2);
Text_SetStyle(tx6,2,2);
Text_SetStyle(tx7,2,2);
Text_SetStyle(tx8,2,2);
Text_SetStyle(tx9,2,2);
Text_SetStyle(tx10,2,2);
Text_SetColor(tx1,blue);
Text_SetColor(tx2,blue);
Text_SetColor(tx3,blue);
Text_SetColor(tx4,blue);
Text_SetColor(tx5,blue);
Text_SetColor(tx6,blue);
Text_SetColor(tx7,blue);
Text_SetColor(tx8,blue);
Text_SetColor(tx9,blue);
Text_SetColor(tx10,blue);
var11 = daylow+PriceScale*(N*1);
var12 = daylow+PriceScale*(N*2);
var13 = daylow+PriceScale*(N*3);
var14 = daylow+PriceScale*(N*4);
var15 = daylow+PriceScale*(N*5);
var16 = daylow+PriceScale*(N*6);
var17 = daylow+PriceScale*(N*7);
var18 = daylow+PriceScale*(N*8);
var19 = daylow+PriceScale*(N*9);
plot11(var11,"1",red);
plot12(var12,"2",red);
plot13(var13,"3",red);
plot14(var14,"4",red);
plot15(var15,"5",red);
plot16(var16,"6",red);
plot17(var17,"7",red);
plot18(var18,"8",red);
plot19(var19,"9",red);
Text_Delete(tx11);
Text_Delete(tx12);
Text_Delete(tx13);
Text_Delete(tx14);
Text_Delete(tx15);
Text_Delete(tx16);
Text_Delete(tx17);
Text_Delete(tx18);
Text_Delete(tx19);
tx11 = Text_New(sdate,stime,var11,"+"+NumToStr(N*1,0));
tx12 = Text_New(sdate,stime,var12,"+"+NumToStr(N*2,0));
tx13 = Text_New(sdate,stime,var13,"+"+NumToStr(N*3,0));
tx14 = Text_New(sdate,stime,var14,"+"+NumToStr(N*4,0));
tx15 = Text_New(sdate,stime,var15,"+"+NumToStr(N*5,0));
tx16 = Text_New(sdate,stime,var16,"+"+NumToStr(N*6,0));
tx17 = Text_New(sdate,stime,var17,"+"+NumToStr(N*7,0));
tx18 = Text_New(sdate,stime,var18,"+"+NumToStr(N*8,0));
tx19 = Text_New(sdate,stime,var19,"+"+NumToStr(N*9,0));
if Condition11 == false and Crossup(c,var11) Then{
tx20 = Text_New(sdate,stime,H,"+"+NumToStr(N*1,0));
Condition11 = true;
}
if Condition12 == false and Crossup(c,var12) Then{
tx20 = Text_New(sdate,stime,H,"+"+NumToStr(N*2,0));
Condition12 = true;
}
if Condition13 == false and Crossup(c,var13) Then{
tx20 = Text_New(sdate,stime,H,"+"+NumToStr(N*3,0));
Condition13 = true;
}
if Condition14 == false and Crossup(c,var14) Then{
tx20 = Text_New(sdate,stime,H,"+"+NumToStr(N*4,0));
Condition14 = true;
}
if Condition15 == false and Crossup(c,var15) Then{
tx20 = Text_New(sdate,stime,H,"+"+NumToStr(N*5,0));
Condition15 = true;
}
if Condition16 == false and Crossup(c,var16) Then{
tx20 = Text_New(sdate,stime,H,"+"+NumToStr(N*6,0));
Condition16 = true;
}
if Condition17 == false and Crossup(c,var17) Then{
tx20 = Text_New(sdate,stime,H,"+"+NumToStr(N*7,0));
Condition17 = true;
}
if Condition18 == false and Crossup(c,var18) Then{
tx20 = Text_New(sdate,stime,H,"+"+NumToStr(N*8,0));
Condition18 = true;
}
if Condition19 == false and Crossup(c,var19) Then{
tx20 = Text_New(sdate,stime,H,"+"+NumToStr(N*8,0));
Condition19 = true;
}
Text_SetStyle(tx11,2,2);
Text_SetStyle(tx12,2,2);
Text_SetStyle(tx13,2,2);
Text_SetStyle(tx14,2,2);
Text_SetStyle(tx15,2,2);
Text_SetStyle(tx16,2,2);
Text_SetStyle(tx17,2,2);
Text_SetStyle(tx18,2,2);
Text_SetStyle(tx19,2,2);
Text_SetStyle(tx20,2,2);
Text_SetColor(tx11,red);
Text_SetColor(tx12,red);
Text_SetColor(tx13,red);
Text_SetColor(tx14,red);
Text_SetColor(tx15,red);
Text_SetColor(tx16,red);
Text_SetColor(tx17,red);
Text_SetColor(tx18,red);
Text_SetColor(tx19,red);
Text_SetColor(tx20,red);
2.
var:p1(0),p2(0);
var: T(0);
p1=ma(c,10);
p2=ma(c,20);
if Crossup( p1,p2) then{
var1 = C;
T = 1;
}
if CrossDown( p1,p2) then{
var2 = C;
T = -1;
}
if T == 1 and crossUP(c,var1) Then
buy();
if T == -1 and CrossDown(c,var1) Then
sell();
즐거운 하루되세요
> 타이쿤 님이 쓴 글입니다.
> 제목 : 수식 수정 부탁드립니다
> 수식 수정 2가지 입니다
(1)아래 식을 적용해본 결과
천정에서 -40,-80,...선이 완료된 후에는
바닥에서 +40,+80,...선이 출력되는 방식입니다
천정에서 -40,-80,...선과
바닥에서 +40,+80,...선이 번갈아 출력되지 않고
하나의 면적에 천정 지지선과 바닥 저항선이 동시에 출력되는 방식으로 수정 부탁드립니다
그리고 -40 글자는 blue, +40 글자는 red 색깔로 표시하는 수식도 추가부탁드립니다
감사합니다
----------------------------------------------------------------
input : N(40);
var : HH(0),LL(0),T(0),HD(0),HT(0),LD(0),LT(0),HL(0),LH(0);
var : Tx1(0),tx2(0),tx3(0),tx4(0),tx5(0);
var : tx6(0),tx7(0),tx8(0),tx9(0),Tx10(0);
if bdate != bdate[1] then{
T = 0;
HH = H;
LL = L;
}
if H > HH and Bdate == Bdate[1] Then{
T = 1;
HH = H;
Condition1 = false;
Condition2 = false;
Condition3 = false;
Condition4 = false;
Condition5 = false;
Condition6 = false;
Condition7 = false;
Condition8 = false;
Condition9 = false;
}
if L < LL and Bdate == Bdate[1] Then{
T = -1;
LL = L;
Condition1 = false;
Condition2 = false;
Condition3 = false;
Condition4 = false;
Condition5 = false;
Condition6 = false;
Condition7 = false;
Condition8 = false;
Condition9 = false;
}
if T == 1 Then{
var1 = dayhigh-PriceScale*(N*1);
var2 = dayhigh-PriceScale*(N*2);
var3 = dayhigh-PriceScale*(N*3);
var4 = dayhigh-PriceScale*(N*4);
var5 = dayhigh-PriceScale*(N*5);
var6 = dayhigh-PriceScale*(N*6);
var7 = dayhigh-PriceScale*(N*7);
var8 = dayhigh-PriceScale*(N*8);
var9 = dayhigh-PriceScale*(N*9);
plot1(var1,"1",blue);
plot2(var2,"2",blue);
plot3(var3,"3",blue);
plot4(var4,"4",blue);
plot5(var5,"5",blue);
plot6(var6,"6",blue);
plot7(var7,"7",blue);
plot8(var8,"8",blue);
plot9(var9,"9",blue);
Text_Delete(tx1);
Text_Delete(tx2);
Text_Delete(tx3);
Text_Delete(tx4);
Text_Delete(tx5);
Text_Delete(tx6);
Text_Delete(tx7);
Text_Delete(tx8);
Text_Delete(tx9);
tx1 = Text_New(sdate,stime,var1,"-"+NumToStr(N*1,0));
tx2 = Text_New(sdate,stime,var2,"-"+NumToStr(N*2,0));
tx3 = Text_New(sdate,stime,var3,"-"+NumToStr(N*3,0));
tx4 = Text_New(sdate,stime,var4,"-"+NumToStr(N*4,0));
tx5 = Text_New(sdate,stime,var5,"-"+NumToStr(N*5,0));
tx6 = Text_New(sdate,stime,var6,"-"+NumToStr(N*6,0));
tx7 = Text_New(sdate,stime,var7,"-"+NumToStr(N*7,0));
tx8 = Text_New(sdate,stime,var8,"-"+NumToStr(N*8,0));
tx9 = Text_New(sdate,stime,var9,"-"+NumToStr(N*9,0));
if Condition1 == false and CrossDown(c,var1) Then{
tx10 = Text_New(sdate,stime,H,"-"+NumToStr(N*1,0));
Condition1 = true;
}
if Condition2 == false and CrossDown(c,var2) Then{
tx10 = Text_New(sdate,stime,H,"-"+NumToStr(N*2,0));
Condition1 = true;
}
if Condition3 == false and CrossDown(c,var3) Then{
tx10 = Text_New(sdate,stime,H,"-"+NumToStr(N*3,0));
Condition3 = true;
}
if Condition4 == false and CrossDown(c,var4) Then{
tx10 = Text_New(sdate,stime,H,"-"+NumToStr(N*4,0));
Condition4 = true;
}
if Condition5 == false and CrossDown(c,var5) Then{
tx10 = Text_New(sdate,stime,H,"-"+NumToStr(N*5,0));
Condition5 = true;
}
if Condition6 == false and CrossDown(c,var6) Then{
tx10 = Text_New(sdate,stime,H,"-"+NumToStr(N*6,0));
Condition6 = true;
}
if Condition7 == false and CrossDown(c,var7) Then{
tx10 = Text_New(sdate,stime,H,"-"+NumToStr(N*7,0));
Condition7 = true;
}
if Condition8 == false and CrossDown(c,var8) Then{
tx10 = Text_New(sdate,stime,H,"-"+NumToStr(N*8,0));
Condition8 = true;
}
if Condition9 == false and CrossDown(c,var9) Then{
tx10 = Text_New(sdate,stime,H,"-"+NumToStr(N*8,0));
Condition9 = true;
}
Text_SetStyle(tx1,2,2);
Text_SetStyle(tx2,2,2);
Text_SetStyle(tx3,2,2);
Text_SetStyle(tx4,2,2);
Text_SetStyle(tx5,2,2);
Text_SetStyle(tx6,2,2);
Text_SetStyle(tx7,2,2);
Text_SetStyle(tx8,2,2);
Text_SetStyle(tx9,2,2);
Text_SetStyle(tx10,2,2);
}
if T == -1 Then{
var1 = daylow+PriceScale*(N*1);
var2 = daylow+PriceScale*(N*2);
var3 = daylow+PriceScale*(N*3);
var4 = daylow+PriceScale*(N*4);
var5 = daylow+PriceScale*(N*5);
var6 = daylow+PriceScale*(N*6);
var7 = daylow+PriceScale*(N*7);
var8 = daylow+PriceScale*(N*8);
var9 = daylow+PriceScale*(N*9);
plot1(var1,"1",red);
plot2(var2,"2",red);
plot3(var3,"3",red);
plot4(var4,"4",red);
plot5(var5,"5",red);
plot6(var6,"6",red);
plot7(var7,"7",red);
plot8(var8,"8",red);
plot9(var9,"9",red);
Text_Delete(tx1);
Text_Delete(tx2);
Text_Delete(tx3);
Text_Delete(tx4);
Text_Delete(tx5);
Text_Delete(tx6);
Text_Delete(tx7);
Text_Delete(tx8);
Text_Delete(tx9);
tx1 = Text_New(sdate,stime,var1,"+"+NumToStr(N*1,0));
tx2 = Text_New(sdate,stime,var2,"+"+NumToStr(N*2,0));
tx3 = Text_New(sdate,stime,var3,"+"+NumToStr(N*3,0));
tx4 = Text_New(sdate,stime,var4,"+"+NumToStr(N*4,0));
tx5 = Text_New(sdate,stime,var5,"+"+NumToStr(N*5,0));
tx6 = Text_New(sdate,stime,var6,"+"+NumToStr(N*6,0));
tx7 = Text_New(sdate,stime,var7,"+"+NumToStr(N*7,0));
tx8 = Text_New(sdate,stime,var8,"+"+NumToStr(N*8,0));
tx9 = Text_New(sdate,stime,var9,"+"+NumToStr(N*9,0));
if Condition1 == false and Crossup(c,var1) Then{
tx10 = Text_New(sdate,stime,H,"+"+NumToStr(N*1,0));
Condition1 = true;
}
if Condition2 == false and Crossup(c,var2) Then{
tx10 = Text_New(sdate,stime,H,"+"+NumToStr(N*2,0));
Condition1 = true;
}
if Condition3 == false and Crossup(c,var3) Then{
tx10 = Text_New(sdate,stime,H,"+"+NumToStr(N*3,0));
Condition3 = true;
}
if Condition4 == false and Crossup(c,var4) Then{
tx10 = Text_New(sdate,stime,H,"+"+NumToStr(N*4,0));
Condition4 = true;
}
if Condition5 == false and Crossup(c,var5) Then{
tx10 = Text_New(sdate,stime,H,"+"+NumToStr(N*5,0));
Condition5 = true;
}
if Condition6 == false and Crossup(c,var6) Then{
tx10 = Text_New(sdate,stime,H,"+"+NumToStr(N*6,0));
Condition6 = true;
}
if Condition7 == false and Crossup(c,var7) Then{
tx10 = Text_New(sdate,stime,H,"+"+NumToStr(N*7,0));
Condition7 = true;
}
if Condition8 == false and Crossup(c,var8) Then{
tx10 = Text_New(sdate,stime,H,"+"+NumToStr(N*8,0));
Condition8 = true;
}
if Condition9 == false and Crossup(c,var9) Then{
tx10 = Text_New(sdate,stime,H,"+"+NumToStr(N*8,0));
Condition9 = true;
}
Text_SetStyle(tx1,2,2);
Text_SetStyle(tx2,2,2);
Text_SetStyle(tx3,2,2);
Text_SetStyle(tx4,2,2);
Text_SetStyle(tx5,2,2);
Text_SetStyle(tx6,2,2);
Text_SetStyle(tx7,2,2);
Text_SetStyle(tx8,2,2);
Text_SetStyle(tx9,2,2);
Text_SetStyle(tx10,2,2);
}
------------------------------------------
(2)
아래식은 p1과 p2 크로스 시점에 진입식입니다
아래식을
p1과 p2 골든 크로스 가격을 현재가가 골든크로스 하거나 터치할때 매수
p1과 p2 데드 크로스 가격을 현재가가 데드크로스 하거나 터치할때 매도
진입식으로 수정 부탁드립니다
감사합니다
var:p1(0),p2(0);
p1=ma(c,10)
p2=ma(c,20)
if Crossup( p1,p2)
then{
buy();
}
if CrossDown( p1,p2)
then{
sell();
}
이전글