PureBytes Links
Trading Reference Links
|
Could anyone help me out with converting an Easy
Language Double Stochastic Indicator to Metastock?
Below is the ELA formula:
Function:
_DStoc: Double Stochastic}
Inputs: DStLen(NumericSimple);
Vars:
Num(0),Denom(0),Ratio(0),PctK(0),DNum(0),DDenom(0),
DRatio(0),DPctK(0);
{Stoc}
Num=C-_Lst(L,DStLen);
Denom=_Hst(H,DStLen)-_Lst(L,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])));
_DStoc=DPctK;
{_Hst: Calculates Highest Values}
Inputs: Price(NumericSeries),Length(NumericSimple);
Vars: X(0),Hi(-999999);
Hi=-999999;
For X=0 to Length-1 begin
If Price[X]>Hi then Hi=Price[X];
End;
_Hst=Hi;
{_Lst: Calculates Lowest Values}
Inputs: Price(NumericSeries),Length(NumericSimple);
Vars: X(0),Lo(999999);
Lo=999999;
For X=0 to Length-1 begin
If Price[X]<Lo then Lo=Price[X];
End;
_Lst=Lo;
__________________________________________________
Do You Yahoo!?
Yahoo! Sports - sign up for Fantasy Baseball
http://sports.yahoo.com
|