커뮤니티
시스템식 에러를 잡아주십시요
2007-05-02 13:03:01
1021
글번호 12461
수고가 많으십니다
윌리엄신호를 적용해서 손절매후는 반대 방향으로의 신호에만 신규진입하게 하고
싶은데요. 여기에 소개된 식을 적용해 아래와 같이 해 보았는데 에러가 나오네요.
(예 : 매수후 손절 포인트(1Pt)에 손절 당하고 나서는
다시 매수신호에는 진입을 않게하고 새로 발생하는 매도 신호에 진입 함)
Input : Period(14);
Var : value(0), cnt;
value = WILLR(Period);
setstoploss(1,pointstop);
if cnt < 1 then
{ If CrossUP(value, -80)
Then { Buy();
cnt = cnt +1; }
If CrossDown(value, -20)
Then { Sell();
cnt = cnt +1; } }
if cnt == 1 and PositionProfit(1) > loss then
{ If CrossUP(value, -80) Then
Buy();
If CrossDown(value, -20) Then
Sell(); }
if cnt == 1 and PositionProfit(1) <= loss then
{ If marketposition(1) == -1 and barssinceexit(1) == 1 Then
Buy();
If marketposition(1) == 1 and barssinceexit(1) == 1 Then
Sell(); }
If CrossUP(value, -80) Then exitshort();
If CrossDown(value, -20) Then exitlong();
답변 1
예스스탁 예스스탁 답변
2007-05-02 15:50:58
안녕하세요
예스스탁입니다.
Input : Period(14),loss(5);
Var : value(0), cnt(0);
value = WILLR(Period);
setstoploss(loss,pointstop);
if cnt < 1 then {
If CrossUP(value, -80) Then {
Buy("첫매수");
cnt = cnt +1;
}
If CrossDown(value, -20) Then {
Sell("첫매도");
cnt = cnt +1;
}
}
if cnt == 1 and PositionProfit(1) > -loss then {
If CrossUP(value, -80) Then
Buy("매수");
If CrossDown(value, -20) Then
Sell("매도");
}
if cnt == 1 and PositionProfit(1) <= -loss then {
If marketposition(1) == -1 and marketposition() == 0 Then{
Buy("손절후매수");
}
If marketposition(1) == 1 and marketposition() == 0 Then{
Sell("손절후매도");
}
}
If CrossUP(value, -80) Then exitshort();
If CrossDown(value, -20) Then exitlong();
식을 수정했습니다.
즐거운 하루되세요
> 한산 님이 쓴 글입니다.
> 제목 : 시스템식 에러를 잡아주십시요
> 수고가 많으십니다
윌리엄신호를 적용해서 손절매후는 반대 방향으로의 신호에만 신규진입하게 하고
싶은데요. 여기에 소개된 식을 적용해 아래와 같이 해 보았는데 에러가 나오네요.
(예 : 매수후 손절 포인트(1Pt)에 손절 당하고 나서는
다시 매수신호에는 진입을 않게하고 새로 발생하는 매도 신호에 진입 함)
Input : Period(14);
Var : value(0), cnt;
value = WILLR(Period);
setstoploss(1,pointstop);
if cnt < 1 then
{ If CrossUP(value, -80)
Then { Buy();
cnt = cnt +1; }
If CrossDown(value, -20)
Then { Sell();
cnt = cnt +1; } }
if cnt == 1 and PositionProfit(1) > loss then
{ If CrossUP(value, -80) Then
Buy();
If CrossDown(value, -20) Then
Sell(); }
if cnt == 1 and PositionProfit(1) <= loss then
{ If marketposition(1) == -1 and barssinceexit(1) == 1 Then
Buy();
If marketposition(1) == 1 and barssinceexit(1) == 1 Then
Sell(); }
If CrossUP(value, -80) Then exitshort();
If CrossDown(value, -20) Then exitlong();
다음글
이전글