커뮤니티
재진입 문의
2008-12-22 15:25:44
664
글번호 18925
setstopendofday(1500);
setstoptrailing(0.3,2.5,pointstop);//청산기준
if stime >=093000 and ma(C,4) > ma(C,20) and value > 0 then
buy ();
if stime >=093000 and ma(C,4) < ma(C,20) and value < 0 then
sell();
대충 이렇게 잡고 사용하면 청산과동시에 반대포지션으로 같은봉에 진입하는데요
그걸 막고싶습니다 청산후 1개 후에 재진입하고싶습니다
그리고 청산효율을 퍼센트를 이용해서 청산하는 방법이 있다는데 알고싶습니다^^;
감사합니다~
답변 1
예스스탁 예스스탁 답변
2008-12-22 17:54:54
안녕하세요
예스스탁입니다.
1. 당일 첫진입과 그 이후진입을 나누어 당일 두번째 진입부터는 청산후
다음봉에서 발동하도록 작성했습니다.
var : cnt(0),count(0);
setstopendofday(1500);
setstoptrailing(0.3,2.5,pointstop);//청산기준
for cnt = 0 to 10{
if sdate == EntryDate(cnt) Then
count = count+1;
}
##당일 첫진입
if MarketPosition() == 0 and count == 0 Then{
if stime >=093000 and ma(C,4) > ma(C,20) and value1 > 0 then
buy();
if stime >=093000 and ma(C,4) < ma(C,20) and value1 < 0 then
sell();
}
##청산
if MarketPosition() != 0 Then{
if stime >=093000 and ma(C,4) > ma(C,20) and value1 > 0 then
ExitShort();
if stime >=093000 and ma(C,4) < ma(C,20) and value1 < 0 then
exitlong();
}
##당일 첫진입 이후
if MarketPosition() == 0 and count >= 1 Then{
if BarsSinceExit(1) == 1 and MarketPosition(1) == -1 then
buy();
if BarsSinceExit(1) == 1 and MarketPosition(1) == 1 then
sell();
}
2.
해당 포지션 구간에서 청산가격의 최고가와 최저가 사이에서 어디에 위치하는 가를 나타내며 100에
가까울 수록 효율적인 청산임을 나타냅니다. 진입효율과 청산효율이 100일 때, 매수 포지션일 경우 최저가에 진입하여 최고가에 청산했음을 의미하고, 매도 표지션일 경우 최고가에 진입하여 최저가에 청산했음을 의미합니다
식은 진입후 최고가와 최저가의 평균가 이상일때 매수청산
진입후 최고가와 최저가의 평균가 이하일때 매도청산하는 식입니다.
if MarketPosition() == 1 Then{
if C <= (highest(H,BarsSinceEntry)+Lowest(L,BarsSinceEntry))/2 Then
ExitShort();
}
if MarketPosition() == -1 Then{
if C >= (highest(H,BarsSinceEntry)+Lowest(L,BarsSinceEntry))/2 Then
exitlong();
}
즐거운 하루되세요
> 반포동 님이 쓴 글입니다.
> 제목 : 재진입 문의
>
setstopendofday(1500);
setstoptrailing(0.3,2.5,pointstop);//청산기준
if stime >=093000 and ma(C,4) > ma(C,20) and value > 0 then
buy ();
if stime >=093000 and ma(C,4) < ma(C,20) and value < 0 then
sell();
대충 이렇게 잡고 사용하면 청산과동시에 반대포지션으로 같은봉에 진입하는데요
그걸 막고싶습니다 청산후 1개 후에 재진입하고싶습니다
그리고 청산효율을 퍼센트를 이용해서 청산하는 방법이 있다는데 알고싶습니다^^;
감사합니다~
이전글