커뮤니티
2973번 답변 좀 해주세요, 제발
2005-01-08 15:44:36
933
글번호 6267
2973번에 대해서 왜 답변을 안해줍니까?
답변 1
예스스탁 예스스탁 답변
2005-01-11 09:04:26
안녕하세요
예스스탁입니다.
답변이 늦어 대단히 죄송합니다.
문의하신 식을 검증결과 같은 봉에서 여러 조건이 한꺼번에
만족했을 때 문제가 있었습니다.
그부분 수정해서 올려드립니다.
var : slowK(0), slowD(0), macdV(0), macdS(0), ma1(0), ma2(0);
var : Cond1(0), Cond2(0), Cond3(0), Cond4(0), Cond5(0), Cond6(0), buyCond(0), bPosition(0),cnt(0);
slowK = stochasticsK(20,12); //stochastics slowK선
slowD = stochasticsD(20,12,12); //stochastics slowD선
macdV = macd(12,26); //macd선
macdS = ema(macdV,9); //macd signal선
ma1 = ma(C,5); //단기이동평균
ma2 = ma(C,20); //장기이동평균
Cond1 = CrossUp(slowK, slowD); //매수조건1
Cond2 = CrossUp(macdV, macdS); //매수조건2
Cond3 = CrossUp(ma1, ma2); //매수조건3
Cond4 = CrossDown(slowK, slowD); //매수청산조건1
Cond5 = CrossDown(macdV, macdS); //매수청산조건2
Cond6 = CrossDown(ma1, ma2); //매수청산조건3
//매수식
if bposition != 1 then Begin
if Cond1 and cnt < 1 then {
buy("매수1");
buyCond = 1;
bposition = 1;
cnt = cnt+1;
}
if Cond2 and cnt < 1then {
buy("매수2");
buyCond = 2;
bposition = 1;
cnt = cnt+1;
}
if Cond3 and cnt < 1 then {
buy("매수3");
buyCond = 3;
bposition = 1;
cnt = cnt+1;
}
End;
//매수청산식
if buyCond == 1 and Cond4 then {
exitlong("수청1");
bPosition = 0;
cnt = 0;
}
if buyCond == 2 and Cond5 then {
exitlong("수청2");
bPosition = 0;
cnt = 0;
}
if buyCond == 3 and Cond6 then {
exitlong("수청3");
bPosition = 0;
cnt = 0;
}
이용에 불편을 드려 죄송합니다.
즐거운 하루되시고 새해 복 많이 받으세요
> 태산 님이 쓴 글입니다.
> 제목 : 2973번 답변 좀 해주세요, 제발
> 2973번에 대해서 왜 답변을 안해줍니까?
이전글