커뮤니티
청산식 문의드립니다.
2011-01-17 23:10:34
607
글번호 35042
안녕하세요.
아래 진입식에 대하여 조건에 따라 청산방법을 두가지로 구분하고자 합니다.
If stime<150000 then {
If condition1==False And currententrynum-var50<=1 and marketposition <>1 then
buy("매수",Atstop,dayLow+var1*len1);
}
### 청산조건 ###
매수 직전에 매수조건 반대현상이(Atstop,dayHigh-var1*len1) 발생한적이 있으면,
exitlong("매수청산1",Atstop,highest(high,barsSinceEntry+1)-atr(n)*len); 로
청산하고, 아니면 exitlong("매수청산2",Atstop,dayHigh-var1*len1); 으로 청산
하고자합니다.
감사합니다.
답변 1
예스스탁 예스스탁 답변
2011-01-18 11:28:50
안녕하세요
예스스탁입니다.
var1 = countif(H >= dayHigh-var1*len1,dayindex+1);
if MarketPosition == 1 Then{
if var1[BarsSinceEntry] >= 1 Then
exitlong("매수청산1",Atstop,highest(high,barsSinceEntry+1)-atr(n)*len);
if var1[BarsSinceEntry] < 1 Then
exitlong("매수청산2",Atstop,dayHigh-var1*len1);
}
매수 직전에 매수조건 반대현상이(Atstop,dayHigh-var1*len1) 발생한 경우를
어느정도의 기간으로 산정해야 하는지 모르겠습니다.
우선 당일 한번으로 설정했습니다.
만약 직전청사이후이면
var1 = countif(H >= dayHigh-var1*len1,BarsSinceExit(1));
로 수정하시기 바랍니다.
즐거운 하루되세요
> 베드로 님이 쓴 글입니다.
> 제목 : 청산식 문의드립니다.
> 안녕하세요.
아래 진입식에 대하여 조건에 따라 청산방법을 두가지로 구분하고자 합니다.
If stime<150000 then {
If condition1==False And currententrynum-var50<=1 and marketposition <>1 then
buy("매수",Atstop,dayLow+var1*len1);
}
### 청산조건 ###
매수 직전에 매수조건 반대현상이(Atstop,dayHigh-var1*len1) 발생한적이 있으면,
exitlong("매수청산1",Atstop,highest(high,barsSinceEntry+1)-atr(n)*len); 로
청산하고, 아니면 exitlong("매수청산2",Atstop,dayHigh-var1*len1); 으로 청산
하고자합니다.
감사합니다.
다음글
이전글