ok, i'm not much of a programmer. i understand some basics, but that's about it.
i made a formula for esignal that works, but it is plotting it in the wrong place. i made a simple formula to explain my problem:
function preMain()
{
setPriceStudy(true);
setCursorLabelName("5sma");
}
function main(Price, Periods)
{
var close = getValue("Close",0);
var close1 = getValue("Close",1);
var close2 = getValue("Close",2);
var close3 = getValue("Close",3);
var close4 = getValue("Close",4);
var ma = ((close+close1+close2+close3+close4) / 5);
return ma;
}
the above formula calculates a simple 5 period moving average. however, when i have esignal do a 5sma on its own and i run my formula, my values are the same, but my 5sma gets plotted 5 days ago. lol all i want is to get the above formula to line up exactly like a 5sma done by esignal.
once i see what my problem is, i will go back and fix my original idea.
thanks
i made a formula for esignal that works, but it is plotting it in the wrong place. i made a simple formula to explain my problem:
function preMain()
{
setPriceStudy(true);
setCursorLabelName("5sma");
}
function main(Price, Periods)
{
var close = getValue("Close",0);
var close1 = getValue("Close",1);
var close2 = getValue("Close",2);
var close3 = getValue("Close",3);
var close4 = getValue("Close",4);
var ma = ((close+close1+close2+close3+close4) / 5);
return ma;
}
the above formula calculates a simple 5 period moving average. however, when i have esignal do a 5sma on its own and i run my formula, my values are the same, but my 5sma gets plotted 5 days ago. lol all i want is to get the above formula to line up exactly like a 5sma done by esignal.
once i see what my problem is, i will go back and fix my original idea.
thanks

).