anchor.diff:      end;
   
   % movingAverage
  -evaluate_call(<<"movingAverage">>, [Series, Window], _From, _Until, _Now) when is_binary(Window) ->
  +evaluate_call(<<"movingAverage">>, [Series, Window], From, Until, Now) when is_binary(Window) ->
       Offset = statser_util:parse_unit(Window),
  -    % TODO: fetch new data with `Offset` set back
  -    lists:map(fun(S) ->
  -                      WindowPoints = Offset / S#series.step,
  -                      S
  +    lists:map(fun(S0) ->
  +                      Step = S0#series.step,
  +                      WindowPoints = Offset div Step,
  +                      % fetch additional past data
  +                      [S] = fetch_data([S0#series.target], From-(WindowPoints * Step), Until, Now),
  +                      Values = moving_average(S#series.values, WindowPoints),
  +                      WithTimestamps = with_timestamps(Values, S0#series.start, S#series.step),
  +                      S#series{values=WithTimestamps, start=S0#series.start, until=S0#series.until}
                 end, Series);
   
   % multiplySeries
  
positive.code:            (A, B) -> <<A/binary, ".", B/binary>>
          end,
      lists:foldr(F, <<>>, Parts).
  
  
  safe_average(Values) ->
  
negative.code:     {Sum1, Len1} = with_current_value(X),
      NewSum = Sum + Sum0 + Sum1,
      NewLen = Len + Len0 + Len1,
      Avg = safe_avg(NewSum, NewLen),
      moving_average(Xs, Ls, NewSum, NewLen, [Avg | Acc]).
  
  
  