커뮤니티

매매횟수 제한 검토 부탁드립니다.

프로필 이미지
사과쥬스
2016-04-14 17:44:34
96
글번호 97088
답변완료
아래수식에 당일 매수,매도 횟수가 1회로 제한하는 수식이 포함된 것으로 아는데 시스템 적용시 당일 매도후 다시 매수하는 경우가 생깁니다. 검토 부탁드립니다~ -아래- input : N(1); var : AA(0),BB(0),CC(0); var : TF(0),VV(0),VH(0),VH1(0),upv(0); var : cnt(0),count(0); count = 0; for cnt = 0 to 20{ if sdate ==EntryDate(cnt) Then count = count+1; } AA = (highest(H,5760)+lowest(L,5760))/2; BB = Highest(H,1800); var1 = NthHighestBar(1,H,1800); CC = lowest(L,var1); value1 = (((BB-AA)/5)*0)+AA; value2 = (((BB-AA)/5)*1.5)+CC; Value5 = AA-(((BB-AA)/5)*3); TF = dayindex%15; if date != date[1] then{ VV = 0; VH = 0; VH1 = VH[1]; } if (TF < TF[1] and date == date[1]) Then VV = 0; VV = VV +V; if VV > VH Then VH = VV; if stime < 091500 Then value3 = VH; value4 = AA-(((BB-AA)/5)*1); if (stime >= 090300 and value3 <= VH1) or (stime >= 141500) then{ if MarketPosition == 0 and CrossDown(c,value1) and count < N Then if ((dayopen > DayClose(1)*0.98) or (dayopen <= DayClose(1)*0.98 and stime >= 141500)) then buy("b1"); if MarketPosition == 1 and MaxEntries == 1 Then buy("b2",atlimit,value4); } if crossup(c,value2) Then ExitLong(); if CrossDown(c,Value5) Then ExitLong("bx1",onclose,def,"b1"); if (c<Value5) and (stime < 090300 or stime>=144800) Then ExitLong("bx2",onclose,def,"b2");
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2016-04-15 10:13:40

안녕하세요 예스스탁입니다. b2는 추가진입식인에 신호타입이 atlimit으로 되어 있습니다. 완성봉에서 value4값을 셋팅하고 다음봉에서 해당 값 이하의 시세가 발생하면 즉시신호가 발생합니다. 수식에서 포지션등은 신호발생후 봉이 완성이 되어야 인지됩니다. 청산과 b2진입이 동시 셋팅되므로 b2조건에 청산조건이 만족하지 않은 봉에서만 셋팅되게 아래와 같이 조건을 추가하셔야 합니다. input : N(1); var : AA(0),BB(0),CC(0); var : TF(0),VV(0),VH(0),VH1(0),upv(0); var : cnt(0),count(0); count = 0; for cnt = 0 to 20{ if sdate ==EntryDate(cnt) Then count = count+1; } AA = (highest(H,5760)+lowest(L,5760))/2; BB = Highest(H,1800); var1 = NthHighestBar(1,H,1800); CC = lowest(L,var1); value1 = (((BB-AA)/5)*0)+AA; value2 = (((BB-AA)/5)*1.5)+CC; Value5 = AA-(((BB-AA)/5)*3); TF = dayindex%15; if date != date[1] then{ VV = 0; VH = 0; VH1 = VH[1]; } if (TF < TF[1] and date == date[1]) Then VV = 0; VV = VV +V; if VV > VH Then VH = VV; if stime < 091500 Then value3 = VH; value4 = AA-(((BB-AA)/5)*1); if (stime >= 090300 and value3 <= VH1) or (stime >= 141500) then{ if MarketPosition == 0 and CrossDown(c,value1) and count < N Then if ((dayopen > DayClose(1)*0.98) or (dayopen <= DayClose(1)*0.98 and stime >= 141500)) then buy("b1"); if MarketPosition == 1 and MaxEntries == 1 and !Crossup(c,value2) and !CrossDown(c,value5) and !((c<Value5) and (stime < 090300 or stime>=144800)) Then buy("b2",atlimit,value4); } if crossup(c,value2) Then ExitLong(); if CrossDown(c,Value5) Then ExitLong("bx1",onclose,def,"b1"); if (c<Value5) and (stime < 090300 or stime>=144800) Then ExitLong("bx2",onclose,def,"b2"); 즐거운 하루되세요 > 사과쥬스 님이 쓴 글입니다. > 제목 : 매매횟수 제한 검토 부탁드립니다. > 아래수식에 당일 매수,매도 횟수가 1회로 제한하는 수식이 포함된 것으로 아는데 시스템 적용시 당일 매도후 다시 매수하는 경우가 생깁니다. 검토 부탁드립니다~ -아래- input : N(1); var : AA(0),BB(0),CC(0); var : TF(0),VV(0),VH(0),VH1(0),upv(0); var : cnt(0),count(0); count = 0; for cnt = 0 to 20{ if sdate ==EntryDate(cnt) Then count = count+1; } AA = (highest(H,5760)+lowest(L,5760))/2; BB = Highest(H,1800); var1 = NthHighestBar(1,H,1800); CC = lowest(L,var1); value1 = (((BB-AA)/5)*0)+AA; value2 = (((BB-AA)/5)*1.5)+CC; Value5 = AA-(((BB-AA)/5)*3); TF = dayindex%15; if date != date[1] then{ VV = 0; VH = 0; VH1 = VH[1]; } if (TF < TF[1] and date == date[1]) Then VV = 0; VV = VV +V; if VV > VH Then VH = VV; if stime < 091500 Then value3 = VH; value4 = AA-(((BB-AA)/5)*1); if (stime >= 090300 and value3 <= VH1) or (stime >= 141500) then{ if MarketPosition == 0 and CrossDown(c,value1) and count < N Then if ((dayopen > DayClose(1)*0.98) or (dayopen <= DayClose(1)*0.98 and stime >= 141500)) then buy("b1"); if MarketPosition == 1 and MaxEntries == 1 Then buy("b2",atlimit,value4); } if crossup(c,value2) Then ExitLong(); if CrossDown(c,Value5) Then ExitLong("bx1",onclose,def,"b1"); if (c<Value5) and (stime < 090300 or stime>=144800) Then ExitLong("bx2",onclose,def,"b2");