커뮤니티

지표식 부탁드립니다.

프로필 이미지
엠제이
2012-04-24 01:57:34
363
글번호 50374
답변완료
아래 지표식을 10분봉에서 30분봉, 일봉, 주봉으로 볼 수 있게 부탁드립니다. 감사합니다. inputs: Length( 21 ); variables: AvgV(0), colour(0); Vars: jtHMA(0), halvedLength(0), sqrRootLength(0); /////jthMa if ((ceiling(length / 2) - (length / 2)) <= 0.5) then halvedLength = ceiling(length / 2); else halvedLength = floor(length / 2); if ((ceiling(SquareRoot(length)) - SquareRoot(length)) <= 0.5) then sqrRootLength = ceiling(SquareRoot(length)); else sqrRootLength = floor(SquareRoot(length)); Value1 = 2 * WMA(C, halvedLength); Value2 = WMA(C, length); Value3 = WMA((Value1 - Value2), sqrRootLength); jtHMA = Value3; ///// AvgV = jthma ; if AvgV > AvgV[1] then colour = 1; if AvgV < AvgV[1] then colour = -1; if colour[1] <> colour then { if colour == 1 then var1 = 1; if colour == -1 then var1 = 0; } plot1(var1); PlotBaseLine1(0);
지표
답변 3
프로필 이미지

예스스탁 예스스탁 답변

2012-04-24 10:44:55

안녕하세요 예스스탁입니다. 다른 주기를 계산하는 내용은 차트에 수식계산에 필요한 만큼의 데이터가 없으면 수식이 정상적인 값을 리턴하지 못합니다. 이용에 참고하시기 바랍니다. 1. 30분봉 Input : Ntime(30),Length(21); Var : Sum1(0), Counter1(0), CSum1(0),WMA1(0); Var : Sum2(0), Counter2(0), CSum2(0),WMA2(0); Var : Sum3(0), Counter3(0), CSum3(0),WMA3(0); var : cnt(0),TT(0),mAvgV(0), colour(0),colour1(0); Var : halvedLength(0), sqrRootLength(0); Array : CC[100](0),Wm[100](0); if ((ceiling(length / 2) - (length / 2)) <= 0.5) then halvedLength = ceiling(length / 2); else halvedLength = floor(length / 2); if ((ceiling(SquareRoot(length)) - SquareRoot(length)) <= 0.5) then sqrRootLength = ceiling(SquareRoot(length)); else sqrRootLength = floor(SquareRoot(length)); TT = TimeToMinutes(stime)%Ntime; if dayindex == 0 or (TT < TT[1] and stime > stime[1]) Then{ value31 = value3[1]; colour1 = colour[1]; for cnt = 1 to 99{ CC[cnt] = CC[cnt-1][1]; Wm[cnt] = Wm[cnt-1][1]; } } CC[0] = C; if CC[halvedLength] > 0 Then{ Sum1 = 0; CSum1 = 0; For counter1 = 0 To halvedLength - 1 Begin Sum1 = Sum1 + CC[counter1] * (halvedLength - counter1); CSum1 = CSum1 + halvedLength - counter1; End; If CSum1 > 0 Then WMA1 = Sum1/CSum1; Else WMA1 = 0; } if cc[length] > 0 Then{ Sum2 = 0; CSum2 = 0; For counter2 = 0 To length - 1 Begin Sum2 = Sum2 + CC[counter2] * (length - counter2); CSum2 = CSum2 + length - counter2; End; If CSum2 > 0 Then WMA2 = Sum2/CSum2; Else WMA2 = 0; } value1 = 2*wma1; value2 = wma2; wm[0] = value1-value2; Sum3 = 0; CSum3 = 0; if Wm[sqrRootLength] > 0 Then{ For counter3 = 0 To sqrRootLength - 1 Begin Sum3 = Sum3 + Wm[counter3] * (sqrRootLength - counter3); CSum3 = CSum3 + sqrRootLength - counter3; End; If CSum3 > 0 Then WMA3 = Sum3/CSum3; Else WMA3 = 0; } value3 = wma3; if value3 > value31 then colour = 1; if value3 < value31 then colour = -1; if colour1 <> colour then { if colour == 1 then var1 = 1; if colour == -1 then var1 = 0; } plot1(var1); PlotBaseLine1(0); 2.일봉 Input : Length(21); Var : Sum1(0), Counter1(0), CSum1(0),WMA1(0); Var : Sum2(0), Counter2(0), CSum2(0),WMA2(0); Var : Sum3(0), Counter3(0), CSum3(0),WMA3(0); var : cnt(0),TT(0),mAvgV(0), colour(0),colour1(0); Var : halvedLength(0), sqrRootLength(0); Array : CC[100](0),Wm[100](0); if ((ceiling(length / 2) - (length / 2)) <= 0.5) then halvedLength = ceiling(length / 2); else halvedLength = floor(length / 2); if ((ceiling(SquareRoot(length)) - SquareRoot(length)) <= 0.5) then sqrRootLength = ceiling(SquareRoot(length)); else sqrRootLength = floor(SquareRoot(length)); if sdate != sdate[1] Then{ value31 = value3[1]; colour1 = colour[1]; for cnt = 1 to 99{ CC[cnt] = CC[cnt-1][1]; Wm[cnt] = Wm[cnt-1][1]; } } CC[0] = C; if CC[halvedLength] > 0 Then{ Sum1 = 0; CSum1 = 0; For counter1 = 0 To halvedLength - 1 Begin Sum1 = Sum1 + CC[counter1] * (halvedLength - counter1); CSum1 = CSum1 + halvedLength - counter1; End; If CSum1 > 0 Then WMA1 = Sum1/CSum1; Else WMA1 = 0; } if cc[length] > 0 Then{ Sum2 = 0; CSum2 = 0; For counter2 = 0 To length - 1 Begin Sum2 = Sum2 + CC[counter2] * (length - counter2); CSum2 = CSum2 + length - counter2; End; If CSum2 > 0 Then WMA2 = Sum2/CSum2; Else WMA2 = 0; } value1 = 2*wma1; value2 = wma2; wm[0] = value1-value2; Sum3 = 0; CSum3 = 0; if Wm[sqrRootLength] > 0 Then{ For counter3 = 0 To sqrRootLength - 1 Begin Sum3 = Sum3 + Wm[counter3] * (sqrRootLength - counter3); CSum3 = CSum3 + sqrRootLength - counter3; End; If CSum3 > 0 Then WMA3 = Sum3/CSum3; Else WMA3 = 0; } value3 = wma3; if value3 > value31 then colour = 1; if value3 < value31 then colour = -1; if colour1 <> colour then { if colour == 1 then var1 = 1; if colour == -1 then var1 = 0; } plot1(var1); PlotBaseLine1(0); 3. 주봉 Input : Length(21); Var : Sum1(0), Counter1(0), CSum1(0),WMA1(0); Var : Sum2(0), Counter2(0), CSum2(0),WMA2(0); Var : Sum3(0), Counter3(0), CSum3(0),WMA3(0); var : cnt(0),TT(0),mAvgV(0), colour(0),colour1(0); Var : halvedLength(0), sqrRootLength(0); Array : CC[100](0),Wm[100](0); if ((ceiling(length / 2) - (length / 2)) <= 0.5) then halvedLength = ceiling(length / 2); else halvedLength = floor(length / 2); if ((ceiling(SquareRoot(length)) - SquareRoot(length)) <= 0.5) then sqrRootLength = ceiling(SquareRoot(length)); else sqrRootLength = floor(SquareRoot(length)); if DayOfWeek(sdate) < DayOfWeek(sdate) and sdate > sdate[1] Then{ value31 = value3[1]; colour1 = colour[1]; for cnt = 1 to 99{ CC[cnt] = CC[cnt-1][1]; Wm[cnt] = Wm[cnt-1][1]; } } CC[0] = C; if CC[halvedLength] > 0 Then{ Sum1 = 0; CSum1 = 0; For counter1 = 0 To halvedLength - 1 Begin Sum1 = Sum1 + CC[counter1] * (halvedLength - counter1); CSum1 = CSum1 + halvedLength - counter1; End; If CSum1 > 0 Then WMA1 = Sum1/CSum1; Else WMA1 = 0; } if cc[length] > 0 Then{ Sum2 = 0; CSum2 = 0; For counter2 = 0 To length - 1 Begin Sum2 = Sum2 + CC[counter2] * (length - counter2); CSum2 = CSum2 + length - counter2; End; If CSum2 > 0 Then WMA2 = Sum2/CSum2; Else WMA2 = 0; } value1 = 2*wma1; value2 = wma2; wm[0] = value1-value2; Sum3 = 0; CSum3 = 0; if Wm[sqrRootLength] > 0 Then{ For counter3 = 0 To sqrRootLength - 1 Begin Sum3 = Sum3 + Wm[counter3] * (sqrRootLength - counter3); CSum3 = CSum3 + sqrRootLength - counter3; End; If CSum3 > 0 Then WMA3 = Sum3/CSum3; Else WMA3 = 0; } value3 = wma3; if value3 > value31 then colour = 1; if value3 < value31 then colour = -1; if colour1 <> colour then { if colour == 1 then var1 = 1; if colour == -1 then var1 = 0; } plot1(var1); PlotBaseLine1(0); 즐거운 하루되세요 > 엠제이 님이 쓴 글입니다. > 제목 : 지표식 부탁드립니다. > 아래 지표식을 10분봉에서 30분봉, 일봉, 주봉으로 볼 수 있게 부탁드립니다. 감사합니다. inputs: Length( 21 ); variables: AvgV(0), colour(0); Vars: jtHMA(0), halvedLength(0), sqrRootLength(0); /////jthMa if ((ceiling(length / 2) - (length / 2)) <= 0.5) then halvedLength = ceiling(length / 2); else halvedLength = floor(length / 2); if ((ceiling(SquareRoot(length)) - SquareRoot(length)) <= 0.5) then sqrRootLength = ceiling(SquareRoot(length)); else sqrRootLength = floor(SquareRoot(length)); Value1 = 2 * WMA(C, halvedLength); Value2 = WMA(C, length); Value3 = WMA((Value1 - Value2), sqrRootLength); jtHMA = Value3; ///// AvgV = jthma ; if AvgV > AvgV[1] then colour = 1; if AvgV < AvgV[1] then colour = -1; if colour[1] <> colour then { if colour == 1 then var1 = 1; if colour == -1 then var1 = 0; } plot1(var1); PlotBaseLine1(0);
프로필 이미지

엠제이

2012-04-24 15:27:53

엠제이 님에 의해 삭제된 답변입니다.
프로필 이미지

엠제이

2012-04-24 15:33:22

확인 결과 일봉하고 주봉에서 다른 값이 표시되고 있습니다. 확인 부탁드리겠습니다. > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 지표식 부탁드립니다. > 안녕하세요 예스스탁입니다. 다른 주기를 계산하는 내용은 차트에 수식계산에 필요한 만큼의 데이터가 없으면 수식이 정상적인 값을 리턴하지 못합니다. 이용에 참고하시기 바랍니다. 1. 30분봉 Input : Ntime(30),Length(21); Var : Sum1(0), Counter1(0), CSum1(0),WMA1(0); Var : Sum2(0), Counter2(0), CSum2(0),WMA2(0); Var : Sum3(0), Counter3(0), CSum3(0),WMA3(0); var : cnt(0),TT(0),mAvgV(0), colour(0),colour1(0); Var : halvedLength(0), sqrRootLength(0); Array : CC[100](0),Wm[100](0); if ((ceiling(length / 2) - (length / 2)) <= 0.5) then halvedLength = ceiling(length / 2); else halvedLength = floor(length / 2); if ((ceiling(SquareRoot(length)) - SquareRoot(length)) <= 0.5) then sqrRootLength = ceiling(SquareRoot(length)); else sqrRootLength = floor(SquareRoot(length)); TT = TimeToMinutes(stime)%Ntime; if dayindex == 0 or (TT < TT[1] and stime > stime[1]) Then{ value31 = value3[1]; colour1 = colour[1]; for cnt = 1 to 99{ CC[cnt] = CC[cnt-1][1]; Wm[cnt] = Wm[cnt-1][1]; } } CC[0] = C; if CC[halvedLength] > 0 Then{ Sum1 = 0; CSum1 = 0; For counter1 = 0 To halvedLength - 1 Begin Sum1 = Sum1 + CC[counter1] * (halvedLength - counter1); CSum1 = CSum1 + halvedLength - counter1; End; If CSum1 > 0 Then WMA1 = Sum1/CSum1; Else WMA1 = 0; } if cc[length] > 0 Then{ Sum2 = 0; CSum2 = 0; For counter2 = 0 To length - 1 Begin Sum2 = Sum2 + CC[counter2] * (length - counter2); CSum2 = CSum2 + length - counter2; End; If CSum2 > 0 Then WMA2 = Sum2/CSum2; Else WMA2 = 0; } value1 = 2*wma1; value2 = wma2; wm[0] = value1-value2; Sum3 = 0; CSum3 = 0; if Wm[sqrRootLength] > 0 Then{ For counter3 = 0 To sqrRootLength - 1 Begin Sum3 = Sum3 + Wm[counter3] * (sqrRootLength - counter3); CSum3 = CSum3 + sqrRootLength - counter3; End; If CSum3 > 0 Then WMA3 = Sum3/CSum3; Else WMA3 = 0; } value3 = wma3; if value3 > value31 then colour = 1; if value3 < value31 then colour = -1; if colour1 <> colour then { if colour == 1 then var1 = 1; if colour == -1 then var1 = 0; } plot1(var1); PlotBaseLine1(0); 2.일봉 Input : Length(21); Var : Sum1(0), Counter1(0), CSum1(0),WMA1(0); Var : Sum2(0), Counter2(0), CSum2(0),WMA2(0); Var : Sum3(0), Counter3(0), CSum3(0),WMA3(0); var : cnt(0),TT(0),mAvgV(0), colour(0),colour1(0); Var : halvedLength(0), sqrRootLength(0); Array : CC[100](0),Wm[100](0); if ((ceiling(length / 2) - (length / 2)) <= 0.5) then halvedLength = ceiling(length / 2); else halvedLength = floor(length / 2); if ((ceiling(SquareRoot(length)) - SquareRoot(length)) <= 0.5) then sqrRootLength = ceiling(SquareRoot(length)); else sqrRootLength = floor(SquareRoot(length)); if sdate != sdate[1] Then{ value31 = value3[1]; colour1 = colour[1]; for cnt = 1 to 99{ CC[cnt] = CC[cnt-1][1]; Wm[cnt] = Wm[cnt-1][1]; } } CC[0] = C; if CC[halvedLength] > 0 Then{ Sum1 = 0; CSum1 = 0; For counter1 = 0 To halvedLength - 1 Begin Sum1 = Sum1 + CC[counter1] * (halvedLength - counter1); CSum1 = CSum1 + halvedLength - counter1; End; If CSum1 > 0 Then WMA1 = Sum1/CSum1; Else WMA1 = 0; } if cc[length] > 0 Then{ Sum2 = 0; CSum2 = 0; For counter2 = 0 To length - 1 Begin Sum2 = Sum2 + CC[counter2] * (length - counter2); CSum2 = CSum2 + length - counter2; End; If CSum2 > 0 Then WMA2 = Sum2/CSum2; Else WMA2 = 0; } value1 = 2*wma1; value2 = wma2; wm[0] = value1-value2; Sum3 = 0; CSum3 = 0; if Wm[sqrRootLength] > 0 Then{ For counter3 = 0 To sqrRootLength - 1 Begin Sum3 = Sum3 + Wm[counter3] * (sqrRootLength - counter3); CSum3 = CSum3 + sqrRootLength - counter3; End; If CSum3 > 0 Then WMA3 = Sum3/CSum3; Else WMA3 = 0; } value3 = wma3; if value3 > value31 then colour = 1; if value3 < value31 then colour = -1; if colour1 <> colour then { if colour == 1 then var1 = 1; if colour == -1 then var1 = 0; } plot1(var1); PlotBaseLine1(0); 3. 주봉 Input : Length(21); Var : Sum1(0), Counter1(0), CSum1(0),WMA1(0); Var : Sum2(0), Counter2(0), CSum2(0),WMA2(0); Var : Sum3(0), Counter3(0), CSum3(0),WMA3(0); var : cnt(0),TT(0),mAvgV(0), colour(0),colour1(0); Var : halvedLength(0), sqrRootLength(0); Array : CC[100](0),Wm[100](0); if ((ceiling(length / 2) - (length / 2)) <= 0.5) then halvedLength = ceiling(length / 2); else halvedLength = floor(length / 2); if ((ceiling(SquareRoot(length)) - SquareRoot(length)) <= 0.5) then sqrRootLength = ceiling(SquareRoot(length)); else sqrRootLength = floor(SquareRoot(length)); if DayOfWeek(sdate) < DayOfWeek(sdate) and sdate > sdate[1] Then{ value31 = value3[1]; colour1 = colour[1]; for cnt = 1 to 99{ CC[cnt] = CC[cnt-1][1]; Wm[cnt] = Wm[cnt-1][1]; } } CC[0] = C; if CC[halvedLength] > 0 Then{ Sum1 = 0; CSum1 = 0; For counter1 = 0 To halvedLength - 1 Begin Sum1 = Sum1 + CC[counter1] * (halvedLength - counter1); CSum1 = CSum1 + halvedLength - counter1; End; If CSum1 > 0 Then WMA1 = Sum1/CSum1; Else WMA1 = 0; } if cc[length] > 0 Then{ Sum2 = 0; CSum2 = 0; For counter2 = 0 To length - 1 Begin Sum2 = Sum2 + CC[counter2] * (length - counter2); CSum2 = CSum2 + length - counter2; End; If CSum2 > 0 Then WMA2 = Sum2/CSum2; Else WMA2 = 0; } value1 = 2*wma1; value2 = wma2; wm[0] = value1-value2; Sum3 = 0; CSum3 = 0; if Wm[sqrRootLength] > 0 Then{ For counter3 = 0 To sqrRootLength - 1 Begin Sum3 = Sum3 + Wm[counter3] * (sqrRootLength - counter3); CSum3 = CSum3 + sqrRootLength - counter3; End; If CSum3 > 0 Then WMA3 = Sum3/CSum3; Else WMA3 = 0; } value3 = wma3; if value3 > value31 then colour = 1; if value3 < value31 then colour = -1; if colour1 <> colour then { if colour == 1 then var1 = 1; if colour == -1 then var1 = 0; } plot1(var1); PlotBaseLine1(0); 즐거운 하루되세요 > 엠제이 님이 쓴 글입니다. > 제목 : 지표식 부탁드립니다. > 아래 지표식을 10분봉에서 30분봉, 일봉, 주봉으로 볼 수 있게 부탁드립니다. 감사합니다. inputs: Length( 21 ); variables: AvgV(0), colour(0); Vars: jtHMA(0), halvedLength(0), sqrRootLength(0); /////jthMa if ((ceiling(length / 2) - (length / 2)) <= 0.5) then halvedLength = ceiling(length / 2); else halvedLength = floor(length / 2); if ((ceiling(SquareRoot(length)) - SquareRoot(length)) <= 0.5) then sqrRootLength = ceiling(SquareRoot(length)); else sqrRootLength = floor(SquareRoot(length)); Value1 = 2 * WMA(C, halvedLength); Value2 = WMA(C, length); Value3 = WMA((Value1 - Value2), sqrRootLength); jtHMA = Value3; ///// AvgV = jthma ; if AvgV > AvgV[1] then colour = 1; if AvgV < AvgV[1] then colour = -1; if colour[1] <> colour then { if colour == 1 then var1 = 1; if colour == -1 then var1 = 0; } plot1(var1); PlotBaseLine1(0);