/*[[ Name := Deterend Price Oscillator Author := hapsa Link := http://www.metaquotes.net/ Notes := The Detrended Price Oscillator (DPO) is an indicator that attempts toeliminatethe trend in prices. Notes := Detrended prices allow you to more easily identify cycles and overbought/oversold levels. Notes := Separate Window := Yes First Color := Blue First Draw Type := Line First Symbol := 217 Use Second Data := yes Second Color := Red Second Draw Type := Line Second Symbol := 218 ]]*/ Input : WMA(50),wma0ema1sma2(0); Variable : shift(0); Variable : t_prd(0), dpo(0),pryce(0); SetLoopCount(0); For shift=Bars-1 Downto 0 Begin if wma0ema1sma2=0 then dpo=iMAEx(WMA,MODE_wMA,0,Price_close,shift); if wma0ema1sma2=1 then dpo=iMAEx(WMA,MODE_eMA,0,Price_close,shift); if wma0ema1sma2=0 then dpo=iMAEx(WMA,MODE_sMA,0,Price_close,shift); pryce = close[shift]; SetIndexValue(shift,dpo); SetIndexValue2(shift,pryce); End;