커뮤니티
궁금한 점이 있습니다.
2004-11-29 20:17:13
1423
글번호 5883
안녕하세요 . 늘수고 하십니다.
다음은 변동성 돌파 종목의 식입니다.
고가-저가(Range)값의 이동평균선 아래서 변동성이 수렴했다고 , 판단하고 일정부분
이를 상향돌파시 매수하는 전략식입니다.
제가 제어하고 싶은 부분은 레인지 평균값 10,40에서 단기가 장기 아래 있을때(var1<var2) 최소한 5봉정도는 횡보하는 기간 (변도성수렴)이 있은 후에 이를 돌파시
매매하는 전략식인데..
(1)과 (2)에서 처럼 제어를 하려고 하는데 검증은 되는데..수식이 어디가 잘못됬는지
시뮬레이션에서는 신호가 안나옴니다.
잘못된부분을 좀 고쳐 주셨으면 감사 하겠습니다.
더 낳은 제어방법이 있으면 알려주시고요 ^^;
input:len(10),len1(40),len2(0.37),s1(2.7),delay(5);
var:var20(0),cond1(true),cond2(true);
var20=high-low;
Var1=ma(var20,len);
Var2=ma(var20,len1);
Cond1=date==exitdate(1) And marketposition(1)==1;
Cond2=date==exitdate(1) And marketposition(1)==-1;
If Var1<var2 Then //-------------- (1)
Var10=1;
Else
Var10=0 ;
If highest(Var10,delay)==1 Then begin //----------------- (2)
If time<1445 Then begin
If Cond1==False And high<dayopen()+(dayhigh(1)-daylow(1))*len2 Then
buy("매수BRK",Atstop,dayopen()+(dayhigh(1)-daylow(1))*len2);
If Cond2==False And low>dayopen()-(dayhigh(1)-daylow(1))*len2 Then
sell("매도BRK",Atstop,dayopen()-(dayhigh(1)-daylow(1))*len2) ;
If Cond1==False And high>dayopen()+(dayhigh(1)-daylow(1))*len2 Then
buy("매수high",Atstop,highest(high,delay));
If Cond2==False And low<dayopen()-(dayhigh(1)-daylow(1))*len2 Then
sell("매도low",Atstop,lowest(low,delay));
end;
end;
// ***** 당일청산***********
SetStopEndofday(1500);
답변 1
예스스탁 예스스탁 답변
2004-12-02 16:15:42
안녕하세요
예스스탁입니다.
문의하신 식은 다음과 같습니다.
input:수렴폭(1.1),len(10),len1(40),len2(0.37),s1(2.7),delay(5);
var:ma1(0),ma2(0),Range(0),cond1(true),cond2(true);
Range = high-low;
Ma1 = ma(Range,len);
MA2 = ma(Range,len1);
var1 = Ma1 < Ma2 and max(ma1,ma2) < min(ma1,ma2)*수렴폭;
var2 = Ma1 > Ma2 and max(ma1,ma2) > min(ma1,ma2)*수렴폭;
if Accumn(iff(var1[1],1,0),5) == 5 and crossup(ma1,ma2) then{
buy();
exitlong();
}
if Accumn(iff(var2[1],1,0),5) == 5 and crossdown(ma1,ma2) then{
sell();
exitshort();
}
횡보수렴폭을 10%로 설정했습니다.변수창에서 조정하시기 바랍니다.
10이평이 40이평보다 작고 5일정도 횡보후 골든이나면 매수/매도청산
10이평이 40이평보다 크고 5일정도 횡보후 데드나면 매도/매수청산
참고하시기 바랍니다.
즐거운 하루되세요
> 히말라야 님이 쓴 글입니다.
> 제목 : 궁금한 점이 있습니다.
> 안녕하세요 . 늘수고 하십니다.
다음은 변동성 돌파 종목의 식입니다.
고가-저가(Range)값의 이동평균선 아래서 변동성이 수렴했다고 , 판단하고 일정부분
이를 상향돌파시 매수하는 전략식입니다.
제가 제어하고 싶은 부분은 레인지 평균값 10,40에서 단기가 장기 아래 있을때(var1<var2) 최소한 5봉정도는 횡보하는 기간 (변도성수렴)이 있은 후에 이를 돌파시
매매하는 전략식인데..
(1)과 (2)에서 처럼 제어를 하려고 하는데 검증은 되는데..수식이 어디가 잘못됬는지
시뮬레이션에서는 신호가 안나옴니다.
잘못된부분을 좀 고쳐 주셨으면 감사 하겠습니다.
더 낳은 제어방법이 있으면 알려주시고요 ^^;
input:len(10),len1(40),len2(0.37),s1(2.7),delay(5);
var:var20(0),cond1(true),cond2(true);
var20=high-low;
Var1=ma(var20,len);
Var2=ma(var20,len1);
Cond1=date==exitdate(1) And marketposition(1)==1;
Cond2=date==exitdate(1) And marketposition(1)==-1;
If Var1<var2 Then //-------------- (1)
Var10=1;
Else
Var10=0 ;
If highest(Var10,delay)==1 Then begin //----------------- (2)
If time<1445 Then begin
If Cond1==False And high<dayopen()+(dayhigh(1)-daylow(1))*len2 Then
buy("매수BRK",Atstop,dayopen()+(dayhigh(1)-daylow(1))*len2);
If Cond2==False And low>dayopen()-(dayhigh(1)-daylow(1))*len2 Then
sell("매도BRK",Atstop,dayopen()-(dayhigh(1)-daylow(1))*len2) ;
If Cond1==False And high>dayopen()+(dayhigh(1)-daylow(1))*len2 Then
buy("매수high",Atstop,highest(high,delay));
If Cond2==False And low<dayopen()-(dayhigh(1)-daylow(1))*len2 Then
sell("매도low",Atstop,lowest(low,delay));
end;
end;
// ***** 당일청산***********
SetStopEndofday(1500);
다음글
이전글