커뮤니티

재질문 드립니다.

프로필 이미지
미완
2016-06-08 13:31:42
125
글번호 98840
답변완료
앞서 작성해 주신 서식 감사합니다. 그럼 추세조건이 ma_p11 ~ ma_p17중 ma_p14를 제외한 나머지는 고정값으로 두고 ma_p14 값을 1~100 까지로 지정했을 때는 어느 부분을 수정해야 하는지도 알려 주시면 감사하겠습니다. 수정해 보려하니 계속 에러가 나서... input:b_time1(000000), e_time1(240000); Var: ma_p11(25),ma_p12(5),ma_p13(15),ma_p14(100), ma_p15(10),ma_p16(20),ma_p17(15); var : ma11(0),ma12(0),ma13(0),ma15(0),ma16(0),ma17(0); var : j(0),매수강도(0),매도강도(0); var : ma_P14_1(0),ma_P14_2(0),ma_P14_3(0),ma_P14_4(0),ma_P14_5(0); var : ma_P14_6(0),ma_P14_7(0),ma_P14_8(0),ma_P14_9(0),ma_P14_10(0); Array : ma14[11](0),추세[11](""); ma11 = ma(C,ma_P11); ma12 = ma(C,ma_P12); ma13 = ma(C,ma_P13); ma15 = ma(C,ma_P15); ma16 = ma(C,ma_P16); ma17 = ma(C,ma_P17); ma_P14_1 = ma_P14+1; ma_P14_2 = ma_P14+2; ma_P14_3 = ma_P14+3; ma_P14_4 = ma_P14+4; ma_P14_5 = ma_P14+5; ma_P14_6 = ma_P14+6; ma_P14_7 = ma_P14+7; ma_P14_8 = ma_P14+8; ma_P14_9 = ma_P14+9; ma_P14_10 = ma_P14+10; ma14[1] = ma(C,ma_p14_1); ma14[2] = ma(C,ma_p14_2); ma14[3] = ma(C,ma_p14_3); ma14[4] = ma(C,ma_p14_4); ma14[5] = ma(C,ma_p14_5); ma14[6] = ma(C,ma_p14_6); ma14[7] = ma(C,ma_p14_7); ma14[8] = ma(C,ma_p14_8); ma14[9] = ma(C,ma_p14_9); ma14[10] = ma(C,ma_p14_10); 매수강도 = 0; 매도강도 = 0; If b_time1 <= Time and Time <= e_time1 Then { For j = 1 TO 100 { If countif(ma11[1] < ma11 ,1) == 1 and (ma12[1] <= ma13[1] and ma12 > ma13) and countif(ma14[j][1] < ma14[j],1) == 1 and countif(ma15[1] < ma15 ,1) == 1 and countif(ma16[1] < ma16 ,1) == 1 and countif(ma17[1] < ma17 ,1) == 1 Then { 추세[j] = "매수추세"; } If countif(ma11[1] > ma11 ,1) == 1 and (ma12[1] >= ma13[1] and ma12 < ma13) and countif(ma14[j][1] > ma14[j],1) == 1 and countif(ma15[1] > ma15 ,1) == 1 and countif(ma16[1] > ma16 ,1) == 1 and countif(ma17[1] > ma17 ,1) == 1 Then { 추세[j] = "매도추세"; } If 추세[j] == "매수추세" Then 매수강도 = 매수강도 + 1; If 추세[j] == "매도추세" Then 매도강도 = 매도강도 + 1; } If 매수강도 == 100 Then 추세[0] = "매수추세"; If 매도강도 == 100 Then 추세[0] = "매도추세"; Plot1(iff(추세[0]== "매수추세" , 100 , iff(추세[0]== "매도추세" , -100,0))); PlotBaseLine1(0); }
지표
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2016-06-08 15:44:43

안녕하세요 예스스탁입니다. 주석 참고하시기 바랍니다. input:b_time1(000000), e_time1(240000); Var: ma_p11(25),ma_p12(5),ma_p13(15),ma_p14(100), ma_p15(10),ma_p16(20),ma_p17(15); var : ma11(0),ma12(0),ma13(0),ma15(0),ma16(0),ma17(0); var : j(0),매수강도(0),매도강도(0); Array : ma14[101](0),추세[101]("");#배열방의 최대값+1로 지정 #고정이평 ma11 = ma(C,ma_P11); ma12 = ma(C,ma_P12); ma13 = ma(C,ma_P13); ma15 = ma(C,ma_P15); ma16 = ma(C,ma_P16); ma17 = ma(C,ma_P17); #ma_p14기간에 1~100까지 더해서 이평을 만들어 저장 for j = 1 to 100{ ma14[j] = ma(C,ma_p14+j); } 매수강도 = 0; 매도강도 = 0; If b_time1 <= Time and Time <= e_time1 Then { For j = 1 TO 100 { If countif(ma11[1] < ma11 ,1) == 1 and (ma12[1] <= ma13[1] and ma12 > ma13) and countif(ma14[j][1] < ma14[j],1) == 1 and countif(ma15[1] < ma15 ,1) == 1 and countif(ma16[1] < ma16 ,1) == 1 and countif(ma17[1] < ma17 ,1) == 1 Then { 추세[j] = "매수추세"; } If countif(ma11[1] > ma11 ,1) == 1 and (ma12[1] >= ma13[1] and ma12 < ma13) and countif(ma14[j][1] > ma14[j],1) == 1 and countif(ma15[1] > ma15 ,1) == 1 and countif(ma16[1] > ma16 ,1) == 1 and countif(ma17[1] > ma17 ,1) == 1 Then { 추세[j] = "매도추세"; } If 추세[j] == "매수추세" Then 매수강도 = 매수강도 + 1; If 추세[j] == "매도추세" Then 매도강도 = 매도강도 + 1; } If 매수강도 == 100 Then 추세[0] = "매수추세"; If 매도강도 == 100 Then 추세[0] = "매도추세"; Plot1(iff(추세[0]== "매수추세" , 100 , iff(추세[0]== "매도추세" , -100,0))); PlotBaseLine1(0); } 즐거운 하루되세요 > 미완 님이 쓴 글입니다. > 제목 : 재질문 드립니다. > 앞서 작성해 주신 서식 감사합니다. 그럼 추세조건이 ma_p11 ~ ma_p17중 ma_p14를 제외한 나머지는 고정값으로 두고 ma_p14 값을 1~100 까지로 지정했을 때는 어느 부분을 수정해야 하는지도 알려 주시면 감사하겠습니다. 수정해 보려하니 계속 에러가 나서... input:b_time1(000000), e_time1(240000); Var: ma_p11(25),ma_p12(5),ma_p13(15),ma_p14(100), ma_p15(10),ma_p16(20),ma_p17(15); var : ma11(0),ma12(0),ma13(0),ma15(0),ma16(0),ma17(0); var : j(0),매수강도(0),매도강도(0); var : ma_P14_1(0),ma_P14_2(0),ma_P14_3(0),ma_P14_4(0),ma_P14_5(0); var : ma_P14_6(0),ma_P14_7(0),ma_P14_8(0),ma_P14_9(0),ma_P14_10(0); Array : ma14[11](0),추세[11](""); ma11 = ma(C,ma_P11); ma12 = ma(C,ma_P12); ma13 = ma(C,ma_P13); ma15 = ma(C,ma_P15); ma16 = ma(C,ma_P16); ma17 = ma(C,ma_P17); ma_P14_1 = ma_P14+1; ma_P14_2 = ma_P14+2; ma_P14_3 = ma_P14+3; ma_P14_4 = ma_P14+4; ma_P14_5 = ma_P14+5; ma_P14_6 = ma_P14+6; ma_P14_7 = ma_P14+7; ma_P14_8 = ma_P14+8; ma_P14_9 = ma_P14+9; ma_P14_10 = ma_P14+10; ma14[1] = ma(C,ma_p14_1); ma14[2] = ma(C,ma_p14_2); ma14[3] = ma(C,ma_p14_3); ma14[4] = ma(C,ma_p14_4); ma14[5] = ma(C,ma_p14_5); ma14[6] = ma(C,ma_p14_6); ma14[7] = ma(C,ma_p14_7); ma14[8] = ma(C,ma_p14_8); ma14[9] = ma(C,ma_p14_9); ma14[10] = ma(C,ma_p14_10); 매수강도 = 0; 매도강도 = 0; If b_time1 <= Time and Time <= e_time1 Then { For j = 1 TO 100 { If countif(ma11[1] < ma11 ,1) == 1 and (ma12[1] <= ma13[1] and ma12 > ma13) and countif(ma14[j][1] < ma14[j],1) == 1 and countif(ma15[1] < ma15 ,1) == 1 and countif(ma16[1] < ma16 ,1) == 1 and countif(ma17[1] < ma17 ,1) == 1 Then { 추세[j] = "매수추세"; } If countif(ma11[1] > ma11 ,1) == 1 and (ma12[1] >= ma13[1] and ma12 < ma13) and countif(ma14[j][1] > ma14[j],1) == 1 and countif(ma15[1] > ma15 ,1) == 1 and countif(ma16[1] > ma16 ,1) == 1 and countif(ma17[1] > ma17 ,1) == 1 Then { 추세[j] = "매도추세"; } If 추세[j] == "매수추세" Then 매수강도 = 매수강도 + 1; If 추세[j] == "매도추세" Then 매도강도 = 매도강도 + 1; } If 매수강도 == 100 Then 추세[0] = "매수추세"; If 매도강도 == 100 Then 추세[0] = "매도추세"; Plot1(iff(추세[0]== "매수추세" , 100 , iff(추세[0]== "매도추세" , -100,0))); PlotBaseLine1(0); }