커뮤니티

하이킨아시

프로필 이미지
함지박
2025-04-03 16:54:36
354
글번호 189831
답변완료
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); } } 지난번 일봉을 분봉 답변해 주신건데요.타주기 60분봉를 5분봉에 그리고 싶어서 해봤는데 다른 값이 나와 문의 합니다.
지표
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2025-04-04 10:18:28

안녕하세요 예스스탁입니다. input : 분(60),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); var : S1(0),D1(0),TM(0),TF(0),OO(0),HH(0),LL(0),CC(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 { 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]; OO = O; HH = H; LL = L; } if H > HH Then HH = H; if L < LL Then LL = L; CC = C; if ii == 0 Then { maOpen= OO; maClose= CC; maLow=LL; maHigh=HH; } Else { maOpen=(maOpen1*(MAperiod-1)+OO)/MAPeriod; maClose=(maClose1*(MAperiod-1)+CC)/MAPeriod; maLow=(maLow1*(MAperiod-1)+LL)/MAPeriod; maHigh=(maHigh1*(MAperiod-1)+HH)/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); 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); } } 지난번 일봉을 분봉 답변해 주신건데요.타주기 60분봉를 5분봉에 그리고 싶어서 해봤는데 다른 값이 나와 문의 합니다.