커뮤니티
부탁드립니다.
2014-02-07 04:35:41
149
글번호 72288
아래처럼 시스템식을 만들어봤는데요.
b1,bx1,s1,sx1은 작동을 하는데 b2와 s2가 생기질 않는군요. 원인이 뭘까요?
(var1부터 var8까지 규정하고 난 후)
condition1=Marketposition==0 and Marketposition(1)==1 and IsExitName("bx1")==True;
condition2=Marketposition==0 and Marketposition(1)==-1 and IsExitName("sx1")==True;
If condition1==false and crossup(var5,var6) Then{
Buy("b1",onclose,1);
}
If Marketposition==1 and Isentryname("b1")==True and L<=Entryprice-0.1 Then{
Exitlong("bx1",atstop,Entryprice-0.1,def,1);
}
If condition1==True and L<=var8 Then{
Buy("b2",atlimit,var8,1);
Playsound("K:₩음성₩핀치히터매수.wav");
}
If Marketposition==1 and Isentryname("b2")==True and H>=Entryprice+1.5 Then{
Exitlong("bx2",atlimit,Entryprice+1.5,def,1);
Playsound("K:₩음성₩핀치히터청산.wav");
}
If condition2==false and crossdown(var5,var6) Then{
Sell("s1",onclose,1);
}
If Marketposition==-1 and Isentryname("s1")==True and H>=Entryprice+0.1 Then{
Exitshort("sx1",atstop,Entryprice+0.1,def,1);
}
If condition2==True and H>=var7 Then{
Sell("s2",atlimit,var7,1);
Playsound("K:₩음성₩핀치히터매도.wav");
}
If Marketposition==-1 and Isentryname("s2")==True and L<=Entryprice+1.5 Then{
Exitshort("sx2",atlimit,Entryprice-1.5,def,1);
Playsound("K:₩음성₩핀치히터청산.wav");
}
답변 1
예스스탁 예스스탁 답변
2014-02-07 13:55:50
안녕하세요
예스스탁입니다.
청삼함수의 매개변수가 잘못되어 있었습니다.
수정한 식입니다.
condition1=Marketposition==0 and Marketposition(1)==1 and IsExitName("bx1",1)==True;
condition2=Marketposition==0 and Marketposition(1)==-1 and IsExitName("sx1",1)==True;
If condition1==false and crossup(var5,var6) Then{
Buy("b1",onclose,1);
}
If Marketposition==1 and Isentryname("b1")==True and L<=Entryprice-0.1 Then{
Exitlong("bx1",atstop,Entryprice-0.1,def,1);
}
If condition1==True and L<=var8 Then{
Buy("b2",atlimit,var8,1);
Playsound("K:₩음성₩핀치히터매수.wav");
}
If Marketposition==1 and Isentryname("b2")==True and H>=Entryprice+1.5 Then{
Exitlong("bx2",atlimit,Entryprice+1.5,def,1);
Playsound("K:₩음성₩핀치히터청산.wav");
}
If condition2==false and crossdown(var5,var6) Then{
Sell("s1",onclose,1);
}
If Marketposition==-1 and Isentryname("s1")==True and H>=Entryprice+0.1 Then{
Exitshort("sx1",atstop,Entryprice+0.1,def,1);
}
If condition2==True and H>=var7 Then{
Sell("s2",atlimit,var7,1);
Playsound("K:₩음성₩핀치히터매도.wav");
}
If Marketposition==-1 and Isentryname("s2")==True and L<=Entryprice+1.5 Then{
Exitshort("sx2",atlimit,Entryprice-1.5,def,1);
Playsound("K:₩음성₩핀치히터청산.wav");
}
즐거운 하루되세요
> 묘선낭자 님이 쓴 글입니다.
> 제목 : 부탁드립니다.
> 아래처럼 시스템식을 만들어봤는데요.
b1,bx1,s1,sx1은 작동을 하는데 b2와 s2가 생기질 않는군요. 원인이 뭘까요?
(var1부터 var8까지 규정하고 난 후)
condition1=Marketposition==0 and Marketposition(1)==1 and IsExitName("bx1")==True;
condition2=Marketposition==0 and Marketposition(1)==-1 and IsExitName("sx1")==True;
If condition1==false and crossup(var5,var6) Then{
Buy("b1",onclose,1);
}
If Marketposition==1 and Isentryname("b1")==True and L<=Entryprice-0.1 Then{
Exitlong("bx1",atstop,Entryprice-0.1,def,1);
}
If condition1==True and L<=var8 Then{
Buy("b2",atlimit,var8,1);
Playsound("K:₩음성₩핀치히터매수.wav");
}
If Marketposition==1 and Isentryname("b2")==True and H>=Entryprice+1.5 Then{
Exitlong("bx2",atlimit,Entryprice+1.5,def,1);
Playsound("K:₩음성₩핀치히터청산.wav");
}
If condition2==false and crossdown(var5,var6) Then{
Sell("s1",onclose,1);
}
If Marketposition==-1 and Isentryname("s1")==True and H>=Entryprice+0.1 Then{
Exitshort("sx1",atstop,Entryprice+0.1,def,1);
}
If condition2==True and H>=var7 Then{
Sell("s2",atlimit,var7,1);
Playsound("K:₩음성₩핀치히터매도.wav");
}
If Marketposition==-1 and Isentryname("s2")==True and L<=Entryprice+1.5 Then{
Exitshort("sx2",atlimit,Entryprice-1.5,def,1);
Playsound("K:₩음성₩핀치히터청산.wav");
}
다음글
이전글