커뮤니티

수정 부탁드립니다

프로필 이미지
라몬
2021-11-17 23:14:31
890
글번호 153681
답변완료
안녕하세요 아래 시스템 수정부탁드립니다. 틱 챠트에 30분봉 4등분선을 사용중이며 이 30분봉 4등분선을 가중이평 20선의 5선이 1. 25%,50%,75% 선중 위로 먼저 통과하는것에 매수 2. 25%,50%,75% 선중 아래로 먼저 통과하는것에 매도 이렇게 부탁드립니다 input : ntime(30),P(5); var : S1(0),D1(0),TM(0),TF(0); var : HH(0),LL(0),hh1(0),ll1(0),mav(0),ntimemav(0),sum(0),cnt(0); Array : CC[10](0); #기본차트이평 mav = ma(C,P); 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; TF = TM%ntime; if Bdate != Bdate[1] or (Bdate == Bdate[1] and ntime > 1 and TF < TF[1]) or (Bdate == Bdate[1] and ntime > 1 and TM >= TM[1]+ntime) or (Bdate == Bdate[1] and ntime == 1 and TM > TM[1]) Then { hh = h; ll = l; hh1 = hh[1]; ll1 = ll[1]; For cnt = 1 to 9 { CC[cnt] = CC[cnt-1][1]; } } if hh > 0 and h > hh Then hh = h; if ll > 0 and l < ll Then ll = l; #30분봉 이평 if CC[P-1] > 0 Then { sum = 0; For cnt = 0 to P-1 { sum = sum +CC[cnt]; } ntimemav = sum/P; } if CrossUp(mav,ll+(hh-ll)*0.25) Then Buy("b1"); if ntimeMav > 0 and CrossUp(ntimeMav,ll1) Then Buy("b2"); if ll1 > 0 and CrossUp(mav,ll1+(hh1-ll1)*0.25) Then Buy("b3"); if hh1 > 0 and CrossUp(mav,hh1) Then Buy("b4"); if CrossDown(mav,ll+(hh-ll)*0.75) Then Sell("s1"); if ntimeMav > 0 and CrossDown(ntimeMav,hh1) Then Sell("s2"); if ll1 > 0 and CrossDown(mav,ll1+(hh1-ll1)*0.75) Then sell("s3"); if ll1 > 0 and CrossDown(mav,ll1) Then Sell("s4"); }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2021-11-18 10:49:59

안녕하세요 예스스탁입니다. [가중이평 20선의 5선]이 어떤 값인지 명확하지 않습니다. 현재 수식에서는 기본차트의 이평(mav)과 30분봉차트의 이평(ntimemav)이 계산되고 있습니다. 또한 25%,50%,75%이 30분봉기준 전봉의 값인지 현재 진행중인 30분봉의 고저가를 이용한 값인지 불명확합니다. 아래 내용으로 수정해 드립니다. 불필요한 내용은 삭제해서 수식완성해 사용하시기 바랍니다. 기본차트의 이평은 Period로, 30분봉차트의 이평은 p로 기간설정을 분리하고 각 이평이 30분봉 전봉기준, 현재진행중인 봉기준 25%, 50%, 75%를 돌파/이탈시 신호가 발생하게 수정해 드립니다. input : Period(5),ntime(30),P(5); var : S1(0),D1(0),TM(0),TF(0); var : HH(0),LL(0),hh1(0),ll1(0),mav(0),ntimemav(0),sum(0),cnt(0); Array : CC[100](0); #기본차트이평 mav = ma(C,Period); 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; TF = TM%ntime; if Bdate != Bdate[1] or (Bdate == Bdate[1] and ntime > 1 and TF < TF[1]) or (Bdate == Bdate[1] and ntime > 1 and TM >= TM[1]+ntime) or (Bdate == Bdate[1] and ntime == 1 and TM > TM[1]) Then { hh = h; ll = l; hh1 = hh[1]; ll1 = ll[1]; For cnt = 1 to 99 { CC[cnt] = CC[cnt-1][1]; } } if hh > 0 and h > hh Then hh = h; if ll > 0 and l < ll Then ll = l; #30분봉 이평 if CC[P-1] > 0 Then { sum = 0; For cnt = 0 to P-1 { sum = sum +CC[cnt]; } ntimemav = sum/P; } #기본차트 이평이 진행중인 30분봉 25%,50%,75% 돌파/이탈 if HH > 0 and LL > 0 Then { if mav > 0 Then { if CrossUp(mav,ll+(hh-ll)*0.25) Then Buy("b11"); if CrossUp(mav,ll+(hh-ll)*0.50) Then Buy("b12"); if CrossUp(mav,ll+(hh-ll)*0.75) Then Buy("b13"); if CrossDown(mav,ll+(hh-ll)*0.25) Then Sell("s11"); if CrossDown(mav,ll+(hh-ll)*0.50) Then Sell("s12"); if CrossDown(mav,ll+(hh-ll)*0.75) Then Sell("s13"); } } #30분봉 이평이 진행중인 30분봉 25%,50%,75% 돌파/이탈 if HH > 0 and LL > 0 Then { if ntimemav > 0 Then { if CrossUp(ntimemav,ll+(hh-ll)*0.25) Then Buy("b21"); if CrossUp(ntimemav,ll+(hh-ll)*0.50) Then Buy("b22"); if CrossUp(ntimemav,ll+(hh-ll)*0.75) Then Buy("b23"); if CrossDown(ntimemav,ll+(hh-ll)*0.25) Then Sell("s21"); if CrossDown(ntimemav,ll+(hh-ll)*0.50) Then Sell("s22"); if CrossDown(ntimemav,ll+(hh-ll)*0.75) Then Sell("s23"); } } #기본차트 이평이 전봉기준 30분봉 25%,50%,75% 돌파/이탈 if HH1 > 0 and LL1 > 0 Then { if mav > 0 Then { if CrossUp(mav,ll1+(hh1-ll1)*0.25) Then Buy("b31"); if CrossUp(mav,ll1+(hh1-ll1)*0.50) Then Buy("b32"); if CrossUp(mav,ll1+(hh1-ll1)*0.75) Then Buy("b33"); if CrossDown(mav,ll1+(hh1-ll1)*0.25) Then Sell("s31"); if CrossDown(mav,ll1+(hh1-ll1)*0.50) Then Sell("s32"); if CrossDown(mav,ll1+(hh1-ll1)*0.75) Then Sell("s33"); } } #30분봉 이평이 전봉기준 30분봉 25%,50%,75% 돌파/이탈 if HH1 > 0 and LL1 > 0 Then { if ntimemav > 0 Then { if CrossUp(ntimemav,ll1+(hh1-ll1)*0.25) Then Buy("b41"); if CrossUp(ntimemav,ll1+(hh1-ll1)*0.50) Then Buy("b42"); if CrossUp(ntimemav,ll1+(hh1-ll1)*0.75) Then Buy("b43"); if CrossDown(ntimemav,ll1+(hh1-ll1)*0.25) Then Sell("s41"); if CrossDown(ntimemav,ll1+(hh1-ll1)*0.50) Then Sell("s42"); if CrossDown(ntimemav,ll1+(hh1-ll1)*0.75) Then Sell("s43"); } } } 즐거운 하루되세요 > 라몬 님이 쓴 글입니다. > 제목 : 수정 부탁드립니다 > 안녕하세요 아래 시스템 수정부탁드립니다. 틱 챠트에 30분봉 4등분선을 사용중이며 이 30분봉 4등분선을 가중이평 20선의 5선이 1. 25%,50%,75% 선중 위로 먼저 통과하는것에 매수 2. 25%,50%,75% 선중 아래로 먼저 통과하는것에 매도 이렇게 부탁드립니다 input : ntime(30),P(5); var : S1(0),D1(0),TM(0),TF(0); var : HH(0),LL(0),hh1(0),ll1(0),mav(0),ntimemav(0),sum(0),cnt(0); Array : CC[10](0); #기본차트이평 mav = ma(C,P); 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; TF = TM%ntime; if Bdate != Bdate[1] or (Bdate == Bdate[1] and ntime > 1 and TF < TF[1]) or (Bdate == Bdate[1] and ntime > 1 and TM >= TM[1]+ntime) or (Bdate == Bdate[1] and ntime == 1 and TM > TM[1]) Then { hh = h; ll = l; hh1 = hh[1]; ll1 = ll[1]; For cnt = 1 to 9 { CC[cnt] = CC[cnt-1][1]; } } if hh > 0 and h > hh Then hh = h; if ll > 0 and l < ll Then ll = l; #30분봉 이평 if CC[P-1] > 0 Then { sum = 0; For cnt = 0 to P-1 { sum = sum +CC[cnt]; } ntimemav = sum/P; } if CrossUp(mav,ll+(hh-ll)*0.25) Then Buy("b1"); if ntimeMav > 0 and CrossUp(ntimeMav,ll1) Then Buy("b2"); if ll1 > 0 and CrossUp(mav,ll1+(hh1-ll1)*0.25) Then Buy("b3"); if hh1 > 0 and CrossUp(mav,hh1) Then Buy("b4"); if CrossDown(mav,ll+(hh-ll)*0.75) Then Sell("s1"); if ntimeMav > 0 and CrossDown(ntimeMav,hh1) Then Sell("s2"); if ll1 > 0 and CrossDown(mav,ll1+(hh1-ll1)*0.75) Then sell("s3"); if ll1 > 0 and CrossDown(mav,ll1) Then Sell("s4"); }