/*[[ 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 := No Second Color := Red Second Draw Type := Line Second Symbol := 218 ]]*/ Input : x_prd(14); Variable : shift(0); Variable : t_prd(0), dpo(0); t_prd=x_prd/2+1; SetLoopCount(0); For shift=Bars-1 Downto 0 Begin dpo=C[shift]-iMAEx(x_prd,MODE_SMA,t_prd,PRICE_CLOSE,shift); SetIndexValue(shift,dpo); End;