[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: W.B DSStochastic



PureBytes Links

Trading Reference Links

At 01:05 PM 3/10/2005, ericzh2003 wrote:
>Hi List,
>
>Does anybody have ELA code for  William Blau's Double Smoothed Stochastic?
>
>Here is the formula:
>
>DSS (p1, p2, p3) =3D EMA( EMA( Close - Lowest(p1), p2), p3 ) /
>                          EMA( EMA( Highest(p1) - Lowest(p1), p2), p3) 

A direct translation is:

DSS = XAverage(XAverage(Close - Lowest(Close, p1), p2), p3) / 
      XAverage(XAverage(Highest(Close, p1) - Lowest(Close, p1), p2), p3)

But TradeStation may not be able to parse it correctly.

This version is probably safer:

Value1 = Close - Lowest(Close, p1);
Value2 = XAverage(Value1, p2);
Value3 = XAverage(Value2, p3);

Value4 = Highest(Close, p1) - Lowest(Close, p1);
Value5 = XAverage(Value4, p2);
Value6 = XAverage(Value5, p3);

if Value6 <> 0 then 
   DSS = Value3 / Value6;

Bob Fulks