I need help to understand the logic of official NT EMA code:
Value.Set(CurrentBar == 0 ? Input[0] : Input[0] * (2.0 / (1 + Period)) + (1 - (2.0 / (1 + Period))) * Value[1]);
Is it equivalent to:
if (CurrentBar ==0)
{
Value.Set(Input(0));
}
else
{
Value.Set(Input[0] * (2.0 / (1 + Period)) + (1 - (2.0 / (1 + Period))) * Value[1]);
}
In other words, the formular applies to all bras except for the 1st bar?
Any suggestions are welcome.
Comment