===============시스템 1=========================== 입력변수 ups(0.1) dns(0.1) gapup(0.3) gapfill(0.3) s2(3.0) If opend>highd(1) Then '시가가 전일고가보다 크면 Var1=100*((opend-highd(1))/highd(1)) '전일고가대비 시가의 위치 End If If opendtdate(1) Then Var50=currententrynum End If Cond1=exitdate(1)=tdate And position(1)=1 '최근청산날짜가 금일이고 직전이 매수 Cond2=exitdate(1)=tdate And position(1)=-1 '최근청산날짜가 금일이고 직전이 매도 '하루에 3번만 진입 If currententrynum-var50<=2 Then If ttime <1500 Then If opend>highd(1) And Var1>ups Then '시가가 전일고가보다 크고 Var1이 ups보다 크면 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 openddns Then '시가가 전일저가보다 작고 Var1이 dns보다 크면 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=========================== 입력변수 len1(10) len2(20) ob1(90) os1(10) ob2(70) os2(30) level(0.01) s2(3.0) Var1=fastk(len1) Var2=fastk(len2) Cond1=var1>ob1 And Var2>ob2 '과매수 Cond2=var1close Then '종가가 시가보다 작으면 'Call sell("매도",Atstop,Def,low-Atr(20)*level)'지정가 하향돌파시 매도 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