i have a big problem, if i am in the OnBarUpdate() how exactly do i get here my prices? is currentbar the current prize? Can somebody exactly explain what is happening in the code below? I know its a simple moving average and see that also roughly but i dont know what the value-array is and the input array (what is in these arrays?)
protected override void OnBarUpdate()
{
// Use this method for calculating your indicator values. Assign a value to each
if (CurrentBar == 0)
Value.Set(Input[0]);
else
{
double last = Value[1] * Math.Min(CurrentBar, Period);
if (CurrentBar >= Period)
Value.Set((last + Input[0] - Input[Period]) / Math.Min(CurrentBar, Period));
else
Value.Set((last + Input[0]) / (Math.Min(CurrentBar, Period) + 1));
}
Franz

Comment