actually this (price - MA oscillator) would be a real simple kind of detrending
It would be a lot like
MAdistance.mq4 , but as an oscillator, and not just as text on the chart.
By editing the line
extern int MA.Method = MODE_EMA; to
extern int MA.Method = MODE_SMA; You get the difference between the price and the SMA.
The required indi is similar to the
DPO, but still it's not the same because when you compare the value of the DPO with the difference between the price bars and the MA, you get a different value (for the same settings of MA offcourse)