커뮤니티
수식문의드립니다.
2010-02-16 17:58:42
649
글번호 28116
안녕하세요
다음의 식에 관해 질문드립니다.
1. if a1 then buy ("buy1");
if Isentryname("buy1") && a11 then exitlong (" exit 1");
2. If date[1] != date Then marketposition==0 ;
Condition1 = CountIF((MarketPosition==1 ) && entrytime>093000, dayindex+1) <2 ;
if Condition1 == true Then {
if a31 then buy ("2buy");
if a311 then buy ("2buy1"); }
3.
Condition2 = CountIF(( MarketPosition==-1) && entrytime>093000, dayindex+1) <2 ;
if Condition2 == true Then {
if a7 then sell("2Sell");
if a71 then sell("2Sell1"); }
질문)
1번식은 매매횟수에 상관없이 진입 청산
2번식은 9시 30분이후에 매수포지션이 2번이하면 진입, 즉 매수 및 매수청산이
2번만 가능
3번식은 9시 30분이후에 매도포지션이 2번이하면 진입, 즉 매도 및 매도청산이
2번만 가능
제가 의도하는 대로 식이 맞는지 검토 부탁드립니다.
수고하세요
답변 1
예스스탁 예스스탁 답변
2010-02-17 09:10:18
안녕하세요
예스스탁입니다.
1.
횟수제한없이 진입하는 식이 맞습니다.
2.3
해당 식 내용이 어떤 내용인지 모르겠습니다.
If date[1] != date Then marketposition==0 ;
Condition1 = CountIF((MarketPosition==1 ) && entrytime>093000, dayindex+1) <2 ;
if Condition1 == true Then {
위 문장은 진입횟수제한과는 무관하며
피라미딩이 아니면 진입이 되지 않는 식입니다.
진입제한은 진입명을 카운트하여 제어하셔야 합니다.
수정된 식입니다.
var : cnt(0),count1(0),count2(0);
count1 = 0;
count2 = 0;
for cnt = 0 to 20{
if sdate == EntryDate(cnt) and (IsEntryName("2buy") == true or IsEntryName("2buy1") == true) Then
count1 = count1 +1;
if sdate == EntryDate(cnt) and (IsEntryName("2sell") == true or IsEntryName("2sell1") == true) Then
count2 = count2 +1;
}
if a1 then buy ("buy1");
if Isentryname("buy1") && a11 then exitlong (" exit 1");
if a31 and stime >= 93000 and count1 < 2 then buy("2buy");
if a311 and stime >= 93000 and count1 < 2 then buy ("2buy1");
if a7 and stime >= 93000 and count2 < 2 then sell("2Sell");
if a71 and stime >= 93000 and count2 < 2 then sell("2Sell1");
즐거운 하루되세요
> ken 님이 쓴 글입니다.
> 제목 : 수식문의드립니다.
> 안녕하세요
다음의 식에 관해 질문드립니다.
1. if a1 then buy ("buy1");
if Isentryname("buy1") && a11 then exitlong (" exit 1");
2. If date[1] != date Then marketposition==0 ;
Condition1 = CountIF((MarketPosition==1 ) && entrytime>093000, dayindex+1) <2 ;
if Condition1 == true Then {
if a31 then buy ("2buy");
if a311 then buy ("2buy1"); }
3.
Condition2 = CountIF(( MarketPosition==-1) && entrytime>093000, dayindex+1) <2 ;
if Condition2 == true Then {
if a7 then sell("2Sell");
if a71 then sell("2Sell1"); }
질문)
1번식은 매매횟수에 상관없이 진입 청산
2번식은 9시 30분이후에 매수포지션이 2번이하면 진입, 즉 매수 및 매수청산이
2번만 가능
3번식은 9시 30분이후에 매도포지션이 2번이하면 진입, 즉 매도 및 매도청산이
2번만 가능
제가 의도하는 대로 식이 맞는지 검토 부탁드립니다.
수고하세요
이전글