A filter with low phase shift or no phase shift at all? Which one? I'm seeking a good advice for a filter. Can you help me?

Right now I made my own simple filter. Not sure what I'm doing, but it seems to work.

function testFilter (t, y, p)

    % Forward filtering
    % Do first filtering by jumping k/2 elements in the future
  l = length(t);
  ye = y;
    for i = 1:l
      sum = 0;
      k = 0;
      for j = 0:p-1
        if(i + j &lt;= l)
          sum = sum + ye(i + j);
          k = k + 1;
        end
      end
      if(k != 0)
        ye(i+floor(k/2)) = sum/k;
      end
    end

    % Do the first p elements!
    for i = p:-1:1
      sum = 0;
      for j = 1:i
        sum = sum + ye(j);
      end
      ye(i) = sum/i;
    end

    % Done!
  figure
    plot(t, ye, t, y);
    legend("Filtered", "Noisy")
end


It's some kind of moving average, ich.
The reason why I selected this is beacuse a low pass filter caused phase shift and I don't like that. 

Here is a plot that shows a example how my filter algorithm works.
I think it's OK, but can it be done better without phase shift? 
Do you think Fast Fourier Transform is a much better filter in this noisy case?

If there is no filter that cause phase shifting, can you recommend a good filter for me then with low phase shift?
If your filter is $h[n] \leftrightarrow H(e^{j\omega})$, then the DTFT of the time reversed filter $h[-n]$ is $H^*(e^{j\omega})$. Consider the result of passing your signal through the combined filter $h[n]*h[-n]$, which has a DTFT of $H(e^{j\omega})H^*(e^{j\omega})=|H(e^{j\omega})|^2$ and has zero-phase. In this setup, I've assumed that $h[n]$ is causal so that makes $h[-n]$ anticausal, and this makes the overall filter $h[n]*h[-n]$ noncausal and not applicable for real time applications but can be used for offline processing. 

This is the idea used in the MATLAB command filtfilt. You pass filtfilt the filter coefficients and it runs the input signal through the filter and then the time reversed filter. Of course, you can also just as well do that by hand.

Here is a dumb example of a noisy sine wave and a moving average filter just to illustrate.