커뮤니티
손익에 따라 건너 뛰어가는 수식.
2004-12-03 03:08:12
1097
글번호 5920
두개의 이동평균 매매에 있어서 두번 손실 발생시에
두번의 매매 타이밍을 쉬어가는 방법 좀 알려 주세요.
답변 1
예스스탁 예스스탁 답변
2004-12-07 15:06:39
안녕하세요
예스스탁입니다.
문의하신 식은 다음과 같습니다.
var : cnt(0),value1(0),value2(0),losscnt(0),loss(0),DOWN(0),losspos(0),Dindex(0),Bpos(0);
var1 = ma(c,5);
var2 = ma(c,20);
if crossup(var1,var2) and losscnt < 2 then{
buy("매수진입");
value1 = c;
}
if crossdown(var1,var2) then{
exitlong("청산");
value2 = c;
loss = value2 - value1;
DOWN = DOWN+1;
if loss < 0 then{
losscnt = losscnt +1;
}
if losscnt == 2 then {
losspos = down;
}
}
if losscnt >= 2 and DOWN == losspos+2 and crossup(var1,var2) then {
buy("손실후진입");
losscnt = 0;
}
즐거운 하루되세요
> harfagr 님이 쓴 글입니다.
> 제목 : 손익에 따라 건너 뛰어가는 수식.
> 두개의 이동평균 매매에 있어서 두번 손실 발생시에
두번의 매매 타이밍을 쉬어가는 방법 좀 알려 주세요.
다음글
이전글