커뮤니티

문의 드립니다.

프로필 이미지
jesten77
2021-11-12 23:25:00
561
글번호 153584
답변완료

첨부 이미지

비슷한거 추가 문의 드립니다. 이전캔들 N(5)개 봉 최고가 최저가 돌파시 매수 매도 진입하는 수식입니다. 조건 되면 즉시 매수 매도인데요. 양봉이더라도 즉시 매수이니 이전 음봉캔들이 최저가이니 그 저가를 깨는 즉시 매도 들어가는 맞는데 진입이 없었습니다. 2번 부분도 진입이 되어야 하는데 안되었구요. 아래 수식이 맞는 지도 확인 및 수정 부탁드립니다. 수식과 이미지 남겨드립니다. 감사합니다. input : n1(5); input : StartTime(233000),EndTime(013000); input : 익절틱수(80),손절틱수(0); var : Tcond(false), T(0); Array : H1[50](0),L1[50](0); if (sdate != sdate[1] and stime >= EndTime) or (sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then Tcond = False; if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then Tcond = true; { T = 0; Tcond = true; } if Tcond == true Then { if NextBarOpen <= Highest(H,n1)[1] Then Buy("b1",AtStop,Highest(H,n1)[1]+PriceScale*1); if NextBarOpen >= Lowest(L,N1)[1] Then Sell("s1",AtStop,Lowest(L,N1)[1]-PriceScale*1); if MarketPosition == 1 Then ExitLong("bx",AtStop,L[BarsSinceEntry]-PriceScale*1); if MarketPosition == -1 Then ExitShort("sx",AtStop,H[BarsSinceEntry]+PriceScale*1); } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { IF Endtime <= starttime Then { SetStopEndofday(0); } }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2021-11-15 10:51:47

안녕하세요 예스스탁입니다. 현재수식이 봉의 stime으로 23시30분 이후에 진입하게 되어 있습니다. 1번으로 지정하신 봉에 신호를 보시려면 시간을 조정해 보셔야 합니다. 최근 완성봉기준이 아닌 전봉을 기준으로 값이 셋팅되서 식을 수정해 드립니다. 또한 즉시신호는 봉 중간에 발생을 하는데 갭이 있어 봉의 시가에서 가격조건이 충족되어 바로 뜨면 양음봉 결정이 없을때 발생하므로 수식에 시가는 n1개봉 최고가 이하, n1개봉 최저가 이상에서 형성된 후에 상승이나 하락시 신호가 발생하게 작성되어 있습니다. 미완성시 신호발생시점에는 양봉이나 음봉이지만 봉완성시에는 다를수 있습니다. input : n1(5); input : StartTime(233000),EndTime(013000); input : 익절틱수(80),손절틱수(0); var : Tcond(false), T(0); Array : H1[50](0),L1[50](0); if (sdate != sdate[1] and stime >= EndTime) or (sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then Tcond = False; if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then Tcond = true; { T = 0; Tcond = true; } if Tcond == true Then { if MarketPosition <= 0 and NextBarOpen <= Highest(H,n1) Then Buy("b1",AtStop,Highest(H,n1)+PriceScale*1); if MarketPosition >= 0 and NextBarOpen >= Lowest(L,N1) Then Sell("s1",AtStop,Lowest(L,N1)-PriceScale*1); if MarketPosition == 1 Then ExitLong("bx",AtStop,L[BarsSinceEntry]-PriceScale*1); if MarketPosition == -1 Then ExitShort("sx",AtStop,H[BarsSinceEntry]+PriceScale*1); } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { IF Endtime <= starttime Then { SetStopEndofday(0); } } 즐거운 하루되세요 > jesten77 님이 쓴 글입니다. > 제목 : 문의 드립니다. > 비슷한거 추가 문의 드립니다. 이전캔들 N(5)개 봉 최고가 최저가 돌파시 매수 매도 진입하는 수식입니다. 조건 되면 즉시 매수 매도인데요. 양봉이더라도 즉시 매수이니 이전 음봉캔들이 최저가이니 그 저가를 깨는 즉시 매도 들어가는 맞는데 진입이 없었습니다. 2번 부분도 진입이 되어야 하는데 안되었구요. 아래 수식이 맞는 지도 확인 및 수정 부탁드립니다. 수식과 이미지 남겨드립니다. 감사합니다. input : n1(5); input : StartTime(233000),EndTime(013000); input : 익절틱수(80),손절틱수(0); var : Tcond(false), T(0); Array : H1[50](0),L1[50](0); if (sdate != sdate[1] and stime >= EndTime) or (sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then Tcond = False; if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then Tcond = true; { T = 0; Tcond = true; } if Tcond == true Then { if NextBarOpen <= Highest(H,n1)[1] Then Buy("b1",AtStop,Highest(H,n1)[1]+PriceScale*1); if NextBarOpen >= Lowest(L,N1)[1] Then Sell("s1",AtStop,Lowest(L,N1)[1]-PriceScale*1); if MarketPosition == 1 Then ExitLong("bx",AtStop,L[BarsSinceEntry]-PriceScale*1); if MarketPosition == -1 Then ExitShort("sx",AtStop,H[BarsSinceEntry]+PriceScale*1); } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { IF Endtime <= starttime Then { SetStopEndofday(0); } }