예스스탁
예스스탁 답변
2009-09-14 14:02:38
안녕하세요
예스스탁입니다.
var : cnt(0),currententrynum(0),Cond37(False),Cond35(False),Cond36(False);
for cnt = 0 to 20{
if sdate == EntryDate(cnt) Then
currententrynum = currententrynum+1;
}
If sDate <> sdate[1] Then {
Var49=index;
Var32=netprofit;
Cond37=False ;
}
If index-var49==0 Then {
Var33=open ;
Var34=high ;
Var35=low ;
Var36=close;
}
If index-var49==1 Then {
Var43=open ;
Var44=high;
Var45=low;
Var46=close ;
}
If index-var49==2 Then {
Var47=open;
Var48=close ;
}
Cond35= Var36>var33 And Var46>var43 And Var48>var47 ;
Cond36= Var36=1500000 Then
Cond37=True;
If index-var49==1 Then {
Var1=NthHighest(1,high,2)-atr(20)*0.18 ;
Var2=NthLowest(1,low,2)+atr(20)*0.18;
}
If index-var49==2 Then {
Var3=NthHighest(1,high,3)-atr(20)*0.18;
Var4=NthLowest(1,low,3)+atr(20)*0.18 ;
}
If Cond35 ==True Or Cond36==True Then {
If index-var49 > 2 And stime < 150000 Then {
If currententrynum ==0 Then {
buy("b",Atstop,Def,Var3) ;
sell("s",Atstop,Def,Var4);
}
}
}
If MarketPosition <> 0 Then {
exitlong("bx",Atstop,NthHighest(1,high,BarsSinceEntry+1)-atr(20)*2.7);
exitshort("sx",Atstop,NthLowest(1,low,BarsSinceEntry+1)+atr(20)*2.7) ;
}
If MarketPosition ==1 Then
exitlong("손절bx",Atstop,entryprice*(1-0.01));
If MarketPosition ==-1 then
ExitShort("손절sx",Atstop,entryprice*(1+0.01));
즐거운 하루되세요
> 헐레 님이 쓴 글입니다.
> 제목 : yt로 변환 부탁드립니다.
> SetBarOneEntry
If tdate <> tdate(1) Then
Var50=currententrynum
Var49=barnum
Var32=i_netprofit
Cond37=False
End if
If barnum-var49=0 Then
Var33=open
Var34=high
Var35=low
Var36=close
End If
If barnum-var49=1 Then
Var43=open
Var44=high
Var45=low
Var46=close
End if
If barnum-var49=2 Then
Var47=open
Var48=close
End If
Cond35= Var36>var33 And Var46>var43 And Var48>var47
Cond36= Var36=1500000 Then
Cond37=True
End If
If barnum-var49=1 Then
Var1=hhv(1,high,2)-atr(20)*0.18
Var2=llv(1,low,2)+atr(20)*0.18
End If
If barnum-var49=2 Then
Var3=hhv(1,high,3)-atr(20)*0.18
Var4=llv(1,low,3)+atr(20)*0.18
End If
If Cond35 =True Or Cond36=True Then
If barnum-var49 > 2 And ttime <1500 Then
If currententrynum-var50<=0 Then
Call buy("b",Atstop,Def,Var3)
Call sell("s",Atstop,Def,Var4)
End If
End If
End If
If position <> 0 Then
Call exitlong("bx",Atstop,hhv(1,high,barnumsinceentry+1)-atr(20)*2.7)
Call exitshort("sx",Atstop,llv(1,low,barnumsinceentry+1)+atr(20)*2.7)
End If
If position =1 Then
Call exitlong("손절bx",Atstop,entryprice*(1-0.01))
End If
If position =-1 then
Call exitshort("손절sx",Atstop,entryprice*(1+0.01))
End If
예스스탁
예스스탁 답변
2009-09-14 14:56:41
안녕하세요
예스스탁입니다.
var : cnt(0),currententrynum(0),Cond37(False),Cond35(False),Cond36(False);
#당일 진입횟수 카운트(식상 내용이 당일 1회진입입니다.)
currententrynum = 0;
for cnt = 0 to 20{ # 최근 20개의 진입의 날짜를 오늘날짜와 비교해서 같은게 몇번인지 카운트
if sdate == EntryDate(cnt) Then
currententrynum = currententrynum+1;
}
If sDate <> sdate[1] Then {# 날짜가 변경되면
Var49=index; # 해당봉 봉번호 저장
Var32=netprofit; # 수익저장
Cond37=False ; # cond37은 False;
}
If index-var49==0 Then { # 첫봉의
Var33=open ;#시가저장
Var34=high ;#고가저장
Var35=low ; #저가저장
Var36=close;# 종가저장
}
If index-var49==1 Then {# 두번째봉의
Var43=open ;# 시가저장
Var44=high; # 고가저장
Var45=low; #저가저장
Var46=close ; # 종가저장
}
If index-var49==2 Then { #세번재봉의
Var47=open; #시가저장
Var48=close ; # 종가저장
}
Cond35= Var36>var33 And Var46>var43 And Var48>var47 ; #첫봉이 양봉 두번째봉 양봉 세번째봉 양봉이면 true
Cond36= Var36=1500000 Then #당일 손익이 백오십만원 보다 크면
Cond37=True; #cond37은 true
If index-var49==1 Then {#당일 두번째봉에서
Var1=NthHighest(1,high,2)-atr(20)*0.18 ;# 당일최고가-atr*0.18저장
Var2=NthLowest(1,low,2)+atr(20)*0.18; #당일최저가+atr*0.18저장
}
If index-var49==2 Then {#당일 세번째봉에서
Var3=NthHighest(1,high,3)-atr(20)*0.18; # 당일최고가-atr*0.18저장
Var4=NthLowest(1,low,3)+atr(20)*0.18 ;#당일최저가+atr*0.18저장
}
If Cond35 ==True Or Cond36==True Then { #cond35나 cond436이 true이고
If index-var49 > 2 And stime < 150000 Then { # 당일 3번째봉이상이고 15시이하이면
If currententrynum ==0 Then { #당일 한번만 진입
buy("b",Atstop,Var3) ; #var3의 가격이상으로 시세가 형성되면 매수
sell("s",Atstop,Var4); #var4의 가격이하로 시세가 형성되면 매도
}
}
}
If MarketPosition <> 0 Then {
exitlong("bx",Atstop,NthHighest(1,high,BarsSinceEntry+1)-atr(20)*2.7);#매수이후 최고가-atr*2이하로 시세하락시 청산
exitshort("sx",Atstop,NthLowest(1,low,BarsSinceEntry+1)+atr(20)*2.7) ;#매수이후최저가+atr*2이상으로 시사상승시 청산
}
#1% 손실시 청산
If MarketPosition ==1 Then
exitlong("손절bx",Atstop,entryprice*(1-0.01));
If MarketPosition ==-1 then
ExitShort("손절sx",Atstop,entryprice*(1+0.01));
즐거운 하루되세요
> 헐레 님이 쓴 글입니다.
> 제목 : Re : Re : yt로 변환 부탁드립니다.
> 모르는 부분이 많아서 그런데 주석좀 달아서 설명해 주세용