What I mean by When has the Market ever been logical is;
If you have never read up on Random walk theory and Efficient Market Hypothesis. You should.
If markets were perfectly efficient and random then traders would not be able to make excess returns on any available information because the information is already out there and the moves are random. But that is not the case, therefore markets can not be perfectly efficient in the sense of fundamental data and exchange rates always being where fundamentally they should be. Technical analysis helps traders create methods to beat the market using past data. Now efficient markets hypothesis states that past market data had no bearing on forecasting the future, but if that was true. Then technical analysis would be useless. So yeah….. the Market is not logical.
Anyways..
The Reverse Exponential Moving Average An exponential moving average computed working backward through the time series, rather than forward, as is the case with a standard EMA. A REMA is used so the target would reflect only future price behavior, not past action that would induce spurious correlation.-
Traders' Glossary N-S
I believe this is the code for it but I believe it is for Amibrokers.
// Reverse EMA function, by D.Tsokakis, June 2003
P=20;
CLOSEviaEMA=0.5*((P+1)*EMA(C,P)-(P-1)*Ref(EMA(C,P),-1));
Plot(C,"CLOSE",1,1);
Plot(CLOSEviaEMA,"CLOSEviaEMA",7,8);
AmiBroker - AFL Library
It can be used in the Market to better judge short term and mid term correlations between currencies and filter out market noise between currency legs. It can also help in studying market cycles.
Spurious relationship - Wikipedia, the free encyclopedia