커뮤니티
매수 나 매도 청산후 다시 진입시
2006-07-31 01:09:17
993
글번호 10520
아래산식을 3가지를 부탁드립니다
1. 선물시스템식에서 매수나 매도 청산후 5봉 경과후 재진입토록 하는식
If barssinceexit(0) > 5 and formula1 Then
buy();
if Formula2 Then Exitlong();
If barssinceexit(0) > 5 and formula3 Then
sell();
if Formula4 Then Exitshort();
위와 같이 했는데 되지를 않네요 어디가 잘못되었는지 봐주시기 바랍니다
2. 선물시스템식에서 매수나 매도 청산시 청산조건 여러개중 특정조건 변동시
예를 들어 청산조건중 10 이평선 청산,20 이평선의 청산등이 있을시 청산이
20 이평선 조건에 의하여 청산되었다면 20 이평선이 다시 변동되더라도 같은 방향
재진입을 금지하는식
3. 1번과 2번의 복합식
4. 마지막으로 매도조건식 만족후 다음 음봉시 매수하는 식 과
매수조건식 만족후 다음 양봉시 매도하는 식 을 부탁드립니다
참고로 최대한 단순하게 부탁합니다
답변 1
예스스탁 예스스탁 답변
2006-07-31 11:44:13
안녕하세요
예스스탁입니다.
1. 최초매수나 매도 후 그 다음식부터 청산후 5봉이 경과한 후 진입합니다.
var : cnt(0);
if marketposition() == 0 and C > O and cnt < 1 then{
buy("최초매수");
cnt = 1;
}
if marketposition() == 0 and C < O and cnt < 1 then{
sell("최초매도");
cnt = 1;
}
if cnt == 1 and marketposition() == 0 then{
If barssinceexit(1) > 5 and C > O Then
buy("매수");
if barssinceexit(1) > 5 and C < O Then
sell("매도");
}
if crossup(c,ma(c,20)) Then
Exitlong("매수청산");
if crossdown(c,ma(c,20)) Then
Exitshort("매도청산");
2.
var : cnt(0);
if marketposition() == 0 and cnt < 1 then{
if C > O then{
buy();
cnt = 1;
}
if C < O then{
sell();
cnt = 1;
}
}
## 매수청산1,매도청산2로 끝났을 경우 조건 먼저 충족하는 식 진입
if marketposition() == 0 and cnt == 1 then{
if isexitname("매수청산1",1) or isexitname("매도청산1",1) then{
if C > O then{
buy();
}
if C < O then{
sell();
}
}
}
## 매수청산2,매도청산2로 끝났을 경우 반대방향으로만 진입
if marketposition() == 0 and cnt == 1 then{
if isexitname("매도청산2",1) and C > O then{
buy();
}
if isexitname("매수청산2",1) and C < O then{
sell();
}
}
if marketposition() == 1 then{
if crossup(c,ma(c,10)) then
exitlong("매수청산1");
if crossup(c,ma(c,20)) then
exitlong("매수청산2");
}
if marketposition() == -1 then{
if crossdown(c,ma(c,10)) then
exitshort("매도청산1");
if crossdown(c,ma(c,20)) then
exitshort("매도청산2");
}
3.
var : cnt(0);
if marketposition() == 0 and cnt < 1 then{
if C > O then{
buy("최초매수");
cnt = 1;
}
if C < O then{
sell("최초매도");
cnt = 1;
}
}
## 매수청산1,매도청산2로 끝났을 경우 조건 먼저 충족하는 식 진입
if marketposition() == 0 and cnt == 1 and barssinceexit(1) > 5 then{
if isexitname("매수청산1",1) or isexitname("매도청산1",1) then{
if C > O then{
buy("매수");
}
if C < O then{
sell("매도");
}
}
}
## 매수청산2,매도청산2로 끝났을 경우 반대방향으로만 진입
if marketposition() == 0 and cnt == 1 and barssinceexit(1) > 5 then{
if isexitname("매도청산2",1) and C > O then{
buy();
}
if isexitname("매수청산2",1) and C < O then{
sell();
}
}
if marketposition() == 1 then{
if crossup(c,ma(c,10)) then
exitlong("매수청산1");
if crossup(c,ma(c,20)) then
exitlong("매수청산2");
}
if marketposition() == -1 then{
if crossdown(c,ma(c,10)) then
exitshort("매도청산1");
if crossdown(c,ma(c,20)) then
exitshort("매도청산2");
}
4.
if marketposition() == 0 and 매수조건 then
var1 = 1;
else if marketposition() == 0 and 매도조건 then
var1 = -1;
else
var1 = 0;
if marketposition() == 0 then{
if var1 == 1 and c > O then
buy();
if var1 == -1 and C < O then
sell();
}
즐거운 하루되세요
> kim1984 님이 쓴 글입니다.
> 제목 : 매수 나 매도 청산후 다시 진입시
> 아래산식을 3가지를 부탁드립니다
1. 선물시스템식에서 매수나 매도 청산후 5봉 경과후 재진입토록 하는식
If barssinceexit(0) > 5 and formula1 Then
buy();
if Formula2 Then Exitlong();
If barssinceexit(0) > 5 and formula3 Then
sell();
if Formula4 Then Exitshort();
위와 같이 했는데 되지를 않네요 어디가 잘못되었는지 봐주시기 바랍니다
2. 선물시스템식에서 매수나 매도 청산시 청산조건 여러개중 특정조건 변동시
예를 들어 청산조건중 10 이평선 청산,20 이평선의 청산등이 있을시 청산이
20 이평선 조건에 의하여 청산되었다면 20 이평선이 다시 변동되더라도 같은 방향
재진입을 금지하는식
3. 1번과 2번의 복합식
4. 마지막으로 매도조건식 만족후 다음 음봉시 매수하는 식 과
매수조건식 만족후 다음 양봉시 매도하는 식 을 부탁드립니다
참고로 최대한 단순하게 부탁합니다
다음글