커뮤니티

하이킨아시

프로필 이미지
함지박
2024-10-29 10:15:33
782
글번호 184703
답변완료
input : MaPeriod(2),MaPeriod2(1); var : maOpen(0),maClose(0),maLow(0),maHigh(0); var : haOpen(0),haClose(0),haLow(0),haHigh(0); var : ExtMapBuffer1(0),ExtMapBuffer2(0),ExtMapBuffer3(0),ExtMapBuffer4(0); var : ExtMapBuffer5(0),ExtMapBuffer6(0),ExtMapBuffer7(0),ExtMapBuffer8(0); var : r(0),g(0),b(0), TL(0),t(0),tx(0); if Index == 0 Then { maOpen=Open; maClose=Close; maLow=Low; maHigh=High; } Else { maOpen=(maOpen[1]*(MAperiod-1)+Open)/MAPeriod; maClose=(maClose[1]*(MAperiod-1)+Close)/MAPeriod; maLow=(maLow[1]*(MAperiod-1)+Low)/MAPeriod; maHigh=(maHigh[1]*(MAperiod-1)+High)/MAPeriod; haOpen=(ExtMapBuffer5[1]+ExtMapBuffer6[1])/2; haClose=(maOpen+maHigh+maLow+maClose)/4; haHigh=Max(maHigh, Max(haOpen, haClose)); haLow=Min(maLow, Min(haOpen, haClose)); if (haOpen<haClose) then { r=255; g=10; b=0; ExtMapBuffer7=haLow; ExtMapBuffer8=haHigh; t = 1; } else { r=0; g=191; b=255; ExtMapBuffer7=haHigh; ExtMapBuffer8=haLow; t = -1; } ExtMapBuffer5=haOpen; ExtMapBuffer6=haClose; ExtMapBuffer1=WMA(ExtMapBuffer7,MAperiod2); ExtMapBuffer2=WMA(ExtMapBuffer8,MAperiod2); ExtMapBuffer3=WMA(ExtMapBuffer5,MAperiod2); ExtMapBuffer4=WMA(ExtMapBuffer6,MAperiod2); } 분봉에 일봉값을 구하고 싶습니다.지난번 것은 어찌 해결 했는데 이건좀 안되네요 일이 많으신데 부탁합니다
지표
답변 2
프로필 이미지

예스스탁 예스스탁 답변

2024-10-30 10:35:01

안녕하세요 예스스탁입니다. input : MaPeriod(2),MaPeriod2(1); var : maOpen(0),maClose(0),maLow(0),maHigh(0); var : haOpen(0),haClose(0),haLow(0),haHigh(0); var : ExtMapBuffer1(0),ExtMapBuffer2(0),ExtMapBuffer3(0),ExtMapBuffer4(0); Array : ExtMapBuffer5[100](0),ExtMapBuffer6[100](0),ExtMapBuffer7[100](0),ExtMapBuffer8[100](0); var : r(0),g(0),b(0), TL(0),t(0),tx(0); var : ii(0),cnt(0); var : sum1(0),sum2(0),sum3(0),sum4(0),csum(0); var : maOpen1(0),maClose1(0),maLow1(0),maHigh1(0); var : WMA1(0),WMA2(0),WMA3(0),WMA4(0); if Bdate != Bdate[1] Then { For cnt = 99 DownTo 1 { ExtMapBuffer5[cnt] = ExtMapBuffer5[cnt-1]; ExtMapBuffer6[cnt] = ExtMapBuffer6[cnt-1]; ExtMapBuffer7[cnt] = ExtMapBuffer7[cnt-1]; ExtMapBuffer8[cnt] = ExtMapBuffer8[cnt-1]; } ii = ii +1; maOpen1 = maOpen[1]; maClose1 = maClose[1]; maLow1 = maLow[1]; maHigh1 = maHigh[1]; } if ii == 0 Then { maOpen=dayOpen; maClose=dayClose; maLow=dayLow; maHigh=dayHigh; } Else { maOpen=(maOpen1*(MAperiod-1)+dayOpen)/MAPeriod; maClose=(maClose1*(MAperiod-1)+dayClose)/MAPeriod; maLow=(maLow1*(MAperiod-1)+dayLow)/MAPeriod; maHigh=(maHigh1*(MAperiod-1)+dayHigh)/MAPeriod; haOpen=(ExtMapBuffer5[1]+ExtMapBuffer6[1])/2; haClose=(maOpen+maHigh+maLow+maClose)/4; haHigh=Max(maHigh, Max(haOpen, haClose)); haLow=Min(maLow, Min(haOpen, haClose)); if (haOpen<haClose) then { r=255; g=10; b=0; ExtMapBuffer7[0]=haLow; ExtMapBuffer8[0]=haHigh; t = 1; } else { r=0; g=191; b=255; ExtMapBuffer7[0]=haHigh; ExtMapBuffer8[0]=haLow; t = -1; } ExtMapBuffer5[0]=haOpen; ExtMapBuffer6[0]=haClose; if ExtMapBuffer5[maPeriod2-1] > 0 Then { Sum1 = 0; Sum2 = 0; Sum3 = 0; Sum4 = 0; CSum = 0; For cnt = 0 To maPeriod2 - 1 { Sum1 = Sum1 + ExtMapBuffer7[cnt] * (maPeriod2 - cnt); Sum2 = Sum2 + ExtMapBuffer8[cnt] * (maPeriod2 - cnt); Sum3 = Sum3 + ExtMapBuffer5[cnt] * (maPeriod2 - cnt); Sum4 = Sum4 + ExtMapBuffer6[cnt] * (maPeriod2 - cnt); CSum = CSum + maPeriod2 - cnt; } ExtMapBuffer1 = Sum1/CSum; ExtMapBuffer2 = Sum2/CSum; ExtMapBuffer3 = Sum3/CSum; ExtMapBuffer4 = Sum4/CSum; plot1(ExtMapBuffer1); plot2(ExtMapBuffer2); plot3(ExtMapBuffer3); plot4(ExtMapBuffer4); } } 즐거운 하루되세요 > 함지박 님이 쓴 글입니다. > 제목 : 하이킨아시 > input : MaPeriod(2),MaPeriod2(1); var : maOpen(0),maClose(0),maLow(0),maHigh(0); var : haOpen(0),haClose(0),haLow(0),haHigh(0); var : ExtMapBuffer1(0),ExtMapBuffer2(0),ExtMapBuffer3(0),ExtMapBuffer4(0); var : ExtMapBuffer5(0),ExtMapBuffer6(0),ExtMapBuffer7(0),ExtMapBuffer8(0); var : r(0),g(0),b(0), TL(0),t(0),tx(0); if Index == 0 Then { maOpen=Open; maClose=Close; maLow=Low; maHigh=High; } Else { maOpen=(maOpen[1]*(MAperiod-1)+Open)/MAPeriod; maClose=(maClose[1]*(MAperiod-1)+Close)/MAPeriod; maLow=(maLow[1]*(MAperiod-1)+Low)/MAPeriod; maHigh=(maHigh[1]*(MAperiod-1)+High)/MAPeriod; haOpen=(ExtMapBuffer5[1]+ExtMapBuffer6[1])/2; haClose=(maOpen+maHigh+maLow+maClose)/4; haHigh=Max(maHigh, Max(haOpen, haClose)); haLow=Min(maLow, Min(haOpen, haClose)); if (haOpen<haClose) then { r=255; g=10; b=0; ExtMapBuffer7=haLow; ExtMapBuffer8=haHigh; t = 1; } else { r=0; g=191; b=255; ExtMapBuffer7=haHigh; ExtMapBuffer8=haLow; t = -1; } ExtMapBuffer5=haOpen; ExtMapBuffer6=haClose; ExtMapBuffer1=WMA(ExtMapBuffer7,MAperiod2); ExtMapBuffer2=WMA(ExtMapBuffer8,MAperiod2); ExtMapBuffer3=WMA(ExtMapBuffer5,MAperiod2); ExtMapBuffer4=WMA(ExtMapBuffer6,MAperiod2); } 분봉에 일봉값을 구하고 싶습니다.지난번 것은 어찌 해결 했는데 이건좀 안되네요 일이 많으신데 부탁합니다
프로필 이미지

함지박

2024-10-30 11:34:32

함지박 님에 의해 삭제된 답변입니다.