커뮤니티
시스템식 재문의
2012-08-21 01:49:16
265
글번호 53954
안녕하세요~ 답변자님께서 작성해 주신 식은 잘 봤습니다!
if MarketPosition == -1 Then{
if BarsSinceEntry >= 4 and countif(C>C[1],4) == 4 Then
Condition1 = true;
if Condition1 == true or countif(C<= dayclose(1)*0.96,BarsSinceEntry) >= 1 Then
ExitShort("sx",AtLimit,EntryPrice-2,"trendsell");
}
if MarketPosition != -1 Then
Condition1 = false;
이것이였는데, 제가 이걸 조금 변경해서,
vars : cond(false);
if MarketPosition == 1 and entryname == "trendbuy" then{
if BarsSinceEntry >= 4 and countif(c < c[1],4) == 4 Then Cond = true;
if Cond == true or (countif(C <= c[1] - 5 ,BarsSinceEntry) >= 1) Then Exitlong("enough",AtLimit,EntryPrice+5,"trendbuy");
}
라는 식으로 연속으로 4번 이상 하락하거나 진입한 후에 전날 종가에 비해서 5포인트
이상 하락한 적이 있으면 5pt만 먹고 trendbuy를 청산시켜라 라는 내용인데...
실제로 돌려보면 첨부파일 그림에서 5월 2일에 아무 조건이 만족하지 않은것 같은데
청산이 됩니다..
뭔가 시스템에 오류가 있는건지 제 식에 오류가 있는건지 잘 모르겠습니다..
전문가님께서 해주신것 그대로 응용한것인데 말이죠..ㅠ
한번 확인 부탁드리겠습니다! :)
첨부파일로 이미지 파일 올립니다ㅋ
- 1. 새질문.jpg (3.00 MB)
답변 1
예스스탁 예스스탁 답변
2012-08-21 11:39:47
안녕하세요
예스스탁입니다.
매수포지션에 들어가면 다시 조건이 만족하는 것을
체크해야 하므로 매수포지션이 아닐때 cond를 false가
되는 내용이 필요합니다.
아래와 같이 작성하시면 됩니다.
vars : cond(false);
if sdate == 20080423 Then
buy("trendbuy");
if MarketPosition == 1 and entryname == "trendbuy" then{
if BarsSinceEntry >= 4 and countif(c < c[1],4) == 4 Then
Cond = true;
if Cond == true or (countif(C <= c[1] - 5 ,BarsSinceEntry) >= 1)
Then Exitlong("enough",AtLimit,EntryPrice+5,"trendbuy");
}
if MarketPosition != 1 Then
cond = false;
즐거운 하루되세요
> cwc1988 님이 쓴 글입니다.
> 제목 : 시스템식 재문의
> 안녕하세요~ 답변자님께서 작성해 주신 식은 잘 봤습니다!
if MarketPosition == -1 Then{
if BarsSinceEntry >= 4 and countif(C>C[1],4) == 4 Then
Condition1 = true;
if Condition1 == true or countif(C<= dayclose(1)*0.96,BarsSinceEntry) >= 1 Then
ExitShort("sx",AtLimit,EntryPrice-2,"trendsell");
}
if MarketPosition != -1 Then
Condition1 = false;
이것이였는데, 제가 이걸 조금 변경해서,
vars : cond(false);
if MarketPosition == 1 and entryname == "trendbuy" then{
if BarsSinceEntry >= 4 and countif(c < c[1],4) == 4 Then Cond = true;
if Cond == true or (countif(C <= c[1] - 5 ,BarsSinceEntry) >= 1) Then Exitlong("enough",AtLimit,EntryPrice+5,"trendbuy");
}
라는 식으로 연속으로 4번 이상 하락하거나 진입한 후에 전날 종가에 비해서 5포인트
이상 하락한 적이 있으면 5pt만 먹고 trendbuy를 청산시켜라 라는 내용인데...
실제로 돌려보면 첨부파일 그림에서 5월 2일에 아무 조건이 만족하지 않은것 같은데
청산이 됩니다..
뭔가 시스템에 오류가 있는건지 제 식에 오류가 있는건지 잘 모르겠습니다..
전문가님께서 해주신것 그대로 응용한것인데 말이죠..ㅠ
한번 확인 부탁드리겠습니다! :)
첨부파일로 이미지 파일 올립니다ㅋ
다음글
이전글