<function>
 <description>Экспоненциальное среднее</description>
 <description_en>Exponential average</description_en>
 <code>function XAverage(x, PriceValue, Len)
{
  if (CurrentBar == 0)
    x.setAt(0,  PriceValue.at(0));
  else
    x.setAt(0, x.at(1) + (2/(Len+1))*(PriceValue.at(0)-x.at(1)));
  return x.at(0);
}</code>
</function>
