_SECTION_BEGIN("modified DSS with voice alert");
/* Double Smoothed Stochastic - DSS */
function SayNotTooOften( text, Minperiod ) { elapsed=GetPerformanceCounter()/1000; Lastelapsed = Nz( StaticVarGet("lastsaytime") );
if( elapsed - Lastelapsed > Minperiod ) { StaticVarSet("lastsaytime", elapsed ); Say( text ); } }
Slw = 3; Pds = 14; A = EMA((Close-LLV(Low,Pds))/(HHV(H,pds)-LLV(L,Pds)),Slw)*100; DSS = EMA((A-LLV(A,pds))/(HHV(A,Pds)-LLV(A,Pds)),Slw)*100;
Value1 = 0.1 * (DSS-50); Value2 = WMA( Value1, 5 );
Sell = Cross (Value2, 4.5); Buy = Cross ( -4.5, Value2);
if (Sell = 1) SayNotTooOften ("sell, sell, sell", 60); if (Buy = 1) SayNotTooOften ("buy, buy, buy", 60);
Plot( Value2, "DSS", colorDarkGreen, styleThick );
_SECTION_END(); |