커뮤니티

수식 문의

프로필 이미지
흑수돌
2022-11-07 18:13:00
1211
글번호 163594
답변완료
아래는 이평을 적용한 하캔아쉬 지표 입니다. 아래 지표를 활용하여 이평 기간값이 다른 이평적용 하캔아쉬 1 이평적용 하캔아쉬 2 이평적용 하캔아쉬 3 이평적용 하캔아쉬 4 이평적용 하캔아쉬 5 각 다섯개를 설정한 다음 다섯개중 세개가 양봉이면 매수 세개가 음봉이면 매도하는 수식을 얻고 싶습니다. ##### 아래 ####### #Heiken Ashi 시고저종 if CurrentBar > 1 then { haClose = (Open+High+Low+Close)/4; haOpen = (haOpen[1] + haClose[1])/2 ; haHigh = Max(High, haOpen, haClose); haLow = Min(Low, haOpen, haClose) ; } #HeiKen Ashi 이동평균 if CurrentBar > 20 then { if ma(haClose,period) > ma(haOpen,period) Then{ plot1((haHigh-haClose)+ma(haClose,period),"TailUp",RED); //고가 plot2(ma(haClose,period),"BodyUP",RED); //종가 plot3(ma(haOpen,period)-PriceScale ,"BodyDelete",RGB(1,1,1)); //pricescale은 차트 그릴때 몸통이 표시되지 않는 경우가 있어서 넣음 plot4(ma(haOpen,period),"BodyDown",RED); //시가 plot5(ma(haOpen,period)-(haOpen-haLow),"TailDown",RED); //저가 plot6(ma(haOpen,period)-(haOpen-haLow),"TailDelete",RGB(1,1,1)); } else { plot1((haHigh-haOpen)+ma(haOpen,period),"TailUp",RGB(51,102,255)); //고가 plot2(ma(haOpen,period),"BodyUP",RGB(51,102,255)); //시가 plot3(ma(haClose,period)-PriceScale,"BodyDelete",RGB(1,1,1)); //종가 plot4(ma(haClose,period),"BodyDown",RGB(51,102,255)); plot5(ma(haClose,period)-(haClose-haLow),"TailDown",RGB(51,102,255)); //저가 plot6(ma(haClose,period)-(haClose-haLow),"TailDelete",RGB(1,1,1)); } }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2022-11-08 12:59:00

안녕하세요 예스스탁입니다. input : period1(1),Period2(2),Period3(3),Period4(4),Period5(5); var : haClose(0),haOpen(0),haHigh(0),haLow(0); if CurrentBar > 1 then { haClose = (Open+High+Low+Close)/4; haOpen = (haOpen[1] + haClose[1])/2 ; haHigh = Max(High, haOpen, haClose); haLow = Min(Low, haOpen, haClose) ; } var11 = ma(haClose,period1); Var12 = ma(haOpen,period1); var21 = ma(haClose,period2); Var22 = ma(haOpen,period2); var31 = ma(haClose,period3); Var32 = ma(haOpen,period3); var41 = ma(haClose,period4); Var42 = ma(haOpen,period4); var51 = ma(haClose,period5); Var52 = ma(haOpen,period5); value1 = 0; if var11 > var12 Then value1 = value1+1; if var21 > var22 Then value1 = value1+1; if var31 > var32 Then value1 = value1+1; if var41 > var42 Then value1 = value1+1; if var51 > var52 Then value1 = value1+1; value2 = 0; if var11 < var12 Then value2 = value2+1; if var21 < var22 Then value2 = value2+1; if var31 < var32 Then value2 = value2+1; if var41 < var42 Then value2 = value2+1; if var51 < var52 Then value2 = value2+1; if value1 >= 3 Then Buy(); if value2 >= 3 Then Sell(); 즐거운 하루되세요 > 흑수돌 님이 쓴 글입니다. > 제목 : 수식 문의 > 아래는 이평을 적용한 하캔아쉬 지표 입니다. 아래 지표를 활용하여 이평 기간값이 다른 이평적용 하캔아쉬 1 이평적용 하캔아쉬 2 이평적용 하캔아쉬 3 이평적용 하캔아쉬 4 이평적용 하캔아쉬 5 각 다섯개를 설정한 다음 다섯개중 세개가 양봉이면 매수 세개가 음봉이면 매도하는 수식을 얻고 싶습니다. ##### 아래 ####### #Heiken Ashi 시고저종 if CurrentBar > 1 then { haClose = (Open+High+Low+Close)/4; haOpen = (haOpen[1] + haClose[1])/2 ; haHigh = Max(High, haOpen, haClose); haLow = Min(Low, haOpen, haClose) ; } #HeiKen Ashi 이동평균 if CurrentBar > 20 then { if ma(haClose,period) > ma(haOpen,period) Then{ plot1((haHigh-haClose)+ma(haClose,period),"TailUp",RED); //고가 plot2(ma(haClose,period),"BodyUP",RED); //종가 plot3(ma(haOpen,period)-PriceScale ,"BodyDelete",RGB(1,1,1)); //pricescale은 차트 그릴때 몸통이 표시되지 않는 경우가 있어서 넣음 plot4(ma(haOpen,period),"BodyDown",RED); //시가 plot5(ma(haOpen,period)-(haOpen-haLow),"TailDown",RED); //저가 plot6(ma(haOpen,period)-(haOpen-haLow),"TailDelete",RGB(1,1,1)); } else { plot1((haHigh-haOpen)+ma(haOpen,period),"TailUp",RGB(51,102,255)); //고가 plot2(ma(haOpen,period),"BodyUP",RGB(51,102,255)); //시가 plot3(ma(haClose,period)-PriceScale,"BodyDelete",RGB(1,1,1)); //종가 plot4(ma(haClose,period),"BodyDown",RGB(51,102,255)); plot5(ma(haClose,period)-(haClose-haLow),"TailDown",RGB(51,102,255)); //저가 plot6(ma(haClose,period)-(haClose-haLow),"TailDelete",RGB(1,1,1)); } }