i want to learn how to setup custom indicator
the manual said that i can refer to the value of the previous bars by using codes like Close[1] Close[2] Close[3] etc...
I am trying to calculate a simple 14Day SMA with the following code...
double temp = 0;
for (int barsAgo = 0; barsAgo < 14; barsAgo++)
{
temp = temp + Input[barsAgo];
}
Plot0.Set(temp/14);
I don't know why there is nothing on my plot after i use this complied indicator?
but when I change Input[barsAgo] to Input[0], I do have a value of today times 14 (because i loop 14 times)
can anyone advise? Thank you so much!
Hiromichi
Comment