FT,

Thanks for your offer of help.Much appreciated.This is the formula for a 15ema in esignal. I am trying to find out how to adapt this so that I can move/offset the ema either backwards or forwards say x periods where x can be 3 or any number for that matter.

function preMain() {

setPriceStudy(true);

}

var dLastMA = 0.0;

var dThisMA = 0.0;

var dPercent = 0.0;

var dCount = 0;

var bPrimed = false;

function main(nInputLength) {

if(nInputLength == null)

nInputLength = 15;

var nBarState = getBarState();

var i;

var dValue;

var dSum = 0.0;

if(nBarState == BARSTATE_ALLBARS) {

// reset!

dPercent = (2.0 / (nInputLength + 1.0));

dLastMA = 0.0;

dThisMA = 0.0;

dCount = 0;

}

if(nBarState == BARSTATE_NEWBAR) {

dLastMA = dThisMA;

}

dThisMA = dLastMA;

if(bPrimed == false) {

dValue = getValue("Close", 0, -nInputLength);

if(dValue == null)

return;

for(i = 0; i < nInputLength; i++) {

dSum += dValue*;*

}

dLastMA = dSum / nInputLength;

dThisMA = dLastMA;

bPrimed = true;

} else {

dValue = getValue("Close");

if(dValue == null)

return;

dThisMA = (dValue - dLastMA) * dPercent + dLastMA;

}

return dThisMA;

}

Cheers