커뮤니티

문의드립니다

프로필 이미지
jesten77
2021-11-11 22:48:48
941
글번호 153553
답변완료
답변이 없으셔서 다시 남김니다. 주신 수식을 보면 기종 수식과 같고 수정해주신 내용이 없습니다.ㅎ 수정하신 수식으로 부탁드립니다. 그리고 * 신호가 나온 현재 캔들의 종가 진입에서 다음봉에서 N틱이상 눌렀다가 신호나온 캔들의 종가를 재돌파할 때 진입하는 수식을 추가한 것도 부탁드립니다. 감사합니다~ > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 문의 드립니다. > 안녕하세요 예스스탁입니다. 올리신 수식에 H1,L1은 변수로 지정만 되어 있고 실제 수식안에서는 어떤 값도 저장받지 않고 있습니다. 아무값도 저장받지 않아 해당 변수들의 값은 선언시 지정한 초기값인 0입니다. 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 { T = 0; Tcond = true; } if Tcond == true Then { if C > H1[n1]+PriceScale*1 and C > O Then Buy("b"); if C < L1[N1]-PriceScale*1 and C < O Then Sell("s"); 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 님이 쓴 글입니다. > 제목 : 문의 드립니다. > 친절한 도움에 감사드립니다. 수식 사용 중에 의도한 것과 상이하여 문의 드립니다. 제가 확인하고 싶은 것은 현재 캔들이 현재 캔들 이전 1~N번째 캔들 중에 최고가를 돌파하면 현재캔들의 종가에 매수(단, 양봉에만). 최저가를 돌파하면 현재캔들의 종가에 매도(단, 음봉에만). 이 내용입니다. 아래 수식은 N을 5로 해서 해봤는데요. 세가지 상이한 점을 말씀드립니다. 1. 제 의도한 개념으로는 1번 음봉의 종가에 매도 신호가 나오고 진입하는 것이 맞는 거 같습니다. 이전 5개 캔들의 최저가를 돌파한 캔들이니까요. 그런데 그 다음 양봉캔들에서 매수로 진입하였습니다. 2. 3번 매수 진입은 왜 진입한 건지 이해가 안됩니다. 이전 캔들 5개의 최고가를 넘긴 것이 안닌데 말입니다. 오히려 앞에 2번째 음봉 캔들(2번)의 종가에 매도가 들어가는 것이 맞는데요. 이 부분도 확인 부탁드립니다. 3. 4번 매수 진입도 맞지 않습니다. 이전 5개 캔들의 최저가를 돌파했으니 매도 진입이 맞는데, 양봉이니 매도 진입하지 않아야 맞습니다. 확인 수정 부탁드립니다. 아래 수식 수정한 것 외에..... * 신호가 나온 현재 캔들의 종가 진입인데, 다음봉에서 N틱이상 눌렀다가 신호나온 캔들의 종가를 돌파할 때 진입하는 수식, 추가로 부탁드립니다. 수식과 차트 이미지 같이 올려드립니다. 감사합니다. 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 { T = 0; Tcond = true; } if Tcond == true Then { if C > H1[n1]+PriceScale*1 and C > O Then Buy("b"); if C < L1[N1]-PriceScale*1 and C < O Then Sell("s"); 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-12 11:17:34

안녕하세요 예스스탁입니다. 1 죄송합니다. 식이 잘못 올려졌습니다. 아래가 수정한 식입니다. 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 { T = 0; Tcond = true; } if Tcond == true Then { if C > Highest(H,n1)[1] and C > O Then Buy("b"); if C < Lowest(L,N1)[1] and C < O Then Sell("s"); 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); } } 2 input : n1(5); input : StartTime(233000),EndTime(013000),n(3); input : 익절틱수(80),손절틱수(0); var : Tcond(false), T(0),S(0),Y(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 { T = 0; Tcond = true; } if Tcond == true Then { if C > Highest(H,n1)[1] and C > O Then { T = 1; S = C; Y = S; Buy("b"); } if C < Lowest(L,N1)[1] and C < O Then { T = 1; S = C; Y = S; Sell("s"); } if T == 1 Then { if C < Y Then Y = C; if Y <= S-PriceScale*n and CrossUp(C,S) Then { T = 2; Buy(); } } if T == -1 Then { if C > Y Then Y = C; if Y >= S+PriceScale*n and CrossDown(C,S) Then { T = -2; Sell(); } } 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틱이상 눌렀다가 신호나온 캔들의 종가를 재돌파할 때 진입하는 수식을 추가한 것도 부탁드립니다. 감사합니다~ > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 문의 드립니다. > 안녕하세요 예스스탁입니다. 올리신 수식에 H1,L1은 변수로 지정만 되어 있고 실제 수식안에서는 어떤 값도 저장받지 않고 있습니다. 아무값도 저장받지 않아 해당 변수들의 값은 선언시 지정한 초기값인 0입니다. 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 { T = 0; Tcond = true; } if Tcond == true Then { if C > H1[n1]+PriceScale*1 and C > O Then Buy("b"); if C < L1[N1]-PriceScale*1 and C < O Then Sell("s"); 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 님이 쓴 글입니다. > 제목 : 문의 드립니다. > 친절한 도움에 감사드립니다. 수식 사용 중에 의도한 것과 상이하여 문의 드립니다. 제가 확인하고 싶은 것은 현재 캔들이 현재 캔들 이전 1~N번째 캔들 중에 최고가를 돌파하면 현재캔들의 종가에 매수(단, 양봉에만). 최저가를 돌파하면 현재캔들의 종가에 매도(단, 음봉에만). 이 내용입니다. 아래 수식은 N을 5로 해서 해봤는데요. 세가지 상이한 점을 말씀드립니다. 1. 제 의도한 개념으로는 1번 음봉의 종가에 매도 신호가 나오고 진입하는 것이 맞는 거 같습니다. 이전 5개 캔들의 최저가를 돌파한 캔들이니까요. 그런데 그 다음 양봉캔들에서 매수로 진입하였습니다. 2. 3번 매수 진입은 왜 진입한 건지 이해가 안됩니다. 이전 캔들 5개의 최고가를 넘긴 것이 안닌데 말입니다. 오히려 앞에 2번째 음봉 캔들(2번)의 종가에 매도가 들어가는 것이 맞는데요. 이 부분도 확인 부탁드립니다. 3. 4번 매수 진입도 맞지 않습니다. 이전 5개 캔들의 최저가를 돌파했으니 매도 진입이 맞는데, 양봉이니 매도 진입하지 않아야 맞습니다. 확인 수정 부탁드립니다. 아래 수식 수정한 것 외에..... * 신호가 나온 현재 캔들의 종가 진입인데, 다음봉에서 N틱이상 눌렀다가 신호나온 캔들의 종가를 돌파할 때 진입하는 수식, 추가로 부탁드립니다. 수식과 차트 이미지 같이 올려드립니다. 감사합니다. 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 { T = 0; Tcond = true; } if Tcond == true Then { if C > H1[n1]+PriceScale*1 and C > O Then Buy("b"); if C < L1[N1]-PriceScale*1 and C < O Then Sell("s"); 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); } }