커뮤니티

부탁 드립니다

프로필 이미지
yes
2017-01-31 20:01:17
136
글번호 106391
답변완료
도움 주심에 감사 드립니다. var1=(DIPLUS(P1)-DIMINUS(P1))/(DIPLUS(P1)+DIMINUS(P1)); 위 수식이 아래 수식과 같이 시작 시각에 0으로 출발 할수 있겠는지요? 미리 감사 드립니다. input:시작년월일(20170126),시작시각(080000); input:종료년월일(20170131),종료시각(060000); input: Period1(12),Period2(26),Period3(9); variables: VolumeValue( 0 ), MedPrice( 0 ), PV( 0 ),StartCalcDate(0),StartTime(0), CumulativeVolume( 0 ), CumulativePV( 0 ), Started( false ), Denom( 0 ), KeyCumVol( 0 ), KeyCumPV( 0 ), MidasValue( 0 ) ; Var : Ep1(0), JISU1(0),Ep2(0), JISU2(0),Ep3(0),Jisu3(0); var : MACDVal(0),MACDSig(0),ii(0),SD(false),ED(false); Ep1 = 2/(Period1+1); Ep2 = 2/(Period2+1); Ep3 = 2/(Period3+1); StartCalcDate=시작년월일; StartTime=시작시각; if SD == false and sdate >= 시작년월일 Then SD = true; if SD == true and stime >= 시작시각 Then Started = true; if Started == true and ED == false and sdate >= 종료년월일 Then ED = true; if Started == true and ED == true and stime >= 종료시각 Then Started = false; if Started == true then { VolumeValue = iff( DataCompress < 1, Ticks, Volume ) ; MedPrice = (H + L)/2 ; PV = MedPrice * VolumeValue ; CumulativeVolume = VolumeValue + CumulativeVolume ; CumulativePV = PV + CumulativePV ; } if Started == true and Started[1] == false then { Started = true ; Denom = 1 ; KeyCumVol = CumulativeVolume ; KeyCumPV = CumulativePV ; } else if Denom >= 1 then Denom = CumulativeVolume - KeyCumVol ; if Started then { if Denom > 1 then MidasValue = ( CumulativePV - KeyCumPV ) / Denom ; else if Denom == 1 then MidasValue = MedPrice ; ii = ii+1; if ii <= 1 then { JISU1 = MidasValue; JISU2 = MidasValue; MACDVal = JiSu1-Jisu2; MACDsig = MACDVal; } else{ JISU1 = MidasValue * EP1 + JISU1[1] * (1-EP1); JISU2 = MidasValue * EP2 + JISU2[1] * (1-EP2); MACDVal = JiSu1-Jisu2; MACDsig = MACDVal * EP3 + MACDsig[1] * (1-EP3); } plot1(MACDVal); plot2(MACDsig); PlotBaseLine1(0); }
지표
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2017-02-01 14:23:17

안녕하세요 예스스탁입니다. Inputs: Length(14) ; input:시작년월일(20170126),시작시각(080000); input:종료년월일(20170131),종료시각(060000); Var : Counter(0), TRange(0), MyRange(Length); var : PlusDM14(0), PlusDM(0),DIPlusv(0); var : MinusDM14(0), MinusDM(0),DIMinusv(0); var : SD(false),ED(false),Started(false),idx(0); if SD == false and sdate >= 시작년월일 Then SD = true; if SD == true and stime >= 시작시각 Then Started = true; if Started == true and ED == false and sdate >= 종료년월일 Then ED = true; if Started == true and ED == true and stime >= 종료시각 Then Started = false; if Started == true Then{ idx = idx+1; If idx == Length Then { MyRange = Length; DIPlusv = 0; PlusDM14 = 0; TRange = 0; For Counter = 0 To MyRange - 1 { If High[Counter] - High[Counter+1] < 0 Then PlusDM = 0; Else PlusDM = High[Counter] - High[Counter+1]; If Low[Counter+1] - Low[Counter] < 0 Then MinusDM = 0; Else MinusDM = Low[Counter+1] - Low[Counter]; If MinusDM >= PlusDM Then PlusDM = 0; If PlusDM >= MinusDM Then MinusDM = 0; TRange = TRange + TrueRange[Counter]; PlusDM14 = PlusDM14 + PlusDM; MinusDM14 = MinusDM14 + MinusDM; } If TRange <> 0 Then DIPlusv = 100 * PlusDM14 / TRange; Else DIPlusv = 0 ; If TRange <> 0 Then DIMinusv = 100 * MinusDM14 / TRange; Else DIMinusv = 0; } Else If idx > Length Then { If High[0] - High[1] < 0 Then PlusDM = 0; Else PlusDM = High[0] - High[1]; If Low [1] - Low [0] < 0 Then MinusDM = 0; Else MinusDM = Low[1] - Low[0]; If MinusDM >= PlusDM Then PlusDM = 0; If PlusDM >= MinusDM Then MinusDM = 0 ; If MyRange > 0 Then { TRange = TRange[1] - (TRange[1] / MyRange) + TrueRange; PlusDM14 = PlusDM14[1] - (PlusDM14[1] / MyRange) + PlusDM; MinusDM14 = MinusDM14[1] - (MinusDM14[1] / MyRange) + MinusDM; } If TRange <> 0 Then{ DIPlusv = 100 * PlusDM14 / TRange; DIMinusv = 100 * MinusDM14 / TRange; } Else{ DIPlusv = 0 ; DIMinusv = 0; } } var1=(DIPlusv-DIMinusv)/(DIPlusv+DIMinusv); plot1(var1); } 즐거운 하루되세요 > yes 님이 쓴 글입니다. > 제목 : 부탁 드립니다 > 도움 주심에 감사 드립니다. var1=(DIPLUS(P1)-DIMINUS(P1))/(DIPLUS(P1)+DIMINUS(P1)); 위 수식이 아래 수식과 같이 시작 시각에 0으로 출발 할수 있겠는지요? 미리 감사 드립니다. input:시작년월일(20170126),시작시각(080000); input:종료년월일(20170131),종료시각(060000); input: Period1(12),Period2(26),Period3(9); variables: VolumeValue( 0 ), MedPrice( 0 ), PV( 0 ),StartCalcDate(0),StartTime(0), CumulativeVolume( 0 ), CumulativePV( 0 ), Started( false ), Denom( 0 ), KeyCumVol( 0 ), KeyCumPV( 0 ), MidasValue( 0 ) ; Var : Ep1(0), JISU1(0),Ep2(0), JISU2(0),Ep3(0),Jisu3(0); var : MACDVal(0),MACDSig(0),ii(0),SD(false),ED(false); Ep1 = 2/(Period1+1); Ep2 = 2/(Period2+1); Ep3 = 2/(Period3+1); StartCalcDate=시작년월일; StartTime=시작시각; if SD == false and sdate >= 시작년월일 Then SD = true; if SD == true and stime >= 시작시각 Then Started = true; if Started == true and ED == false and sdate >= 종료년월일 Then ED = true; if Started == true and ED == true and stime >= 종료시각 Then Started = false; if Started == true then { VolumeValue = iff( DataCompress < 1, Ticks, Volume ) ; MedPrice = (H + L)/2 ; PV = MedPrice * VolumeValue ; CumulativeVolume = VolumeValue + CumulativeVolume ; CumulativePV = PV + CumulativePV ; } if Started == true and Started[1] == false then { Started = true ; Denom = 1 ; KeyCumVol = CumulativeVolume ; KeyCumPV = CumulativePV ; } else if Denom >= 1 then Denom = CumulativeVolume - KeyCumVol ; if Started then { if Denom > 1 then MidasValue = ( CumulativePV - KeyCumPV ) / Denom ; else if Denom == 1 then MidasValue = MedPrice ; ii = ii+1; if ii <= 1 then { JISU1 = MidasValue; JISU2 = MidasValue; MACDVal = JiSu1-Jisu2; MACDsig = MACDVal; } else{ JISU1 = MidasValue * EP1 + JISU1[1] * (1-EP1); JISU2 = MidasValue * EP2 + JISU2[1] * (1-EP2); MACDVal = JiSu1-Jisu2; MACDsig = MACDVal * EP3 + MACDsig[1] * (1-EP3); } plot1(MACDVal); plot2(MACDsig); PlotBaseLine1(0); }