커뮤니티

문의드립니다

프로필 이미지
jesten77
2021-10-28 20:22:22
735
글번호 153232
답변완료

첨부 이미지

수정해주신 수식으로 데모해본 결과 문의 사항이 있어 남김니다. 데모 차트와 거래내역 표시해서 같이 올려 드립니다. # 먼저 종가 진입 수식 부분입니다. 1. 22:32 분에 조건이 맞는데도 진입하지 않고 22:34분에 진입했습니다. 32분에 진입했으면 익절인데 34분에 진입해서 손절이 되었습니다. 2. 22:46 분에 진입한 것은 1분봉으로 구분해서 봐도 익절인데 익절되지 않고 손절 되었습니다. 아래 수식에서 수정할 부분이 있는지 확인 부탁드립니다. 그리고 종가 진입은 조건이 맞더라도 매수는 양봉에만, 매도는 음봉에만 진입하는 것이 반영되어 있지 않으면 반영해주세요. input : ntime1(6),ntime2(30),n(10); input : StartTime(222500),EndTime(010000); input : 익절틱수(50),손절틱수(50); var : S1(0),D1(0),TM(0),TF1(0),TF2(0),cnt(0),HH(0),LL(0); var : Tcond(false),BE1(False),BE2(False),SE1(False),SE2(False); Array : H1[50](0),L1[50](0),H2[50](0),L2[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 Bdate != Bdate[1] Then { S1 = TimeToMinutes(stime); D1 = sdate; } if D1 > 0 then { if sdate == D1 Then TM = TimeToMinutes(stime)-S1; Else TM = TimeToMinutes(stime)+1440-S1; TF1 = TM%ntime1; TF2 = TM%ntime2; if Bdate != Bdate[1] or (Bdate == Bdate[1] and ntime1 > 1 and TF1 < TF1[1]) or (Bdate == Bdate[1] and ntime1 > 1 and TM >= TM[1]+ntime1) or (Bdate == Bdate[1] and ntime1 == 1 and TM > TM[1]) Then { H1[0] = H; L1[0] = L; For cnt = 1 to 49 { H1[cnt] = H1[cnt-1][1]; L1[cnt] = L1[cnt-1][1]; } } if H1[0] > 0 and H > H1[0] Then H1[0] = H; if L1[0] > 0 and L < L1[0] Then L1[0] = L; HH = 0; LL = 0; if H1[n] > 0 and L1[n] > 0 Then { For cnt = 1 to N { if HH == 0 or (HH > 0 and H1[cnt] > HH) Then HH = H1[cnt]; if LL == 0 or (LL > 0 and L1[cnt] < LL) Then LL = L1[cnt]; } } if Bdate != Bdate[1] or (Bdate == Bdate[1] and ntime2 > 1 and TF2 < TF2[1]) or (Bdate == Bdate[1] and ntime2 > 1 and TM >= TM[1]+ntime2) or (Bdate == Bdate[1] and ntime2 == 1 and TM > TM[1]) Then { H2[0] = H; L2[0] = L; For cnt = 1 to 49 { H2[cnt] = H2[cnt-1][1]; L2[cnt] = L2[cnt-1][1]; } } if H2[0] > 0 and H > H2[0] Then H2[0] = H; if L2[0] > 0 and L < L2[0] Then L2[0] = L; if Tcond == true Then { if MarketPosition <= 0 and HH > 0 and H2[n] > 0 and C > max(HH,H2[n])+PriceScale*1 Then Buy("b3"); if MarketPosition >= 0 and LL > 0 and L2[n] > 0 and C < min(LL,L2[n])-PriceScale*1 Then Sell("s3"); } } 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); } }
시스템
답변 3
프로필 이미지

예스스탁 예스스탁 답변

2021-10-29 13:47:34

안녕하세요 예스스탁입니다. 올려주신 내용은 수식에서 수정할 부분이 없습니다. 매수에 양봉, 매도에 음봉조건만 추가해 드립니다. 1 종가기준 2개의 값보다 커야 합니다. 22시32분봉의 종가는 2개값보다 크지 않습니다. 아래 3번의 지표식 적용해 보시기 바랍니1다. HH와 H2[n], LL과 L2[n]이 그려지는 지표입니다. 각 봉의 종가와 비교해 보시면 됩니다. 2 차트의 과거 데이타는 시고저종만 있어 과거봉에 대해서는 실제 움직임을 알수가 없어 봉움직임에 대한 가설을 만들고 해당 가설과 같이 움직였다고 보고 신호를 발생합니다. 그래서 실제에서는 익절이 먼저 되었지만 시뮬레이션에서는 손절이 먼저된것으로 나올수도 있고 그 반대일수도 있습니다. 과거 움직임 가설에 대해서는 예스랭귀지 도움말에서 자세한 내용을 확인하시기 바랍니다 3 input : ntime1(6),ntime2(30),n(10); input : StartTime(222500),EndTime(010000); input : 익절틱수(50),손절틱수(50); var : S1(0),D1(0),TM(0),TF1(0),TF2(0),cnt(0),HH(0),LL(0); var : Tcond(false),BE1(False),BE2(False),SE1(False),SE2(False); Array : H1[50](0),L1[50](0),H2[50](0),L2[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 Bdate != Bdate[1] Then { S1 = TimeToMinutes(stime); D1 = sdate; } if D1 > 0 then { if sdate == D1 Then TM = TimeToMinutes(stime)-S1; Else TM = TimeToMinutes(stime)+1440-S1; TF1 = TM%ntime1; TF2 = TM%ntime2; if Bdate != Bdate[1] or (Bdate == Bdate[1] and ntime1 > 1 and TF1 < TF1[1]) or (Bdate == Bdate[1] and ntime1 > 1 and TM >= TM[1]+ntime1) or (Bdate == Bdate[1] and ntime1 == 1 and TM > TM[1]) Then { H1[0] = H; L1[0] = L; For cnt = 1 to 49 { H1[cnt] = H1[cnt-1][1]; L1[cnt] = L1[cnt-1][1]; } } if H1[0] > 0 and H > H1[0] Then H1[0] = H; if L1[0] > 0 and L < L1[0] Then L1[0] = L; HH = 0; LL = 0; if H1[n] > 0 and L1[n] > 0 Then { For cnt = 1 to N { if HH == 0 or (HH > 0 and H1[cnt] > HH) Then HH = H1[cnt]; if LL == 0 or (LL > 0 and L1[cnt] < LL) Then LL = L1[cnt]; } } if Bdate != Bdate[1] or (Bdate == Bdate[1] and ntime2 > 1 and TF2 < TF2[1]) or (Bdate == Bdate[1] and ntime2 > 1 and TM >= TM[1]+ntime2) or (Bdate == Bdate[1] and ntime2 == 1 and TM > TM[1]) Then { H2[0] = H; L2[0] = L; For cnt = 1 to 49 { H2[cnt] = H2[cnt-1][1]; L2[cnt] = L2[cnt-1][1]; } } if H2[0] > 0 and H > H2[0] Then H2[0] = H; if L2[0] > 0 and L < L2[0] Then L2[0] = L; Plot1(HH); plot2(H2[n]); Plot3(LL); plot4(L2[n]); } 즐거운 하루되세요 > jesten77 님이 쓴 글입니다. > 제목 : 문의드립니다 > 수정해주신 수식으로 데모해본 결과 문의 사항이 있어 남김니다. 데모 차트와 거래내역 표시해서 같이 올려 드립니다. # 먼저 종가 진입 수식 부분입니다. 1. 22:32 분에 조건이 맞는데도 진입하지 않고 22:34분에 진입했습니다. 32분에 진입했으면 익절인데 34분에 진입해서 손절이 되었습니다. 2. 22:46 분에 진입한 것은 1분봉으로 구분해서 봐도 익절인데 익절되지 않고 손절 되었습니다. 아래 수식에서 수정할 부분이 있는지 확인 부탁드립니다. 그리고 종가 진입은 조건이 맞더라도 매수는 양봉에만, 매도는 음봉에만 진입하는 것이 반영되어 있지 않으면 반영해주세요. input : ntime1(6),ntime2(30),n(10); input : StartTime(222500),EndTime(010000); input : 익절틱수(50),손절틱수(50); var : S1(0),D1(0),TM(0),TF1(0),TF2(0),cnt(0),HH(0),LL(0); var : Tcond(false),BE1(False),BE2(False),SE1(False),SE2(False); Array : H1[50](0),L1[50](0),H2[50](0),L2[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 Bdate != Bdate[1] Then { S1 = TimeToMinutes(stime); D1 = sdate; } if D1 > 0 then { if sdate == D1 Then TM = TimeToMinutes(stime)-S1; Else TM = TimeToMinutes(stime)+1440-S1; TF1 = TM%ntime1; TF2 = TM%ntime2; if Bdate != Bdate[1] or (Bdate == Bdate[1] and ntime1 > 1 and TF1 < TF1[1]) or (Bdate == Bdate[1] and ntime1 > 1 and TM >= TM[1]+ntime1) or (Bdate == Bdate[1] and ntime1 == 1 and TM > TM[1]) Then { H1[0] = H; L1[0] = L; For cnt = 1 to 49 { H1[cnt] = H1[cnt-1][1]; L1[cnt] = L1[cnt-1][1]; } } if H1[0] > 0 and H > H1[0] Then H1[0] = H; if L1[0] > 0 and L < L1[0] Then L1[0] = L; HH = 0; LL = 0; if H1[n] > 0 and L1[n] > 0 Then { For cnt = 1 to N { if HH == 0 or (HH > 0 and H1[cnt] > HH) Then HH = H1[cnt]; if LL == 0 or (LL > 0 and L1[cnt] < LL) Then LL = L1[cnt]; } } if Bdate != Bdate[1] or (Bdate == Bdate[1] and ntime2 > 1 and TF2 < TF2[1]) or (Bdate == Bdate[1] and ntime2 > 1 and TM >= TM[1]+ntime2) or (Bdate == Bdate[1] and ntime2 == 1 and TM > TM[1]) Then { H2[0] = H; L2[0] = L; For cnt = 1 to 49 { H2[cnt] = H2[cnt-1][1]; L2[cnt] = L2[cnt-1][1]; } } if H2[0] > 0 and H > H2[0] Then H2[0] = H; if L2[0] > 0 and L < L2[0] Then L2[0] = L; if Tcond == true Then { if MarketPosition <= 0 and HH > 0 and H2[n] > 0 and C > max(HH,H2[n])+PriceScale*1 Then Buy("b3"); if MarketPosition >= 0 and LL > 0 and L2[n] > 0 and C < min(LL,L2[n])-PriceScale*1 Then Sell("s3"); } } 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

2021-10-29 15:41:56

아래에 주신 수식이 종가진입, 매수는 양봉에만, 매도는 음봉에만 진입하는 것을 추가해 주신 것인가요? 기존 수식과 다른 부분이 있어서요. 확인부탁드립니다. > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 문의드립니다 > 안녕하세요 예스스탁입니다. 올려주신 내용은 수식에서 수정할 부분이 없습니다. 매수에 양봉, 매도에 음봉조건만 추가해 드립니다. 1 종가기준 2개의 값보다 커야 합니다. 22시32분봉의 종가는 2개값보다 크지 않습니다. 아래 3번의 지표식 적용해 보시기 바랍니1다. HH와 H2[n], LL과 L2[n]이 그려지는 지표입니다. 각 봉의 종가와 비교해 보시면 됩니다. 2 차트의 과거 데이타는 시고저종만 있어 과거봉에 대해서는 실제 움직임을 알수가 없어 봉움직임에 대한 가설을 만들고 해당 가설과 같이 움직였다고 보고 신호를 발생합니다. 그래서 실제에서는 익절이 먼저 되었지만 시뮬레이션에서는 손절이 먼저된것으로 나올수도 있고 그 반대일수도 있습니다. 과거 움직임 가설에 대해서는 예스랭귀지 도움말에서 자세한 내용을 확인하시기 바랍니다 3 input : ntime1(6),ntime2(30),n(10); input : StartTime(222500),EndTime(010000); input : 익절틱수(50),손절틱수(50); var : S1(0),D1(0),TM(0),TF1(0),TF2(0),cnt(0),HH(0),LL(0); var : Tcond(false),BE1(False),BE2(False),SE1(False),SE2(False); Array : H1[50](0),L1[50](0),H2[50](0),L2[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 Bdate != Bdate[1] Then { S1 = TimeToMinutes(stime); D1 = sdate; } if D1 > 0 then { if sdate == D1 Then TM = TimeToMinutes(stime)-S1; Else TM = TimeToMinutes(stime)+1440-S1; TF1 = TM%ntime1; TF2 = TM%ntime2; if Bdate != Bdate[1] or (Bdate == Bdate[1] and ntime1 > 1 and TF1 < TF1[1]) or (Bdate == Bdate[1] and ntime1 > 1 and TM >= TM[1]+ntime1) or (Bdate == Bdate[1] and ntime1 == 1 and TM > TM[1]) Then { H1[0] = H; L1[0] = L; For cnt = 1 to 49 { H1[cnt] = H1[cnt-1][1]; L1[cnt] = L1[cnt-1][1]; } } if H1[0] > 0 and H > H1[0] Then H1[0] = H; if L1[0] > 0 and L < L1[0] Then L1[0] = L; HH = 0; LL = 0; if H1[n] > 0 and L1[n] > 0 Then { For cnt = 1 to N { if HH == 0 or (HH > 0 and H1[cnt] > HH) Then HH = H1[cnt]; if LL == 0 or (LL > 0 and L1[cnt] < LL) Then LL = L1[cnt]; } } if Bdate != Bdate[1] or (Bdate == Bdate[1] and ntime2 > 1 and TF2 < TF2[1]) or (Bdate == Bdate[1] and ntime2 > 1 and TM >= TM[1]+ntime2) or (Bdate == Bdate[1] and ntime2 == 1 and TM > TM[1]) Then { H2[0] = H; L2[0] = L; For cnt = 1 to 49 { H2[cnt] = H2[cnt-1][1]; L2[cnt] = L2[cnt-1][1]; } } if H2[0] > 0 and H > H2[0] Then H2[0] = H; if L2[0] > 0 and L < L2[0] Then L2[0] = L; Plot1(HH); plot2(H2[n]); Plot3(LL); plot4(L2[n]); } 즐거운 하루되세요 > jesten77 님이 쓴 글입니다. > 제목 : 문의드립니다 > 수정해주신 수식으로 데모해본 결과 문의 사항이 있어 남김니다. 데모 차트와 거래내역 표시해서 같이 올려 드립니다. # 먼저 종가 진입 수식 부분입니다. 1. 22:32 분에 조건이 맞는데도 진입하지 않고 22:34분에 진입했습니다. 32분에 진입했으면 익절인데 34분에 진입해서 손절이 되었습니다. 2. 22:46 분에 진입한 것은 1분봉으로 구분해서 봐도 익절인데 익절되지 않고 손절 되었습니다. 아래 수식에서 수정할 부분이 있는지 확인 부탁드립니다. 그리고 종가 진입은 조건이 맞더라도 매수는 양봉에만, 매도는 음봉에만 진입하는 것이 반영되어 있지 않으면 반영해주세요. input : ntime1(6),ntime2(30),n(10); input : StartTime(222500),EndTime(010000); input : 익절틱수(50),손절틱수(50); var : S1(0),D1(0),TM(0),TF1(0),TF2(0),cnt(0),HH(0),LL(0); var : Tcond(false),BE1(False),BE2(False),SE1(False),SE2(False); Array : H1[50](0),L1[50](0),H2[50](0),L2[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 Bdate != Bdate[1] Then { S1 = TimeToMinutes(stime); D1 = sdate; } if D1 > 0 then { if sdate == D1 Then TM = TimeToMinutes(stime)-S1; Else TM = TimeToMinutes(stime)+1440-S1; TF1 = TM%ntime1; TF2 = TM%ntime2; if Bdate != Bdate[1] or (Bdate == Bdate[1] and ntime1 > 1 and TF1 < TF1[1]) or (Bdate == Bdate[1] and ntime1 > 1 and TM >= TM[1]+ntime1) or (Bdate == Bdate[1] and ntime1 == 1 and TM > TM[1]) Then { H1[0] = H; L1[0] = L; For cnt = 1 to 49 { H1[cnt] = H1[cnt-1][1]; L1[cnt] = L1[cnt-1][1]; } } if H1[0] > 0 and H > H1[0] Then H1[0] = H; if L1[0] > 0 and L < L1[0] Then L1[0] = L; HH = 0; LL = 0; if H1[n] > 0 and L1[n] > 0 Then { For cnt = 1 to N { if HH == 0 or (HH > 0 and H1[cnt] > HH) Then HH = H1[cnt]; if LL == 0 or (LL > 0 and L1[cnt] < LL) Then LL = L1[cnt]; } } if Bdate != Bdate[1] or (Bdate == Bdate[1] and ntime2 > 1 and TF2 < TF2[1]) or (Bdate == Bdate[1] and ntime2 > 1 and TM >= TM[1]+ntime2) or (Bdate == Bdate[1] and ntime2 == 1 and TM > TM[1]) Then { H2[0] = H; L2[0] = L; For cnt = 1 to 49 { H2[cnt] = H2[cnt-1][1]; L2[cnt] = L2[cnt-1][1]; } } if H2[0] > 0 and H > H2[0] Then H2[0] = H; if L2[0] > 0 and L < L2[0] Then L2[0] = L; if Tcond == true Then { if MarketPosition <= 0 and HH > 0 and H2[n] > 0 and C > max(HH,H2[n])+PriceScale*1 Then Buy("b3"); if MarketPosition >= 0 and LL > 0 and L2[n] > 0 and C < min(LL,L2[n])-PriceScale*1 Then Sell("s3"); } } 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); } }
프로필 이미지

예스스탁 예스스탁 답변

2021-10-29 15:49:55

안녕하세요 예스스탁입니다. 답변에 누락이 있었습니다. 올려드린 3번식은 지표식입니다. 아래식이 양봉/음봉 조건 추가된 시스템식입니다. 4 input : ntime1(6),ntime2(30),n(10); input : StartTime(222500),EndTime(010000); input : 익절틱수(50),손절틱수(50); var : S1(0),D1(0),TM(0),TF1(0),TF2(0),cnt(0),HH(0),LL(0); var : Tcond(false),BE1(False),BE2(False),SE1(False),SE2(False); Array : H1[50](0),L1[50](0),H2[50](0),L2[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 Bdate != Bdate[1] Then { S1 = TimeToMinutes(stime); D1 = sdate; } if D1 > 0 then { if sdate == D1 Then TM = TimeToMinutes(stime)-S1; Else TM = TimeToMinutes(stime)+1440-S1; TF1 = TM%ntime1; TF2 = TM%ntime2; if Bdate != Bdate[1] or (Bdate == Bdate[1] and ntime1 > 1 and TF1 < TF1[1]) or (Bdate == Bdate[1] and ntime1 > 1 and TM >= TM[1]+ntime1) or (Bdate == Bdate[1] and ntime1 == 1 and TM > TM[1]) Then { H1[0] = H; L1[0] = L; For cnt = 1 to 49 { H1[cnt] = H1[cnt-1][1]; L1[cnt] = L1[cnt-1][1]; } } if H1[0] > 0 and H > H1[0] Then H1[0] = H; if L1[0] > 0 and L < L1[0] Then L1[0] = L; HH = 0; LL = 0; if H1[n] > 0 and L1[n] > 0 Then { For cnt = 1 to N { if HH == 0 or (HH > 0 and H1[cnt] > HH) Then HH = H1[cnt]; if LL == 0 or (LL > 0 and L1[cnt] < LL) Then LL = L1[cnt]; } } if Bdate != Bdate[1] or (Bdate == Bdate[1] and ntime2 > 1 and TF2 < TF2[1]) or (Bdate == Bdate[1] and ntime2 > 1 and TM >= TM[1]+ntime2) or (Bdate == Bdate[1] and ntime2 == 1 and TM > TM[1]) Then { H2[0] = H; L2[0] = L; For cnt = 1 to 49 { H2[cnt] = H2[cnt-1][1]; L2[cnt] = L2[cnt-1][1]; } } if H2[0] > 0 and H > H2[0] Then H2[0] = H; if L2[0] > 0 and L < L2[0] Then L2[0] = L; if Tcond == true Then { if MarketPosition <= 0 and HH > 0 and H2[n] > 0 and C > max(HH,H2[n])+PriceScale*1 and C > O Then Buy("b3"); if MarketPosition >= 0 and LL > 0 and L2[n] > 0 and C < min(LL,L2[n])-PriceScale*1 and C < O Then Sell("s3"); } } 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 님이 쓴 글입니다. > 제목 : Re : Re : 문의드립니다 > 아래에 주신 수식이 종가진입, 매수는 양봉에만, 매도는 음봉에만 진입하는 것을 추가해 주신 것인가요? 기존 수식과 다른 부분이 있어서요. 확인부탁드립니다. > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 문의드립니다 > 안녕하세요 예스스탁입니다. 올려주신 내용은 수식에서 수정할 부분이 없습니다. 매수에 양봉, 매도에 음봉조건만 추가해 드립니다. 1 종가기준 2개의 값보다 커야 합니다. 22시32분봉의 종가는 2개값보다 크지 않습니다. 아래 3번의 지표식 적용해 보시기 바랍니1다. HH와 H2[n], LL과 L2[n]이 그려지는 지표입니다. 각 봉의 종가와 비교해 보시면 됩니다. 2 차트의 과거 데이타는 시고저종만 있어 과거봉에 대해서는 실제 움직임을 알수가 없어 봉움직임에 대한 가설을 만들고 해당 가설과 같이 움직였다고 보고 신호를 발생합니다. 그래서 실제에서는 익절이 먼저 되었지만 시뮬레이션에서는 손절이 먼저된것으로 나올수도 있고 그 반대일수도 있습니다. 과거 움직임 가설에 대해서는 예스랭귀지 도움말에서 자세한 내용을 확인하시기 바랍니다 3 input : ntime1(6),ntime2(30),n(10); input : StartTime(222500),EndTime(010000); input : 익절틱수(50),손절틱수(50); var : S1(0),D1(0),TM(0),TF1(0),TF2(0),cnt(0),HH(0),LL(0); var : Tcond(false),BE1(False),BE2(False),SE1(False),SE2(False); Array : H1[50](0),L1[50](0),H2[50](0),L2[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 Bdate != Bdate[1] Then { S1 = TimeToMinutes(stime); D1 = sdate; } if D1 > 0 then { if sdate == D1 Then TM = TimeToMinutes(stime)-S1; Else TM = TimeToMinutes(stime)+1440-S1; TF1 = TM%ntime1; TF2 = TM%ntime2; if Bdate != Bdate[1] or (Bdate == Bdate[1] and ntime1 > 1 and TF1 < TF1[1]) or (Bdate == Bdate[1] and ntime1 > 1 and TM >= TM[1]+ntime1) or (Bdate == Bdate[1] and ntime1 == 1 and TM > TM[1]) Then { H1[0] = H; L1[0] = L; For cnt = 1 to 49 { H1[cnt] = H1[cnt-1][1]; L1[cnt] = L1[cnt-1][1]; } } if H1[0] > 0 and H > H1[0] Then H1[0] = H; if L1[0] > 0 and L < L1[0] Then L1[0] = L; HH = 0; LL = 0; if H1[n] > 0 and L1[n] > 0 Then { For cnt = 1 to N { if HH == 0 or (HH > 0 and H1[cnt] > HH) Then HH = H1[cnt]; if LL == 0 or (LL > 0 and L1[cnt] < LL) Then LL = L1[cnt]; } } if Bdate != Bdate[1] or (Bdate == Bdate[1] and ntime2 > 1 and TF2 < TF2[1]) or (Bdate == Bdate[1] and ntime2 > 1 and TM >= TM[1]+ntime2) or (Bdate == Bdate[1] and ntime2 == 1 and TM > TM[1]) Then { H2[0] = H; L2[0] = L; For cnt = 1 to 49 { H2[cnt] = H2[cnt-1][1]; L2[cnt] = L2[cnt-1][1]; } } if H2[0] > 0 and H > H2[0] Then H2[0] = H; if L2[0] > 0 and L < L2[0] Then L2[0] = L; Plot1(HH); plot2(H2[n]); Plot3(LL); plot4(L2[n]); } 즐거운 하루되세요 > jesten77 님이 쓴 글입니다. > 제목 : 문의드립니다 > 수정해주신 수식으로 데모해본 결과 문의 사항이 있어 남김니다. 데모 차트와 거래내역 표시해서 같이 올려 드립니다. # 먼저 종가 진입 수식 부분입니다. 1. 22:32 분에 조건이 맞는데도 진입하지 않고 22:34분에 진입했습니다. 32분에 진입했으면 익절인데 34분에 진입해서 손절이 되었습니다. 2. 22:46 분에 진입한 것은 1분봉으로 구분해서 봐도 익절인데 익절되지 않고 손절 되었습니다. 아래 수식에서 수정할 부분이 있는지 확인 부탁드립니다. 그리고 종가 진입은 조건이 맞더라도 매수는 양봉에만, 매도는 음봉에만 진입하는 것이 반영되어 있지 않으면 반영해주세요. input : ntime1(6),ntime2(30),n(10); input : StartTime(222500),EndTime(010000); input : 익절틱수(50),손절틱수(50); var : S1(0),D1(0),TM(0),TF1(0),TF2(0),cnt(0),HH(0),LL(0); var : Tcond(false),BE1(False),BE2(False),SE1(False),SE2(False); Array : H1[50](0),L1[50](0),H2[50](0),L2[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 Bdate != Bdate[1] Then { S1 = TimeToMinutes(stime); D1 = sdate; } if D1 > 0 then { if sdate == D1 Then TM = TimeToMinutes(stime)-S1; Else TM = TimeToMinutes(stime)+1440-S1; TF1 = TM%ntime1; TF2 = TM%ntime2; if Bdate != Bdate[1] or (Bdate == Bdate[1] and ntime1 > 1 and TF1 < TF1[1]) or (Bdate == Bdate[1] and ntime1 > 1 and TM >= TM[1]+ntime1) or (Bdate == Bdate[1] and ntime1 == 1 and TM > TM[1]) Then { H1[0] = H; L1[0] = L; For cnt = 1 to 49 { H1[cnt] = H1[cnt-1][1]; L1[cnt] = L1[cnt-1][1]; } } if H1[0] > 0 and H > H1[0] Then H1[0] = H; if L1[0] > 0 and L < L1[0] Then L1[0] = L; HH = 0; LL = 0; if H1[n] > 0 and L1[n] > 0 Then { For cnt = 1 to N { if HH == 0 or (HH > 0 and H1[cnt] > HH) Then HH = H1[cnt]; if LL == 0 or (LL > 0 and L1[cnt] < LL) Then LL = L1[cnt]; } } if Bdate != Bdate[1] or (Bdate == Bdate[1] and ntime2 > 1 and TF2 < TF2[1]) or (Bdate == Bdate[1] and ntime2 > 1 and TM >= TM[1]+ntime2) or (Bdate == Bdate[1] and ntime2 == 1 and TM > TM[1]) Then { H2[0] = H; L2[0] = L; For cnt = 1 to 49 { H2[cnt] = H2[cnt-1][1]; L2[cnt] = L2[cnt-1][1]; } } if H2[0] > 0 and H > H2[0] Then H2[0] = H; if L2[0] > 0 and L < L2[0] Then L2[0] = L; if Tcond == true Then { if MarketPosition <= 0 and HH > 0 and H2[n] > 0 and C > max(HH,H2[n])+PriceScale*1 Then Buy("b3"); if MarketPosition >= 0 and LL > 0 and L2[n] > 0 and C < min(LL,L2[n])-PriceScale*1 Then Sell("s3"); } } 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); } }