커뮤니티

지표변환 부탁드립니다

프로필 이미지
jdavid
2024-03-23 10:19:31
979
글번호 177842
답변완료
감사합니다 아래 지표를 1 분봉지표를 타분봉지표로 변환부탁드립니다. 2 일봉지표를 분봉지표로 변환부탁드립니다. input : length(21),hh(8),mult(2),k(2),N봉(10); var : src(0),n(0),tx(0),sume(0),i(0),j(0),y2(0),sum(0),sumw(0),w(0),mae(0); var : Y2TOP(0),Y2BTM(0); src = Close; n = barindex; sume = 0; for i = 0 to length-1 { sum = 0; sumw = 0; for j = 0 to length-1 { w = exp(-(pow(i-j,2)/(hh*hh*2))); sum = sum+src[j]*w; sumw = sumw+w; } y2 = sum/sumw; sume = sume+abs(src[i] - y2); } mae = sume/length*mult; Y2TOP = y2+mae; Y2BTM = y2-mae; Plot1(y2); Plot2(y2+mae); Plot3(y2-mae); if Y2TOP < Y2TOP[1] and Y2TOP[1] == highest(Y2TOP,N봉)[1] Then { var1 = Y2TOP; Var2 = C; } if Y2BTM > Y2BTM[1] and Y2BTM[1] == Lowest(Y2BTM,N봉)[1] Then { var3 = Y2BTM; Var4 = C; } if var1 > 0 Then { plot4(var1); plot5(var2); } if var3 > 0 Then { plot6(var3); plot7(var4); }
지표
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2024-03-25 13:40:36

안녕하세요 예스스탁입니다. 1 input : 타주기분(30),length(21),hh(8),mult(2),k(2),N봉(10); var : src(0),tx(0),sume(0),i(0),j(0),y2(0),sum(0),sumw(0),w(0),mae(0); var : cnt(0),tempy2(0),tempmae(0),hv(0),lv(0); var : S1(0),D1(0),TM(0),TF(0); Array : CC[100](0); Array : Y2TOP[50](0),Y2BTM[50](0); 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%타주기분; if Bdate != Bdate[1] or (Bdate == Bdate[1] and 타주기분 > 1 and TF < TF[1]) or (Bdate == Bdate[1] and 타주기분 > 1 and TM >= TM[1]+타주기분) or (Bdate == Bdate[1] and 타주기분 == 1 and TM > TM[1]) Then { for cnt = 99 downto 1 { CC[cnt] = CC[cnt-1][1]; } if Y2TOP[n봉] > 0 and Y2BTM[n봉] > 0 Then { if Y2TOP[0] < Y2TOP[1] and Y2TOP[1] == hv Then { var1 = Y2TOP[0]; Var2 = CC[0]; } if Y2BTM[0] > Y2BTM[1] and Y2BTM[1] == lv Then { var3 = Y2BTM[0]; Var4 = CC[0]; } } } CC[0] = C; hv = 0; lv = 0; For cnt = 0 to n봉 { sume = 0; for i = cnt+0 to cnt+length-1 { sum = 0; sumw = 0; for j = cnt+0 to cnt+length-1 { w = exp(-(pow(i-j,2)/(hh*hh*2))); sum = sum+CC[j]*w; sumw = sumw+w; } tempy2 = sum/sumw; sume = sume+abs(CC[i] - tempy2); } tempmae = sume/length*mult; Y2TOP[cnt] = tempy2+tempmae; Y2BTM[cnt] = tempy2-tempmae; if cnt == 0 Then { y2 = tempy2; mae = tempmae; } Else { if hv == 0 or (hv > 0 and Y2TOP[cnt] > hv) Then hv = Y2TOP[cnt]; if lv == 0 or (lv > 0 and Y2BTM[cnt] < lv) Then lv = Y2BTM[cnt]; } } Plot1(y2); Plot2(y2+mae); Plot3(y2-mae); if var1 > 0 Then { plot4(var1); plot5(var2); } if var3 > 0 Then { plot6(var3); plot7(var4); } } 2 input : length(21),hh(8),mult(2),k(2),N봉(10); var : src(0),tx(0),sume(0),i(0),j(0),y2(0),sum(0),sumw(0),w(0),mae(0); var : cnt(0),tempy2(0),tempmae(0),hv(0),lv(0); Array : Y2TOP[50](0),Y2BTM[50](0); if sDate != sDate[1] Then { if Y2TOP[0] < Y2TOP[1] and Y2TOP[1] == hv Then { var1 = Y2TOP[0]; Var2 = C[1]; } if Y2BTM[0] > Y2BTM[1] and Y2BTM[1] == lv Then { var3 = Y2BTM[0]; Var4 = C[1]; } } hv = 0; lv = 0; For cnt = 0 to n봉 { sume = 0; for i = cnt+0 to cnt+length-1 { sum = 0; sumw = 0; for j = cnt+0 to cnt+length-1 { w = exp(-(pow(i-j,2)/(hh*hh*2))); sum = sum+DayClose(j)*w; sumw = sumw+w; } tempy2 = sum/sumw; sume = sume+abs(DayClose(i) - tempy2); } tempmae = sume/length*mult; Y2TOP[cnt] = tempy2+tempmae; Y2BTM[cnt] = tempy2-tempmae; if cnt == 0 Then { y2 = tempy2; mae = tempmae; } Else { if hv == 0 or (hv > 0 and Y2TOP[cnt] > hv) Then hv = Y2TOP[cnt]; if lv == 0 or (lv > 0 and Y2BTM[cnt] < lv) Then lv = Y2BTM[cnt]; } } Plot1(y2); Plot2(y2+mae); Plot3(y2-mae); if var1 > 0 Then { plot4(var1); plot5(var2); } if var3 > 0 Then { plot6(var3); plot7(var4); } 즐거운 하루되세요 > jdavid 님이 쓴 글입니다. > 제목 : 지표변환 부탁드립니다 > 감사합니다 아래 지표를 1 분봉지표를 타분봉지표로 변환부탁드립니다. 2 일봉지표를 분봉지표로 변환부탁드립니다. input : length(21),hh(8),mult(2),k(2),N봉(10); var : src(0),n(0),tx(0),sume(0),i(0),j(0),y2(0),sum(0),sumw(0),w(0),mae(0); var : Y2TOP(0),Y2BTM(0); src = Close; n = barindex; sume = 0; for i = 0 to length-1 { sum = 0; sumw = 0; for j = 0 to length-1 { w = exp(-(pow(i-j,2)/(hh*hh*2))); sum = sum+src[j]*w; sumw = sumw+w; } y2 = sum/sumw; sume = sume+abs(src[i] - y2); } mae = sume/length*mult; Y2TOP = y2+mae; Y2BTM = y2-mae; Plot1(y2); Plot2(y2+mae); Plot3(y2-mae); if Y2TOP < Y2TOP[1] and Y2TOP[1] == highest(Y2TOP,N봉)[1] Then { var1 = Y2TOP; Var2 = C; } if Y2BTM > Y2BTM[1] and Y2BTM[1] == Lowest(Y2BTM,N봉)[1] Then { var3 = Y2BTM; Var4 = C; } if var1 > 0 Then { plot4(var1); plot5(var2); } if var3 > 0 Then { plot6(var3); plot7(var4); }