커뮤니티
수식문의드립니다
2012-02-10 06:06:41
287
글번호 47578
안녕하세요?
1.아래의식을 진입명을 사용하여 청산하려고 하나 청산신호가 발생안됩니다
if DayClose(1)>DayClose(2)*1.12 and DayIndex()==0 and 시가>0 and 시가<5 Then buy("a"); #조건a
if DayClose(1)>DayClose(2)*1.12 and DayIndex()==0 and 시가>6 and 시가<7 Then buy("b"); #조건b
if DayClose(1)>DayClose(2)*1.12 and DayIndex()==0 and 시가>8 and 시가<12 Then buy("c"); #조건c
→if isentryname("b") then c<시가 then exitlong("bb");
# 질문1:진입명으로 청산이 인돼는 이유가 무엇인지요?
---------------------------------------------------------------------
안녕하세요
예스스탁입니다.#기존에 누가 질문한것에 대한 답변내용 발췌
entry~함수는 피라미딩시 첫진입에 관련된 값만 리턴하므로
각 진입식에 변수를 만들고 값을 저장하고 초기화하면서
해당 값을 찾아야 합니다.
1.
if MarketPosition() !=1 Then{
value1 ==0;
}
if 조건a then{
buy("A");
value1 = 1;
}
if 조건b then{
buy("B");
value1 = 2;
}
if 조건c then{
buy("c");
value1 = 3;
}
if value1 == 2 then ## 가장최근 진입이 2
------------------------------------------------------
if MarketPosition() !=1 Then{
value1 ==0;
}
# 상기식으로 조건 a,조건 b ,조건c 를 변경시
if DayClose(1)>DayClose(2)*1.12 and DayIndex()==0 and 시가>0 and 시가<5 Then then{ buy("B"); value1 = 1;}
if DayClose(1)>DayClose(2)*1.12 and DayIndex()==0 and 시가>6 and 시가<7 Then then{ buy("B"); value1 = 2;}
if DayClose(1)>DayClose(2)*1.12 and DayIndex()==0 and 시가>8 and 시가<12 Then then{ buy("c"); value1 = 3;}
→if value1 == 2 then c<시가 then exitlong("b");
# 문제점: value1==2 청산신호가 발생은하나
value1==1 에 매수된것 것도 같이 청산신호 발생됨
(다른예: if value1 == 3 then c<시가 then exitlong("c");은
value1 == 1 , value1 == 2 와 value1 == 3 매수진입된 3개가 청산됨)
# 질문2: 원인이 무엇이며 바른식은 무엇인지요?
(피라미딩설정은 모든 중복신호 허용조건이며
허용안함 조건설정시 value1==2 를 설정해도 value1==1 이 청산됨)
# 시가는 전일종가/c 등으로 표시
답변 1
예스스탁 예스스탁 답변
2012-02-10 14:06:13
안녕하세요
예스스탁입니다.
아래와 같이 작성하시면 됩니다.
시가를 dayopen으로 대체하고 수식작성후에
차트에 적용한 그림입니다.
if DayClose(1)>DayClose(2)*1.12 and DayIndex()==0 and DayOpen>0 and DayOpen<5 Then buy("a"); #조건a
if DayClose(1)>DayClose(2)*1.12 and DayIndex()==0 and DayOpen>6 and DayOpen<7 Then buy("b"); #조건b
if DayClose(1)>DayClose(2)*1.12 and DayIndex()==0 and DayOpen>8 and DayOpen<12 Then buy("c"); #조건c
if isentryname("b") and c < DayOpen then exitlong("bb");
즐거운 하루되세요
> 날아 님이 쓴 글입니다.
> 제목 : 수식문의드립니다
>
안녕하세요?
1.아래의식을 진입명을 사용하여 청산하려고 하나 청산신호가 발생안됩니다
if DayClose(1)>DayClose(2)*1.12 and DayIndex()==0 and 시가>0 and 시가<5 Then buy("a"); #조건a
if DayClose(1)>DayClose(2)*1.12 and DayIndex()==0 and 시가>6 and 시가<7 Then buy("b"); #조건b
if DayClose(1)>DayClose(2)*1.12 and DayIndex()==0 and 시가>8 and 시가<12 Then buy("c"); #조건c
→if isentryname("b") then c<시가 then exitlong("bb");
# 질문1:진입명으로 청산이 인돼는 이유가 무엇인지요?
---------------------------------------------------------------------
안녕하세요
예스스탁입니다.#기존에 누가 질문한것에 대한 답변내용 발췌
entry~함수는 피라미딩시 첫진입에 관련된 값만 리턴하므로
각 진입식에 변수를 만들고 값을 저장하고 초기화하면서
해당 값을 찾아야 합니다.
1.
if MarketPosition() !=1 Then{
value1 ==0;
}
if 조건a then{
buy("A");
value1 = 1;
}
if 조건b then{
buy("B");
value1 = 2;
}
if 조건c then{
buy("c");
value1 = 3;
}
if value1 == 2 then ## 가장최근 진입이 2
------------------------------------------------------
if MarketPosition() !=1 Then{
value1 ==0;
}
# 상기식으로 조건 a,조건 b ,조건c 를 변경시
if DayClose(1)>DayClose(2)*1.12 and DayIndex()==0 and 시가>0 and 시가<5 Then then{ buy("B"); value1 = 1;}
if DayClose(1)>DayClose(2)*1.12 and DayIndex()==0 and 시가>6 and 시가<7 Then then{ buy("B"); value1 = 2;}
if DayClose(1)>DayClose(2)*1.12 and DayIndex()==0 and 시가>8 and 시가<12 Then then{ buy("c"); value1 = 3;}
→if value1 == 2 then c<시가 then exitlong("b");
# 문제점: value1==2 청산신호가 발생은하나
value1==1 에 매수된것 것도 같이 청산신호 발생됨
(다른예: if value1 == 3 then c<시가 then exitlong("c");은
value1 == 1 , value1 == 2 와 value1 == 3 매수진입된 3개가 청산됨)
# 질문2: 원인이 무엇이며 바른식은 무엇인지요?
(피라미딩설정은 모든 중복신호 허용조건이며
허용안함 조건설정시 value1==2 를 설정해도 value1==1 이 청산됨)
# 시가는 전일종가/c 등으로 표시