커뮤니티

부탁드립니다.

프로필 이미지
yes
2017-02-05 19:08:04
146
글번호 106531
답변완료
도움 주심에 감사 드립니다. 지정된 일시 외에도 다음날에도 지표가 나타 나고 있습니다. 오직 지정된 일시에만 나타 내고 싶습니다. 미리 감사 드립니다. input:시작년월일(20170202),시작시각(080000); input:종료년월일(20170202),종료시각(153000); 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 ),endCalcDate(0),endTime(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=시작시각; endCalcDate=종료년월일; endTime=종료시각; if SD == false and sdate >= StartCalcDate Then SD = true; if SD == true and stime >= StartTime Then Started = true; if Started == true and ED == false and sdate >= endCalcDate Then ED = true; if Started == true and ED == true and stime >= endTime 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-06 13:09:06

안녕하세요 예스스탁입니다. 식을 수정했습니다. input:시작년월일(20170202),시작시각(080000); input:종료년월일(20170202),종료시각(153000); 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 ),endCalcDate(0),endTime(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 = 시작시각; endCalcDate = 종료년월일; endTime = 종료시각; if sdate == StartCalcDate and (stime == StartTime or (stime > StartTime and stime[1] < StartTime)) Then Started = true; if Started == true and sdate == endCalcDate and (stime >= endTime or (stime > endTime and stime[1]< endTime)) 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); } 즐거운 하루되세요 > yes 님이 쓴 글입니다. > 제목 : 부탁드립니다. > 도움 주심에 감사 드립니다. 지정된 일시 외에도 다음날에도 지표가 나타 나고 있습니다. 오직 지정된 일시에만 나타 내고 싶습니다. 미리 감사 드립니다. input:시작년월일(20170202),시작시각(080000); input:종료년월일(20170202),종료시각(153000); 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 ),endCalcDate(0),endTime(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=시작시각; endCalcDate=종료년월일; endTime=종료시각; if SD == false and sdate >= StartCalcDate Then SD = true; if SD == true and stime >= StartTime Then Started = true; if Started == true and ED == false and sdate >= endCalcDate Then ED = true; if Started == true and ED == true and stime >= endTime 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); }