커뮤니티
변환요청
2012-01-19 09:06:12
375
글번호 46804
전략변환중인데 잘 안되는 부분이 있네요..
대략바꿨는데 점검부탁드립니다
VAR1:CNT(0),COUNT(0);
VAR2:HIGHD(1)-LOWD(1);
Condition1=date==ExitDate(1) and MarketPosition(1)==1;
Condition2=date==ExitDate(1) and MarketPosition(1)==-1;
Condition10=highd<=closed(1)-var2*0.2;
Condition11=lowd>=closed(1)+var2*0.2;
Condition20=high<=closed(1)-var2*0.2;
Condition21=low<=closed(1)+var2*0.2;
count = 0;
for cnt = 0 to 10{
if EntryDate(cnt) ==sdate Then
count = count+1;
}
if count==0 and stime<150000 then {
buy ("매수",atstop,opend+var2*0.32)
sell("매도",atstop,opend-var2*0.32)
}
if count==1 and MarketPosition==0 Then {
if stime<150000 then {
if condition1=false then{
if condition10 or condition20 Then
buy("매수2",atstop,opend+var2*0.06)
}
}
if condition2=false then{
if condition11 or condition21 Then
sell("매도2",atstop,opend-var2*0.06)
}
}
}
if MarketPosition<>0 Then{
ExitLong("el",AtStop,Highest(h,BarsSinceEntry+1)-atr(40)*3.5);
ExitShort("es",atstop,Lowest(l,BarsSinceEntry+1)+atr(40)*3.5);
}
답변 1
예스스탁 예스스탁 답변
2012-01-19 09:59:59
안녕하세요
예스스탁입니다.
VAR : CNT(0),COUNT(0);
VAR2 = HIGHD(1)-LOWD(1);
Condition1=date==ExitDate(1) and MarketPosition(1)==1;
Condition2=date==ExitDate(1) and MarketPosition(1)==-1;
Condition10=highd(0)<=closed(1)-var2*0.2;
Condition11=lowd(0)>=closed(1)+var2*0.2;
Condition20=high<=closed(1)-var2*0.2;
Condition21=low<=closed(1)+var2*0.2;
count = 0;
for cnt = 0 to 10{
if EntryDate(cnt) ==sdate Then
count = count+1;
}
if count==0 and stime<150000 then {
buy ("매수",atstop,opend(0)+var2*0.32);
sell("매도",atstop,opend(0)-var2*0.32);
}
if count==1 and MarketPosition==0 Then {
if stime<150000 then {
if condition1==false then{
if condition10 or condition20 Then{
buy("매수2",atstop,opend(0)+var2*0.06);
}
}
if condition2==false then{
if condition11 or condition21 Then
sell("매도2",atstop,opend(0)-var2*0.06);
}
}
}
if MarketPosition<>0 Then{
ExitLong("el",AtStop,Highest(h,BarsSinceEntry+1)-atr(40)*3.5);
ExitShort("es",atstop,Lowest(l,BarsSinceEntry+1)+atr(40)*3.5);
}
즐거운 하루되세요
> 사이버썁 님이 쓴 글입니다.
> 제목 : 변환요청
> 전략변환중인데 잘 안되는 부분이 있네요..
대략바꿨는데 점검부탁드립니다
VAR1:CNT(0),COUNT(0);
VAR2:HIGHD(1)-LOWD(1);
Condition1=date==ExitDate(1) and MarketPosition(1)==1;
Condition2=date==ExitDate(1) and MarketPosition(1)==-1;
Condition10=highd<=closed(1)-var2*0.2;
Condition11=lowd>=closed(1)+var2*0.2;
Condition20=high<=closed(1)-var2*0.2;
Condition21=low<=closed(1)+var2*0.2;
count = 0;
for cnt = 0 to 10{
if EntryDate(cnt) ==sdate Then
count = count+1;
}
if count==0 and stime<150000 then {
buy ("매수",atstop,opend+var2*0.32)
sell("매도",atstop,opend-var2*0.32)
}
if count==1 and MarketPosition==0 Then {
if stime<150000 then {
if condition1=false then{
if condition10 or condition20 Then
buy("매수2",atstop,opend+var2*0.06)
}
}
if condition2=false then{
if condition11 or condition21 Then
sell("매도2",atstop,opend-var2*0.06)
}
}
}
if MarketPosition<>0 Then{
ExitLong("el",AtStop,Highest(h,BarsSinceEntry+1)-atr(40)*3.5);
ExitShort("es",atstop,Lowest(l,BarsSinceEntry+1)+atr(40)*3.5);
}