The Detrendeded Price Oscillator (DPO) indicator looks like a moving average because it filters the directivity (trend) in the price values in the same manner, it allows to determine the circularity easier. The indicator determines the circularity by drawing the moving avarage in the form of a straight horizontal line and then plaсing the price values along this line according to their ratio to the moving average.
The Detrended Price Oscillator is calculated by the following formula:
DPO(i) = Close(i) - SMA(i, N)
where N is the period of the moving average.
The oscilator rapidly discovers the end of the price trend and the beginning of the price movement in a horizontal interval and reverse.CloseOrd.mq4
It deletes a pending order or closes an opened order in accordance with your selection. It is necessary just to drag the script to an order. The script will choose the closest one and will close or delete it.