커뮤니티
ct를 yt로 변경 부탁 드립니다.
2012-04-05 13:12:20
291
글번호 49759
안녕 하세요,,
아래의 7개의 ct를 yt로 변경 부탁 드립니다..
1번째
Input: ups(0.1), dns(0.1), gapup(0.29), gapfill(0.18), s2(2.7)
If opend>highd(1) Then
Var1=100*((opend-highd(1))/highd(1))
End If
If opend<lowd(1) Then
Var1=100*((lowd(1)-opend)/lowd(1))
End If
If tdate<>tdate(1) Then
Var50=currententrynum
End If
Cond1=exitdate(1)=tdate And position(1)=1
Cond2=exitdate(1)=tdate And position(1)=-1
If currententrynum-var50<=2 Then
If ttime <1500 Then
If opend>highd(1) And Var1>ups Then
If Cond1=False Then
Call buy("GapUp매수",Atstop,Def,opend+(highd(1)-lowd(1))*gapup)
End If
If Cond2=False Then
Call sell("GapFill매도",Atstop,Def, _
max(highd(1),opend-(highd(1)-lowd(1))*gapfill))
End If
End If
If opend<lowd(1) And Var1>dns Then
If Cond2=False Then
Call sell("GapDown매도",Atstop,Def,opend-(highd(1)-lowd(1))*gapup)
End If
If Cond1=False Then
Call buy("GapFill매수",Atstop,Def,_
min(lowd(1),opend+(highd(1)-lowd(1))*gapfill))
End If
End If
End If
End If
If position<>0 Then
Call exitlong("매수추적",Atstop,hhv(1,high,barnumsinceentry+1)-atr(20)*S2)
Call exitshort("매도추적",Atstop,llv(1,low,barnumsinceentry+1)+atr(20)*S2)
End If
2번째
Input: ups(0.5), dns(0.3), gapup(0.34), gapfill(0.19), s2(2.7)
If opend>=closed(1) Then
Var1=100*((opend-closed(1))/closed(1))
End If
If opend<closed(1) Then
Var1=100*((closed(1)-opend)/closed(1))
End If
If tdate<>tdate(1) Then
Var3=0
Else
If i_position<>0 And i_position(1)<>i_position Then
Var3=var3+1
End If
End If
If tdate<>tdate(1) Then
Var50=currententrynum
End If
Cond1=exitdate(1)=tdate And position(1)=1
Cond2=exitdate(1)=tdate And position(1)=-1
If currententrynum-var50<=1 Then
If ttime <1500 Then
If opend>closed(1) And Var1>ups Then
If Cond1=False then
Call buy("GapUp매수",Atstop,Def,opend+(highd(1)-lowd(1))*gapup)
End If
If Cond2=False then
Call sell("GapFill매도",Atstop,Def,max(closed(1),opend-(highd(1)-lowd(1))*gapfill))
End If
End If
If opend<closed(1) And Var1>dns Then
If Cond2=False Then
Call sell("GapDown매도",Atstop,Def,opend-(highd(1)-lowd(1))*gapup)
End If
If Cond1=False Then
Call buy("GapFill매수",Atstop,Def,min(closed(1),opend+(closed(1)-lowd(1))*gapfill))
End If
End If
End If
End If
If position<>0 Then
Call exitlong("매수추적",Atstop,hhv(1,high,barnumsinceentry+1)-atr(10)*s2)
Call exitshort("매도추적",Atstop,llv(1,low,barnumsinceentry+1)+atr(10)*S2)
End If
3번째
Input: s1(0.48), s2(2.7)
Var1=highd(1)
Var2=closed(1)
Var3=lowd(1)
Var4=closed(1)
If abs(Var1-var4)>=abs(Var2-var3) Then
Var10=abs(Var1-var4)
Else
Var10=abs(Var2-var3)
End If
Cond1= tdate=exitdate(1) And position(1)=1
Cond2= tdate=exitdate(1) And position(1)=-1
If Ttime<1500 Then
If Cond1=False Then
Call buy("매수",Atstop,Def,opend+var10*S1)
End If
If Cond2=False Then
Call sell("매도",Atstop,Def,opend-var10*s1)
End If
End If
If position<>0 Then
Call exitlong("매수청산",Atstop,hhv(1,high,barnumsinceentry+1)-atr(20)*s2)
Call exitshort("매도청산",Atstop,llv(1,low,barnumsinceentry+1)+atr(20)*s2)
End If
4번째
Input: s1(0.37), s2(2.7)
Var1=highd(1)
Var2=lowd(1)
Var3=closed(2)
Var10=max(Var1,Var3)-min(Var2,Var3)
Cond1= tdate=exitdate(1) And position(1)=1
Cond2= tdate=exitdate(1) And position(1)=-1
If Ttime<1500 Then
If Cond1=False Then
Call buy("매수",Atstop,Def,opend+var10*S1)
End If
If Cond2=False Then
Call sell("매도",Atstop,Def,opend-var10*s1)
End If
End If
If position<>0 Then
Call exitlong("매수청산",Atstop,hhv(1,high,barnumsinceentry+1)-atr(20)*s2)
Call exitshort("매도청산",Atstop,llv(1,low,barnumsinceentry+1)+atr(20)*s2)
End If
5번째
Input: len1(3), len2(2), level(0.13), s2(2.7), s3(0.01)
Var1=opend+(highd(1)-lowd(1))*level
Var2=opend-(highd(1)-lowd(1))*level
Cond1= tdate=exitdate(1) And position(1)=1
Cond2= tdate=exitdate(1) And position(1)=-1
If ttime<1500 Then
If Var1<high Then
If countwhen(high>high(1),len1)=len1 Then
If Cond1=False Then
Call buy("매수",Atstop,Def,high+Atr(20)*S3)
End If
End If
End If
If Var2>low Then
If countwhen(low<low(1),len2)=len2 Then
If Cond2=False Then
Call sell("매도",Atstop,Def,low-Atr(20)*S3)
End If
End If
End If
End If
If position<>0 Then
Call exitlong("추적스탑",Atstop,hhv(1,high,barnumsinceentry+1)-atr(20)*s2)
Call exitshort("추적스탑",Atstop,llv(1,low,barnumsinceentry+1)+atr(20)*S2)
End If
6번째
Input: len1(2), len2(2), level(0), s2(2.7), s3(0.01)
Var1=opend+(highd(1)-lowd(1))*level
Var2=opend-(highd(1)-lowd(1))*level
Cond1= tdate=exitdate(1) And position(1)=1
Cond2= tdate=exitdate(1) And position(1)=-1
If ttime<1500 Then
If Var1<=close Then
If countwhen(close>open,len1)=len1 And countwhen(close>close(1),len1)=len1 _
And countwhen(high>high(1),len1)=len1 Then
If Cond1=False Then
Call buy("매수",Atstop,Def,high+Atr(20)*S3)
End If
End If
End If
If Var2>close Then
If countwhen(close<open,len2)=len2 And countwhen(close<close(1),len2)=len2 _
And countwhen(low<low(1),len2)=len2 Then
If Cond2=False Then
Call sell("매도",Atstop,Def,low-Atr(20)*S3)
End If
End If
End If
End If
If position<>0 Then
Call exitlong("추적스탑",Atstop,hhv(1,high,barnumsinceentry+1)-atr(20)*s2)
Call exitshort("추적스탑",Atstop,llv(1,low,barnumsinceentry+1)+atr(20)*S2)
End If
7번째
Input: s2(2.7), len1(3), len2(2), s3(0.9), s4(0.29)
Var1=high-low '봉의 Range
Var10=high+low
If open>=close Then
Var2=open-close '음봉 body
Elseif close>open Then
Var2=close-open '양봉 body
End If
Cond1=close(1)<open(1) And close>open And close>open(1) And close(1)>open
'bull engulfing
Cond2=close(1)>open(1) And close<open And close<open(1) And close(1)<open
'bear engulfing
Cond3=var2*2<min(open,close)-low And Var10*0.7 < max(open,close)
'hammer, hanging man
Cond4=var2*2<high-max(open,close) And Var10*0.3 > min(open,close)
'inverted hammer 'shooting star
Cond5= open=close 'doji
Cond6= open=close And close>var10*0.7 'dragonfly doji
Cond7= open=close And close<var10*0.3 'garvestone
Cond8=close(1)<open(1) And close>open And close>var10(1)*0.5 _
And close(1)>open And close<open(1) 'piercing
Cond9=close(1)>open(1) And close<open And close<var10(1)*0.5 _
And close(1)<open And close>open(1) 'dark cloud
' 세개의 봉
Cond10=close(2)>open(2) And Var1(2)>var1(1) And close(1)>open(1) _
And close(2)<close(1) And close(2)<open(1) _
And open>close And close>close(2) 'evening star
Cond11=close(2)<open(2) And Var1(2)>var1(1) And close(1)<open(1) _
And close(2)>close(1) And close(2)>open(1) _
And open<close And close<close(2) 'morning star
If ttime<1500 Then
If opend<=close Then
If llv(1,low,len1)=low Then
If Cond4 Or Cond5 Or Cond6 Then
Call buy("매수",Atstop,Def,high+Atr(20)*S3)
End If
End If
End If
If opend>close Then
If hhv(1,high,len1)=high Then
If Cond4 Or Cond5 Or Cond7 Then
Call sell("매도",Atstop,Def,low-Atr(20)*S3)
end If
End If
End If
End If
If ttime<1500 Then
If opend<=close Then
If llv(1,low,len2)=low Then
If Cond11 Or Cond1 Or Cond8 Then
Call buy("매수",Atstop,Def,high+Atr(20)*S4)
End If
End If
End If
If opend>close Then
If hhv(1,high,len2)=high Then
If Cond10 Or Cond2 Or Cond9 Then
Call sell("매도",Atstop,Def,low-Atr(20)*S4)
End If
End If
End If
End If
If tdate<>tdate(1) Then
Var50=currententrynum
End If
Cond50= tdate=exitdate(1) And position(1)=1
Cond49= tdate=exitdate(1) And position(1)=-1
If currententrynum-var50<=1 Then
If ttime <1500 Then
If opend>highd(1) Then
If Cond50=False Then
Call buy("GapUp매수",Atstop,Def,opend+(highd(1)-lowd(1))*0.3)'
End If
If Cond49=False Then
Call sell("GapFill매도",Atstop,Def,max(highd(1),opend-(highd(1)-lowd(1))*0.2))
End If
End If
If opend<lowd(1) Then
If Cond49=False Then
Call sell("GapDown매도",Atstop,Def,opend-(highd(1)-lowd(1))*0.3)
End If
If Cond50=False Then
Call buy("GapFill매수",Atstop,Def,min(lowd(1),opend+(highd(1)-lowd(1))*0.2))
End If
End If
End If
End If
If position<>0 Then
Call exitlong("추적스탑",Atstop,hhv(1,high,barnumsinceentry+1)-atr(20)*s2)
Call exitshort("추적스탑",Atstop,llv(1,low,barnumsinceentry+1)+atr(20)*S2)
End If
답변 1
예스스탁 예스스탁 답변
2012-04-05 14:19:00
안녕하세요
예스스탁입니다.
1번째
Input: ups(0.1), dns(0.1), gapup(0.29), gapfill(0.18), s2(2.7);
var : Cond1(false),cond2(false);
If OpenD(0)>highd(1) then{
Var1=100*((OpenD(0)-highd(1))/highd(1));
}
If OpenD(0)<lowd(1) then{
Var1=100*((lowd(1)-OpenD(0))/lowd(1));
}
If sdate<>sdate[1] then{
Var50=TotalTrades;
}
Cond1=exitdate(1)==sdate And marketposition(1)==1;
Cond2=exitdate(1)==sdate And marketposition(1)==-1;
If TotalTrades-var50<=2 then{
If stime <150000 then{
If OpenD(0)>highd(1) And Var1>ups then{
If Cond1==False then{
buy("GapUp매수",Atstop,OpenD(0)+(highd(1)-lowd(1))*gapup);
}
If Cond2==False then{
sell("GapFill매도",Atstop,max(highd(1),OpenD(0)-(highd(1)-lowd(1))*gapfill));
}
}
If OpenD(0)<lowd(1) And Var1>dns then{
If Cond2==False then{
sell("GapDown매도",Atstop,OpenD(0)-(highd(1)-lowd(1))*gapup);
}
If Cond1==False then{
buy("GapFill매수",Atstop,min(lowd(1),OpenD(0)+(highd(1)-lowd(1))*gapfill));
}
}
}
}
If marketposition<>0 then{
exitlong("매수추적",Atstop,highest(high,barssinceentry+1)-atr(20)*S2);
exitshort("매도추적",Atstop,lowest(low,barssinceentry+1)+atr(20)*S2);
}
2번째
Input: ups(0.5), dns(0.3), gapup(0.34), gapfill(0.19), s2(2.7);
var : Cond1(false),cond2(false);
If OpenD(0)>=closed(1) then{
Var1=100*((OpenD(0)-closed(1))/closed(1));
}
If OpenD(0)<closed(1) then{
Var1=100*((closed(1)-OpenD(0))/closed(1));
}
If sdate<>sdate[1] then{
Var3=0;
}
Else{
If marketposition<>0 And marketposition[1]<>marketposition then{
Var3=var3+1;
}
}
If sdate<>sdate[1] then{
Var50=TotalTrades;
}
Cond1=exitdate(1)==sdate And marketposition(1)==1;
Cond2=exitdate(1)==sdate And marketposition(1)==-1;
If TotalTrades-var50<=1 then{
If stime <150000 then{
If OpenD(0)>closed(1) And Var1>ups then{
If Cond1==False then{
buy("GapUp매수",Atstop,OpenD(0)+(highd(1)-lowd(1))*gapup);
}
If Cond2==False then{
sell("GapFill매도",Atstop,max(closed(1),OpenD(0)-(highd(1)-lowd(1))*gapfill));
}
}
If OpenD(0)<closed(1) And Var1>dns then{
If Cond2==False then{
sell("GapDown매도",Atstop,OpenD(0)-(highd(1)-lowd(1))*gapup);
}
If Cond1==False then{
buy("GapFill매수",Atstop,min(closed(1),OpenD(0)+(closed(1)-lowd(1))*gapfill));
}
}
}
}
If marketposition<>0 then{
exitlong("매수추적",Atstop,highest(high,barssinceentry+1)-atr(10)*s2);
exitshort("매도추적",Atstop,lowest(low,barssinceentry+1)+atr(10)*S2);
}
3번째
Input: s1(0.48), s2(2.7);
var : Cond1(false),cond2(false);
Var1=highd(1);
Var2=closed(1);
Var3=lowd(1);
Var4=closed(1);
If abs(Var1-var4)>=abs(Var2-var3) then
Var10=abs(Var1-var4);
Else
Var10=abs(Var2-var3);
Cond1= sdate==exitdate(1) And marketposition(1)==1;
Cond2= sdate==exitdate(1) And marketposition(1)==-1;
If stime<150000 then{
If Cond1==False then{
buy("매수",Atstop,OpenD(0)+var10*S1);
}
If Cond2==False then{
sell("매도",Atstop,OpenD(0)-var10*s1);
}
}
If marketposition<>0 then{
exitlong("매수청산",Atstop,highest(high,barssinceentry+1)-atr(20)*s2);
exitshort("매도청산",Atstop,lowest(low,barssinceentry+1)+atr(20)*s2);
}
4번째
Input: s1(0.37), s2(2.7);
var : Cond1(false),cond2(false);
Var1=highd(1);
Var2=lowd(1);
Var3=closed(2);
Var10=max(Var1,Var3)-min(Var2,Var3);
Cond1= sdate==exitdate(1) And marketposition(1)==1;
Cond2= sdate==exitdate(1) And marketposition(1)==-1;
If stime<150000 then{
If Cond1==False then{
buy("매수",Atstop,OpenD(0)+var10*S1);
}
If Cond2==False then{
sell("매도",Atstop,OpenD(0)-var10*s1);
}
}
If marketposition<>0 then{
exitlong("매수청산",Atstop,highest(high,barssinceentry+1)-atr(20)*s2);
exitshort("매도청산",Atstop,lowest(low,barssinceentry+1)+atr(20)*s2);
}
5번째
Input: len1(3), len2(2), level(0.13), s2(2.7), s3(0.01);
var : Cond1(false),cond2(false);
Var1=OpenD(0)+(highd(1)-lowd(1))*level;
Var2=OpenD(0)-(highd(1)-lowd(1))*level;
Cond1= sdate==exitdate(1) And marketposition(1)==1;
Cond2= sdate==exitdate(1) And marketposition(1)==-1;
If stime<150000 then{
If Var1<high then{
If countif(high>high[1],len1)==len1 then{
If Cond1==False then{
buy("매수",Atstop,high+Atr(20)*S3);
}
}
}
If Var2>low then{
If countif(low<low[1],len2)==len2 then{
If Cond2==False then{
sell("매도",Atstop,low-Atr(20)*S3);
}
}
}
}
If marketposition<>0 then{
exitlong("추적스탑1",Atstop,highest(high,barssinceentry+1)-atr(20)*s2);
exitshort("추적스탑2",Atstop,lowest(low,barssinceentry+1)+atr(20)*S2);
}
6번째
Input: len1(2), len2(2), level(0), s2(2.7), s3(0.01);
var : Cond1(false),cond2(false);
Var1=OpenD(0)+(highd(1)-lowd(1))*level;
Var2=OpenD(0)-(highd(1)-lowd(1))*level;
Cond1= sdate==exitdate(1) And marketposition(1)==1;
Cond2= sdate==exitdate(1) And marketposition(1)==-1;
If stime<150000 then{
If Var1<=close then{
If countif(close>open,len1)==len1 And countif(close>close[1],len1)==len1 And countif(high>high[1],len1)==len1 then{
If Cond1==False then{
buy("매수",Atstop,high+Atr(20)*S3);
}
}
}
If Var2>close then{
If countif(close<open,len2)==len2 And countif(close<close[1],len2)==len2 And countif(low<low[1],len2)==len2 then{
If Cond2==False then{
sell("매도",Atstop,low-Atr(20)*S3);
}
}
}
}
If marketposition<>0 then{
exitlong("추적스탑1",Atstop,highest(high,barssinceentry+1)-atr(20)*s2);
exitshort("추적스탑2",Atstop,lowest(low,barssinceentry+1)+atr(20)*S2);
}
7번째
Input: s2(2.7), len1(3), len2(2), s3(0.9), s4(0.29);
var : cond1(false),cond2(false),cond3(false),cond4(false),cond5(false),cond6(false),cond7(false),cond8(false);
var : cond9(false),cond10(false),cond11(false),cond49(false),cond50(false);
Var1=high-low;# '봉의 Range
Var10=high+low;
If open>=close then{
Var2=open-close;# '음봉 body
}
Else if close>open then{
Var2=close-open;# '양봉 body
}
Cond1=close[1]<open[1] And close>open And close>open[1] And close[1]>open;
#'bull engulfing
Cond2=close[1]>open[1] And close<open And close<open[1] And close[1]<open;
#'bear engulfing
Cond3=var2*2<min(open,close)-low And Var10*0.7 < max(open,close);
#'hammer, hanging man
Cond4=var2*2<high-max(open,close) And Var10*0.3 > min(open,close);
#'inverted hammer 'shooting star
Cond5= open==close; #'doji
Cond6= open==close And close>var10*0.7;# 'dragonfly doji
Cond7= open==close And close<var10*0.3;# 'garvestone
Cond8=close[1]<open[1] And close>open And close>var10[1]*0.5 And close[1]>open And close<open[1];# 'piercing
Cond9=close[1]>open[1] And close<open And close<var10[1]*0.5 And close[1]<open And close>open[1];# 'dark cloud
#' 세개의 봉
Cond10=close[2]>open[2] And Var1[2]>var1[1] And close[1]>open[1] And close[2]<close[1] And close[2]<open[1]
And open>close And close>close[2];# 'evening star
Cond11=close[2]<open[2] And Var1[2]>var1[1] And close[1]<open[1] And close[2]>close[1] And close[2]>open[1]
And open<close And close<close[2];# 'morning star
If stime<150000 then{
If OpenD(0)<=close then{
If lowest(low,len1)==low then{
If Cond4 Or Cond5 Or Cond6 then{
buy("매수1",Atstop,high+Atr(20)*S3);
}
}
}
If OpenD(0)>close then{
If highest(high,len1)==high then{
If Cond4 Or Cond5 Or Cond7 then{
sell("매도1",Atstop,low-Atr(20)*S3);
}
}
}
}
If stime<1500 then{
If OpenD(0)<=close then{
If lowest(low,len2)==low then{
If Cond11 Or Cond1 Or Cond8 then{
buy("매수2",Atstop,high+Atr(20)*S4);
}
}
}
If OpenD(0)>close then{
If highest(high,len2)==high then{
If Cond10 Or Cond2 Or Cond9 then{
sell("매도2",Atstop,low-Atr(20)*S4);
}
}
}
}
If sdate<>sdate[1] then{
Var50=TotalTrades;
}
Cond50= sdate==exitdate(1) And marketposition(1)==1;
Cond49= sdate==exitdate(1) And marketposition(1)==-1;
If TotalTrades-var50<=1 then{
If stime <150000 then{
If OpenD(0)>highd(1) then{
If Cond50==False then{
buy("GapUp매수",Atstop,OpenD(0)+(highd(1)-lowd(1))*0.3);
}
If Cond49==False then{
sell("GapFill매도",Atstop,max(highd(1),OpenD(0)-(highd(1)-lowd(1))*0.2));
}
}
If OpenD(0)<lowd(1) then{
If Cond49==False then{
sell("GapDown매도",Atstop,OpenD(0)-(highd(1)-lowd(1))*0.3);
}
If Cond50==False then{
buy("GapFill매수",Atstop,min(lowd(1),OpenD(0)+(highd(1)-lowd(1))*0.2));
}
}
}
}
If marketposition<>0 then{
exitlong("추적스탑1",Atstop,highest(high,barssinceentry+1)-atr(20)*s2);
exitshort("추적스탑2",Atstop,lowest(low,barssinceentry+1)+atr(20)*S2);
}
즐거운 하루되세요
> rlaxoeh 님이 쓴 글입니다.
> 제목 : ct를 yt로 변경 부탁 드립니다.
> 안녕 하세요,,
아래의 7개의 ct를 yt로 변경 부탁 드립니다..
1번째
Input: ups(0.1), dns(0.1), gapup(0.29), gapfill(0.18), s2(2.7)
If opend>highd(1) Then
Var1=100*((opend-highd(1))/highd(1))
End If
If opend<lowd(1) Then
Var1=100*((lowd(1)-opend)/lowd(1))
End If
If tdate<>tdate(1) Then
Var50=currententrynum
End If
Cond1=exitdate(1)=tdate And position(1)=1
Cond2=exitdate(1)=tdate And position(1)=-1
If currententrynum-var50<=2 Then
If ttime <1500 Then
If opend>highd(1) And Var1>ups Then
If Cond1=False Then
Call buy("GapUp매수",Atstop,Def,opend+(highd(1)-lowd(1))*gapup)
End If
If Cond2=False Then
Call sell("GapFill매도",Atstop,Def, _
max(highd(1),opend-(highd(1)-lowd(1))*gapfill))
End If
End If
If opend<lowd(1) And Var1>dns Then
If Cond2=False Then
Call sell("GapDown매도",Atstop,Def,opend-(highd(1)-lowd(1))*gapup)
End If
If Cond1=False Then
Call buy("GapFill매수",Atstop,Def,_
min(lowd(1),opend+(highd(1)-lowd(1))*gapfill))
End If
End If
End If
End If
If position<>0 Then
Call exitlong("매수추적",Atstop,hhv(1,high,barnumsinceentry+1)-atr(20)*S2)
Call exitshort("매도추적",Atstop,llv(1,low,barnumsinceentry+1)+atr(20)*S2)
End If
2번째
Input: ups(0.5), dns(0.3), gapup(0.34), gapfill(0.19), s2(2.7)
If opend>=closed(1) Then
Var1=100*((opend-closed(1))/closed(1))
End If
If opend<closed(1) Then
Var1=100*((closed(1)-opend)/closed(1))
End If
If tdate<>tdate(1) Then
Var3=0
Else
If i_position<>0 And i_position(1)<>i_position Then
Var3=var3+1
End If
End If
If tdate<>tdate(1) Then
Var50=currententrynum
End If
Cond1=exitdate(1)=tdate And position(1)=1
Cond2=exitdate(1)=tdate And position(1)=-1
If currententrynum-var50<=1 Then
If ttime <1500 Then
If opend>closed(1) And Var1>ups Then
If Cond1=False then
Call buy("GapUp매수",Atstop,Def,opend+(highd(1)-lowd(1))*gapup)
End If
If Cond2=False then
Call sell("GapFill매도",Atstop,Def,max(closed(1),opend-(highd(1)-lowd(1))*gapfill))
End If
End If
If opend<closed(1) And Var1>dns Then
If Cond2=False Then
Call sell("GapDown매도",Atstop,Def,opend-(highd(1)-lowd(1))*gapup)
End If
If Cond1=False Then
Call buy("GapFill매수",Atstop,Def,min(closed(1),opend+(closed(1)-lowd(1))*gapfill))
End If
End If
End If
End If
If position<>0 Then
Call exitlong("매수추적",Atstop,hhv(1,high,barnumsinceentry+1)-atr(10)*s2)
Call exitshort("매도추적",Atstop,llv(1,low,barnumsinceentry+1)+atr(10)*S2)
End If
3번째
Input: s1(0.48), s2(2.7)
Var1=highd(1)
Var2=closed(1)
Var3=lowd(1)
Var4=closed(1)
If abs(Var1-var4)>=abs(Var2-var3) Then
Var10=abs(Var1-var4)
Else
Var10=abs(Var2-var3)
End If
Cond1= tdate=exitdate(1) And position(1)=1
Cond2= tdate=exitdate(1) And position(1)=-1
If Ttime<1500 Then
If Cond1=False Then
Call buy("매수",Atstop,Def,opend+var10*S1)
End If
If Cond2=False Then
Call sell("매도",Atstop,Def,opend-var10*s1)
End If
End If
If position<>0 Then
Call exitlong("매수청산",Atstop,hhv(1,high,barnumsinceentry+1)-atr(20)*s2)
Call exitshort("매도청산",Atstop,llv(1,low,barnumsinceentry+1)+atr(20)*s2)
End If
4번째
Input: s1(0.37), s2(2.7)
Var1=highd(1)
Var2=lowd(1)
Var3=closed(2)
Var10=max(Var1,Var3)-min(Var2,Var3)
Cond1= tdate=exitdate(1) And position(1)=1
Cond2= tdate=exitdate(1) And position(1)=-1
If Ttime<1500 Then
If Cond1=False Then
Call buy("매수",Atstop,Def,opend+var10*S1)
End If
If Cond2=False Then
Call sell("매도",Atstop,Def,opend-var10*s1)
End If
End If
If position<>0 Then
Call exitlong("매수청산",Atstop,hhv(1,high,barnumsinceentry+1)-atr(20)*s2)
Call exitshort("매도청산",Atstop,llv(1,low,barnumsinceentry+1)+atr(20)*s2)
End If
5번째
Input: len1(3), len2(2), level(0.13), s2(2.7), s3(0.01)
Var1=opend+(highd(1)-lowd(1))*level
Var2=opend-(highd(1)-lowd(1))*level
Cond1= tdate=exitdate(1) And position(1)=1
Cond2= tdate=exitdate(1) And position(1)=-1
If ttime<1500 Then
If Var1<high Then
If countwhen(high>high(1),len1)=len1 Then
If Cond1=False Then
Call buy("매수",Atstop,Def,high+Atr(20)*S3)
End If
End If
End If
If Var2>low Then
If countwhen(low<low(1),len2)=len2 Then
If Cond2=False Then
Call sell("매도",Atstop,Def,low-Atr(20)*S3)
End If
End If
End If
End If
If position<>0 Then
Call exitlong("추적스탑",Atstop,hhv(1,high,barnumsinceentry+1)-atr(20)*s2)
Call exitshort("추적스탑",Atstop,llv(1,low,barnumsinceentry+1)+atr(20)*S2)
End If
6번째
Input: len1(2), len2(2), level(0), s2(2.7), s3(0.01)
Var1=opend+(highd(1)-lowd(1))*level
Var2=opend-(highd(1)-lowd(1))*level
Cond1= tdate=exitdate(1) And position(1)=1
Cond2= tdate=exitdate(1) And position(1)=-1
If ttime<1500 Then
If Var1<=close Then
If countwhen(close>open,len1)=len1 And countwhen(close>close(1),len1)=len1 _
And countwhen(high>high(1),len1)=len1 Then
If Cond1=False Then
Call buy("매수",Atstop,Def,high+Atr(20)*S3)
End If
End If
End If
If Var2>close Then
If countwhen(close<open,len2)=len2 And countwhen(close<close(1),len2)=len2 _
And countwhen(low<low(1),len2)=len2 Then
If Cond2=False Then
Call sell("매도",Atstop,Def,low-Atr(20)*S3)
End If
End If
End If
End If
If position<>0 Then
Call exitlong("추적스탑",Atstop,hhv(1,high,barnumsinceentry+1)-atr(20)*s2)
Call exitshort("추적스탑",Atstop,llv(1,low,barnumsinceentry+1)+atr(20)*S2)
End If
7번째
Input: s2(2.7), len1(3), len2(2), s3(0.9), s4(0.29)
Var1=high-low '봉의 Range
Var10=high+low
If open>=close Then
Var2=open-close '음봉 body
Elseif close>open Then
Var2=close-open '양봉 body
End If
Cond1=close(1)<open(1) And close>open And close>open(1) And close(1)>open
'bull engulfing
Cond2=close(1)>open(1) And close<open And close<open(1) And close(1)<open
'bear engulfing
Cond3=var2*2<min(open,close)-low And Var10*0.7 < max(open,close)
'hammer, hanging man
Cond4=var2*2<high-max(open,close) And Var10*0.3 > min(open,close)
'inverted hammer 'shooting star
Cond5= open=close 'doji
Cond6= open=close And close>var10*0.7 'dragonfly doji
Cond7= open=close And close<var10*0.3 'garvestone
Cond8=close(1)<open(1) And close>open And close>var10(1)*0.5 _
And close(1)>open And close<open(1) 'piercing
Cond9=close(1)>open(1) And close<open And close<var10(1)*0.5 _
And close(1)<open And close>open(1) 'dark cloud
' 세개의 봉
Cond10=close(2)>open(2) And Var1(2)>var1(1) And close(1)>open(1) _
And close(2)<close(1) And close(2)<open(1) _
And open>close And close>close(2) 'evening star
Cond11=close(2)<open(2) And Var1(2)>var1(1) And close(1)<open(1) _
And close(2)>close(1) And close(2)>open(1) _
And open<close And close<close(2) 'morning star
If ttime<1500 Then
If opend<=close Then
If llv(1,low,len1)=low Then
If Cond4 Or Cond5 Or Cond6 Then
Call buy("매수",Atstop,Def,high+Atr(20)*S3)
End If
End If
End If
If opend>close Then
If hhv(1,high,len1)=high Then
If Cond4 Or Cond5 Or Cond7 Then
Call sell("매도",Atstop,Def,low-Atr(20)*S3)
end If
End If
End If
End If
If ttime<1500 Then
If opend<=close Then
If llv(1,low,len2)=low Then
If Cond11 Or Cond1 Or Cond8 Then
Call buy("매수",Atstop,Def,high+Atr(20)*S4)
End If
End If
End If
If opend>close Then
If hhv(1,high,len2)=high Then
If Cond10 Or Cond2 Or Cond9 Then
Call sell("매도",Atstop,Def,low-Atr(20)*S4)
End If
End If
End If
End If
If tdate<>tdate(1) Then
Var50=currententrynum
End If
Cond50= tdate=exitdate(1) And position(1)=1
Cond49= tdate=exitdate(1) And position(1)=-1
If currententrynum-var50<=1 Then
If ttime <1500 Then
If opend>highd(1) Then
If Cond50=False Then
Call buy("GapUp매수",Atstop,Def,opend+(highd(1)-lowd(1))*0.3)'
End If
If Cond49=False Then
Call sell("GapFill매도",Atstop,Def,max(highd(1),opend-(highd(1)-lowd(1))*0.2))
End If
End If
If opend<lowd(1) Then
If Cond49=False Then
Call sell("GapDown매도",Atstop,Def,opend-(highd(1)-lowd(1))*0.3)
End If
If Cond50=False Then
Call buy("GapFill매수",Atstop,Def,min(lowd(1),opend+(highd(1)-lowd(1))*0.2))
End If
End If
End If
End If
If position<>0 Then
Call exitlong("추적스탑",Atstop,hhv(1,high,barnumsinceentry+1)-atr(20)*s2)
Call exitshort("추적스탑",Atstop,llv(1,low,barnumsinceentry+1)+atr(20)*S2)
End If
이전글