I have an idea for an altered EMA. I am not sure if this has been programmed already. I am not even sure if this is a good idea. But I believe it would be a simple task for a seasoned programmer to do. I am curious what the result would be and how it could be used.
So instead of a regular EMA that decreased the older data exponentially, and gives more weight to the current price. What if we reserved it and applied greater weight to the past and decreased the importance of the current price.
I am still a student of MQ4L. The EMA code below if for a EMA, but I do not know which variables to alter in order to complete the task at hand
PHP Code:
{
double pr=2.0/(MA_Period+1);
int pos=Bars-2;
if(ExtCountedBars>2) pos=Bars-ExtCountedBars-1;
//---- main calculation loop
while(pos>=0)
{
if(pos==Bars-2) ExtMapBuffer[pos+1]=Close[pos+1];
ExtMapBuffer[pos]=Close[pos]*pr+ExtMapBuffer[pos+1]*(1-pr);
pos--;
}