커뮤니티

코드를 개선하고 싶습니다.

프로필 이미지
yon
2021-07-07 22:08:07
977
글번호 150592
답변완료
아래 코드에서 C를 그날 종가 대신 그날 a분봉 차트의 b번째 봉의 종가로 바꾸고 싶습니다. <이하 코드> input : noise_filter(0.5); var : tx1(0), noise(0); noise = 1-abs(o[0]-c[0])/(h[0]-l[0]); if ma(c[0],5) >= ma(c[1],5) and h[0] > ma(c[0],5) and c[0] > o[0] and noise < noise_filter Then { plot1(L, "강조", BLACk); }
지표
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2021-07-08 10:16:00

안녕하세요 예스스탁입니다. 분봉차트에 적용하셔야 합니다. input : noise_filter(0.5),b(10); var : noise(0),idx(0),cnt(0),sum(0),sum1(0),mav(0),mav1(0); if Bdate != Bdate[1] Then idx = 0; idx = idx+1; if idx == b Then { noise = 1-abs(dayopen-c)/(DayHigh-DayLow); sum = 0; sum1 = 0; For cnt = 0 to 4 { sum = sum + DayClose(cnt); sum1 = sum1 + DayClose(cnt); } mav = sum/5; mav1 = sum1/5; if mav >= mav1 and DayHigh > mav and C > DayOpen and noise < noise_filter Then { plot1(L, "강조", BLACk); } } 즐거운 하루되세요 > yon 님이 쓴 글입니다. > 제목 : 코드를 개선하고 싶습니다. > 아래 코드에서 C를 그날 종가 대신 그날 a분봉 차트의 b번째 봉의 종가로 바꾸고 싶습니다. <이하 코드> input : noise_filter(0.5); var : tx1(0), noise(0); noise = 1-abs(o[0]-c[0])/(h[0]-l[0]); if ma(c[0],5) >= ma(c[1],5) and h[0] > ma(c[0],5) and c[0] > o[0] and noise < noise_filter Then { plot1(L, "강조", BLACk); }