커뮤니티

문의드립니다

프로필 이미지
jesten77
2021-11-03 07:52:50
540
글번호 153332
답변완료
수고많으십니다~ 1. 현재 캔들이 이전 30개 캔들의 최고가를 돌파하면 매수, 이전 30개 캔들의 최저가를 돌파하면 매도. 아래 수식을 데모해보면 꼭 그렇지만은 않은 거 같습니다. 확인 및 수정 부탁드립니다. 2. 그리고 n1(10), n2(30) 로 했을때, 현재 캔들의 이전 30개 캔들의 최고가와 10개 캔들의 최고가를 돌파할 때 매수, 현재 캔들의 이전 30개 캔들의 최저가와 10개 캔들의 최저가를 돌파할 때 매도. 이 수식도 추가해 주시면 좋겠습니다. 친절한 도움에 감사드립니다~~ input : n1(30); input : StartTime(223000),EndTime(233000); input : 익절틱수(80),손절틱수(0); var : Tcond(false); 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; if Tcond == true Then { #봉완성 매수 if C > H[n1]+PriceScale*1 and C > O Then Buy("b"); #봉완성 매도 if C < L[N1]-PriceScale*1 and C < O Then Sell("s"); #즉시 매수 if NextBarOpen <= H[n1] Then Buy("b1",AtStop,H[n1]+PriceScale*1); #즉시 매도 if NextBarOpen >= L[n1] Then Sell("s1",AtStop,L[n1]-PriceScale*1); #매수진입 후 매수봉의 저가보다 1틱이상 낮은 시세 발생하면 청산 if MarketPosition == 1 Then ExitLong("bx",AtStop,L[BarsSinceEntry]-PriceScale*1); #매도진입 후 매도봉의 고가보다 1틱이상 높은 시세 발생하면 청산 if MarketPosition == -1 Then ExitShort("sx",AtStop,H[BarsSinceEntry]+PriceScale*1); } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop);
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2021-11-04 11:07:02

안녕하세요 예스스탁입니다. 현재 수식이 이전 30개봉이 아닌 30봉전으로 되어 있습니다. 이전 30개봉 최고/최저로 변경해 드립니다. 1 input : n1(30); input : StartTime(223000),EndTime(233000); input : 익절틱수(80),손절틱수(0); var : Tcond(false); 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; if Tcond == true Then { #봉완성 매수 if MarketPosition <= 0 and C > HighesT(h,N1)[1] and C > O Then Buy("b"); #봉완성 매도 if MarketPosition >= 0 and C < LowesT(l,N1)[1] and C < O Then Sell("s"); #즉시 매수 if MarketPosition <= 0 Then Buy("b1",AtStop,Highest(H,N1)+PriceScale*1); #즉시 매도 if MarketPosition >= 0 Then Sell("s1",AtStop,Lowest(L,n1)-PriceScale*1); #매수진입 후 매수봉의 저가보다 1틱이상 낮은 시세 발생하면 청산 if MarketPosition == 1 Then ExitLong("bx",AtStop,L[BarsSinceEntry]-PriceScale*1); #매도진입 후 매도봉의 고가보다 1틱이상 높은 시세 발생하면 청산 if MarketPosition == -1 Then ExitShort("sx",AtStop,H[BarsSinceEntry]+PriceScale*1); } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); 2 input : n1(10),n2(30); input : StartTime(223000),EndTime(233000); input : 익절틱수(80),손절틱수(0); var : Tcond(false); 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; if Tcond == true Then { #봉완성 매수 if MarketPosition <= 0 and C > HighesT(h,N1)[1] and C > HighesT(h,N2)[1] and C > O Then Buy("b"); #봉완성 매도 if MarketPosition >= 0 and C < LowesT(L,N1)[1] and C < LowesT(L,N2)[1] and C < O Then Sell("s"); #즉시 매수 if MarketPosition <= 0 Then Buy("b1",AtStop,max(Highest(h,N1),Highest(H,N2))+PriceScale*1); #즉시 매도 if MarketPosition >= 0 Then Sell("s1",AtStop,min(Lowest(L,n1),Lowest(L,n2))-PriceScale*1); #매수진입 후 매수봉의 저가보다 1틱이상 낮은 시세 발생하면 청산 if MarketPosition == 1 Then ExitLong("bx",AtStop,L[BarsSinceEntry]-PriceScale*1); #매도진입 후 매도봉의 고가보다 1틱이상 높은 시세 발생하면 청산 if MarketPosition == -1 Then ExitShort("sx",AtStop,H[BarsSinceEntry]+PriceScale*1); } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); 즐거운 하루되세요 > jesten77 님이 쓴 글입니다. > 제목 : 문의드립니다 > 수고많으십니다~ 1. 현재 캔들이 이전 30개 캔들의 최고가를 돌파하면 매수, 이전 30개 캔들의 최저가를 돌파하면 매도. 아래 수식을 데모해보면 꼭 그렇지만은 않은 거 같습니다. 확인 및 수정 부탁드립니다. 2. 그리고 n1(10), n2(30) 로 했을때, 현재 캔들의 이전 30개 캔들의 최고가와 10개 캔들의 최고가를 돌파할 때 매수, 현재 캔들의 이전 30개 캔들의 최저가와 10개 캔들의 최저가를 돌파할 때 매도. 이 수식도 추가해 주시면 좋겠습니다. 친절한 도움에 감사드립니다~~ input : n1(30); input : StartTime(223000),EndTime(233000); input : 익절틱수(80),손절틱수(0); var : Tcond(false); 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; if Tcond == true Then { #봉완성 매수 if C > H[n1]+PriceScale*1 and C > O Then Buy("b"); #봉완성 매도 if C < L[N1]-PriceScale*1 and C < O Then Sell("s"); #즉시 매수 if NextBarOpen <= H[n1] Then Buy("b1",AtStop,H[n1]+PriceScale*1); #즉시 매도 if NextBarOpen >= L[n1] Then Sell("s1",AtStop,L[n1]-PriceScale*1); #매수진입 후 매수봉의 저가보다 1틱이상 낮은 시세 발생하면 청산 if MarketPosition == 1 Then ExitLong("bx",AtStop,L[BarsSinceEntry]-PriceScale*1); #매도진입 후 매도봉의 고가보다 1틱이상 높은 시세 발생하면 청산 if MarketPosition == -1 Then ExitShort("sx",AtStop,H[BarsSinceEntry]+PriceScale*1); } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop);