spain
Experience: Intermediate
Platform: TradeStation
Posts: 18 since Apr 2010
Thanks Given: 24
Thanks Received: 5
|
Hi guys, I am looking for a double stochastic code. Exactly I am working in Ninja and Multichart and I want to move my double stochastic to Sierra. But in Sierra the D.Stochastic is very diferent , meaby the calculation is diferent. Anyone can help to me get DS from Ninja or MC to Sierra. ??
I leave you a snapshot to compare the 3 software. (the snapshot have 3diferent period 5,18 and 70 over ema75 in MC and ninja . In Sierra I posted only the 18 (blueone))
The MC (easy language) calculation is this:
[LegacyColorValue = true];
{_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;
|