커뮤니티
변환부탁드립니다.
2016-08-04 04:01:32
108
글번호 100683
격무를 무릎쓰고 항상 많은 도움을 주셔서 감사드립니다.
아래는 EL 함수식인데 예스로 변환 부탁드립니다.
Inputs:
DStLen(NumericSimple)
;
Vars:
Num(0),
Denom(0),
Ratio(0),
PctK(0),
DNum(0),
DDenom(0),
DRatio(0),
DPctK(0);
Vars:
RelO(0), // Relative Open
RelH(0), // Relative High
RelL(0), // Relative low
RelC(0), // Relative Close
gap(0), // the opening gap (modified by the gap coefficient)
GapCoef(1.0), // Gap Coefficient
Accum(0); // The sum of all the daily gaps
if currentsession(0)<>currentsession(0)[1] or date<>date[1] then
begin
gap=GapCoef*(O-C[1]);
Accum=Accum+gap;
end;
if DataCompress<=1 then //Valid only for Tick or Intraday
begin
RelO = O-Accum;
RelC = C-Accum;
RelH = H-Accum;
RelL = L-Accum;
end
else begin
RelO = O;
RelC = C;
RelH = H;
RelL = L;
end;
// Gapless - end
//Stoc}
Num=RelC-_Lst(RelL,DStLen);
Denom=_Hst(RelH,DStLen)-_Lst(RelL,DStLen);
Ratio=IFF(Denom>0,(Num/Denom)*100,Ratio[1]);
PctK=IFF(CurrentBar==1,Ratio,PctK[1]+(.5*(Ratio-PctK[1])));
//{DStoc}
DNum=PctK-_Lst(PctK,DStLen);
DDenom=_Hst(PctK,DStLen)-_Lst(PctK,DStLen);
DRatio=IFF(DDenom>0,(DNum/DDenom)*100,DRatio[1]);
DPctK=IFF(CurrentBar==1,DRatio,DPctK[1]+(.5*(DRatio-DPctK[1])));
_DStocGL=DPctK;
답변 1
예스스탁 예스스탁 답변
2016-08-04 13:28:53
안녕하세요
예스스탁입니다.
수식에 _Hst, _Lst와 같이 사용자함수가 있습니다.
해당 함수는 그대로 두었습니다.
예스랭귀지에는 currentsession와 같은 세션을 구분하는 함수들이 없습니다.
해당 내용은 제외했습니다.
Inputs: DStLen(NumericSimple);
Vars: Num(0),Denom(0),Ratio(0),PctK(0),DNum(0),DDenom(0),DRatio(0),DPctK(0);
Vars: RelO(0), // Relative Open
RelH(0), // Relative High
RelL(0), // Relative low
RelC(0), // Relative Close
gap(0), // the opening gap (modified by the gap coefficient)
GapCoef(1.0), // Gap Coefficient
Accumv(0); // The sum of all the daily gaps
if date<>date[1] then begin
gap=GapCoef*(O-C[1]);
Accumv=Accumv+gap;
end;
if DataCompress <= 2 then //Valid only for Tick or Intraday
begin
RelO = O-Accumv;
RelC = C-Accumv;
RelH = H-Accumv;
RelL = L-Accumv;
end
else begin
RelO = O;
RelC = C;
RelH = H;
RelL = L;
end;
// Gapless - end
//Stoc}
Num=RelC-_Lst(RelL,DStLen);
Denom=_Hst(RelH,DStLen)-_Lst(RelL,DStLen);
Ratio=IFF(Denom>0,(Num/Denom)*100,Ratio[1]);
PctK=IFF(CurrentBar<=1,Ratio,PctK[1]+(.5*(Ratio-PctK[1])));
//{DStoc}
DNum=PctK-_Lst(PctK,DStLen);
DDenom=_Hst(PctK,DStLen)-_Lst(PctK,DStLen);
DRatio=IFF(DDenom>0,(DNum/DDenom)*100,DRatio[1]);
DPctK=IFF(CurrentBar<=1,DRatio,DPctK[1]+(.5*(DRatio-DPctK[1])));
_DStocGL=DPctK;
즐거운 하루되세요
> 예시스 님이 쓴 글입니다.
> 제목 : 변환부탁드립니다.
> 격무를 무릎쓰고 항상 많은 도움을 주셔서 감사드립니다.
아래는 EL 함수식인데 예스로 변환 부탁드립니다.
Inputs:
DStLen(NumericSimple)
;
Vars:
Num(0),
Denom(0),
Ratio(0),
PctK(0),
DNum(0),
DDenom(0),
DRatio(0),
DPctK(0);
Vars:
RelO(0), // Relative Open
RelH(0), // Relative High
RelL(0), // Relative low
RelC(0), // Relative Close
gap(0), // the opening gap (modified by the gap coefficient)
GapCoef(1.0), // Gap Coefficient
Accum(0); // The sum of all the daily gaps
if currentsession(0)<>currentsession(0)[1] or date<>date[1] then
begin
gap=GapCoef*(O-C[1]);
Accum=Accum+gap;
end;
if DataCompress<=1 then //Valid only for Tick or Intraday
begin
RelO = O-Accum;
RelC = C-Accum;
RelH = H-Accum;
RelL = L-Accum;
end
else begin
RelO = O;
RelC = C;
RelH = H;
RelL = L;
end;
// Gapless - end
//Stoc}
Num=RelC-_Lst(RelL,DStLen);
Denom=_Hst(RelH,DStLen)-_Lst(RelL,DStLen);
Ratio=IFF(Denom>0,(Num/Denom)*100,Ratio[1]);
PctK=IFF(CurrentBar==1,Ratio,PctK[1]+(.5*(Ratio-PctK[1])));
//{DStoc}
DNum=PctK-_Lst(PctK,DStLen);
DDenom=_Hst(PctK,DStLen)-_Lst(PctK,DStLen);
DRatio=IFF(DDenom>0,(DNum/DDenom)*100,DRatio[1]);
DPctK=IFF(CurrentBar==1,DRatio,DPctK[1]+(.5*(DRatio-DPctK[1])));
_DStocGL=DPctK;
다음글
이전글