커뮤니티
부탁드립니다.
2017-01-30 03:38:47
112
글번호 106346
정유년 새해에도 만복과 건강이 함께하시길 기원합니다.
종료년월일,종료시각을 지정을 부탁드립니다.
미리 감사 드립니다.
input:시작년월일(20170126),시작시각(0800);
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);
Ep1 = 2/(Period1+1);
Ep2 = 2/(Period2+1);
Ep3 = 2/(Period3+1);
StartCalcDate=시작년월일;
StartTime=시작시각;
if Date >= StartCalcDate and Time >= StartTime then
begin
VolumeValue = iff( DataCompress < 1, Ticks, Volume ) ;
MedPrice = (H + L)/2 ;
PV = MedPrice * VolumeValue ;
CumulativeVolume = VolumeValue + CumulativeVolume ;
CumulativePV = PV + CumulativePV ;
end ;
if Started == false and ( ( Date >= StartCalcDate and
Time >= StartTime ) and ( ( Time[1] < StartTime or
Date[1] < StartCalcDate ) or Date[1] >
StartCalcDate ) ) then
begin
Started = true ;
Denom = 1 ;
KeyCumVol = CumulativeVolume ;
KeyCumPV = CumulativePV ;
end
else if Denom >= 1 then
Denom = CumulativeVolume - KeyCumVol ;
if Started then
begin
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);
end;
답변 1
예스스탁 예스스탁 답변
2017-01-31 14:28:10
안녕하세요
예스스탁입니다.
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);
}
즐거운 하루되세요
> yes 님이 쓴 글입니다.
> 제목 : 부탁드립니다.
> 정유년 새해에도 만복과 건강이 함께하시길 기원합니다.
종료년월일,종료시각을 지정을 부탁드립니다.
미리 감사 드립니다.
input:시작년월일(20170126),시작시각(0800);
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);
Ep1 = 2/(Period1+1);
Ep2 = 2/(Period2+1);
Ep3 = 2/(Period3+1);
StartCalcDate=시작년월일;
StartTime=시작시각;
if Date >= StartCalcDate and Time >= StartTime then
begin
VolumeValue = iff( DataCompress < 1, Ticks, Volume ) ;
MedPrice = (H + L)/2 ;
PV = MedPrice * VolumeValue ;
CumulativeVolume = VolumeValue + CumulativeVolume ;
CumulativePV = PV + CumulativePV ;
end ;
if Started == false and ( ( Date >= StartCalcDate and
Time >= StartTime ) and ( ( Time[1] < StartTime or
Date[1] < StartCalcDate ) or Date[1] >
StartCalcDate ) ) then
begin
Started = true ;
Denom = 1 ;
KeyCumVol = CumulativeVolume ;
KeyCumPV = CumulativePV ;
end
else if Denom >= 1 then
Denom = CumulativeVolume - KeyCumVol ;
if Started then
begin
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);
end;
다음글
이전글