커뮤니티
강제청산후 같은신호 계속발생 제거식
2005-01-05 02:32:15
1076
글번호 6241
수고 많으십니다.
시스템트레이딩에서 자동매매에서 강제청산한 후
동일포지션으로 재진입하는 신호가 발생하는 경
우 매매설정에서 (동일 포지션의누적허용)에서
진입횟수를 1회 입력해도 재진입이 되어서 난감
하군요.
누적허용 기능과는 별개로 저의 시스템은 진입신호
가 매수,매도 각각3가지 정도 나오는 데 강제청산한
신호는 일정시간 동안 또는 그날은 발생하지 않는
시스템식을 알려 줄 수 있는 지요.
부탁드립니다.
답변 1
예스스탁 예스스탁 답변
2005-01-07 09:59:31
안녕하세요
예스스탁입니다.
매수이익강제청산 후에 다른방향 진입만되는 수식입니다.
var : Bcnt(0),Scnt(0);
var1 = ma(c,5);
var2 = ma(c,20);
if date != date[1] then{
Bcnt = 0;
Scnt = 0;
}
if crossup(var1,var2) and Bcnt < 1 then
buy("매수");
if crossdown(var1,var2) then
exitlong("매수청산");
if crossdown(var1,var2) and Scnt < 1 then
sell("매도");
if crossup(var1,var2) then
exitshort("매도청산");
if marketposition() == 1 and crossup(c,entryprice()+0.5) then{
exitlong("매수이익청산");
Bcnt = Bcnt +1;
}
if marketposition() == 1 and crossdown(c,entryprice()-0.5) then{
exitshort("매도이익청산");
Scnt = Scnt+1;
}
만약 목표수익청산 후에는 다른 반대방향 진입부터 시작하는 식입니다.
Input : Period(12), Period1(3), Period2(3);
Var : value1(0), value2(0), value3(0), value4(0),value5(0),value6(0),cnt(0);
value1 = StochasticsK(Period,Period1);
value2 = StochasticsD(Period,Period1,Period2);
value3 = ma(c,10);
value4 = ma(c,20);
value5 = ma(c,35);
value6 = ma(c,60);
if cnt < 1 then{
If value1 > value2 and value3 > value3[1] and value4 > value5 and value5 > value6 Then{
Buy("초기매수");
cnt = cnt+1;
}
if value1 < value2 and value3 < value3[1] and value4< value5 and value5 < value6 Then{
sell("초기매도");
cnt = cnt+1;
}
}
if marketposition() == 1 and C > entryprice()+0.9 then{
exitlong("수익매수청산",atstop,entryprice()+0.9);
var1 = 1;
}
if marketposition() == -1 and C < entryprice()-0.9 then{
exitshort("수익매도청산",atstop,entryprice()-0.9);
var2 = 1;
}
if var2 == 1 then{
if value1 > value2 and value3 > value3[1] and value4 > value5 and value5 > value6 Then{
Buy("매도수익후매수");
var1 = 0;
var2 = 0;
}
}
if var1 == 1 then{
if value1 < value2 and value3 < value3[1] and value4< value5 and value5 < value6 Then{
sell("매수수익후매도");
var1 = 0;
var2 = 0;
}
}
if var2 < 1 and var1 < 1 then{
if value1 > value2 and value3 > value3[1] and value4 > value5 and value5 > value6 Then{
Buy("매수");
}
}
if var1 < 1 and var2 < 1 then{
if value1 < value2 and value3 < value3[1] and value4< value5 and value5 < value6 Then{
sell("매도");
}
}
if value1 < value2 and value3 < value3[1] and value4< value5 and value5 < value6 Then
exitlong("매수청산");
If value1 > value2 and value3 > value3[1] and value4 > value5 and value5 > value6 Then
exitshort("매도청산");
새해 복 많이 받으세요
> HH_gicha1 님이 쓴 글입니다.
> 제목 : 강제청산후 같은신호 계속발생 제거식
> 수고 많으십니다.
시스템트레이딩에서 자동매매에서 강제청산한 후
동일포지션으로 재진입하는 신호가 발생하는 경
우 매매설정에서 (동일 포지션의누적허용)에서
진입횟수를 1회 입력해도 재진입이 되어서 난감
하군요.
누적허용 기능과는 별개로 저의 시스템은 진입신호
가 매수,매도 각각3가지 정도 나오는 데 강제청산한
신호는 일정시간 동안 또는 그날은 발생하지 않는
시스템식을 알려 줄 수 있는 지요.
부탁드립니다.
다음글
이전글