Here check this
// By : Bill Halliday
function DetrendedPriceOsc( Periods )
{
return C - Ref( MA( C, Periods ), -( 1 + Periods/2 ) );
}
dpo = DetrendedPriceOsc( Param("Periods", 20, 1, 100 ) );
PlotOHLC( dpo, dpo, 0,dpo , "Dpo", colorLime, styleCloud );
sig=WMA(DPO,20);
Plot(sig,"Sig",4,1,0,0,0,1);
Buy=Cross(dpo,sig);
Sell=Cross(sig,dpo);
PlotShapes(shapeSmallCircle*Buy,colorBlue,0,dpo,-10);
PlotShapes(shapeSmallCircle*Sell,colorRed,0,dpo,10);
* No sound Alert ,