What is the best statistical measure tool to measure how close data is to fitted regression line if outliers are not fitted I am using a custom algorithm based on Gradient descent which computes the best fit on a training dataset. In this data set I have outliers i.e. data points that I do not want to fit. The algorithm is doing a good job in itself not fitting this data. However I want to quantify this 'goodness' with a statistical measuring technique.

I know that R squared is the most popular for regression, however I think that it is not the right approach for me. After trying r squared I am getting very low values because my algorithm is not fitting outliers which r squared does not take into account. rsquared does not know that I have outliers which the algorithm is on purpose not fitting with the rest of the data.

Is there another approach to this? maybe a different algorithm, or some changes I can make to r squared?
When you mention that your model does a good job in fitting the data (and not the outliers), I am assuming you are taking a look directly into actual vs predicted (or fitted) values. While doing this, you do not look for comparisons for outlier observations. 

Similarly, you could still calculate the R squared by removing the outlier observations from the calculation, and it could still serve as a measure for goodness of fit. There is sufficient documentation available on how to do this manually (by hand) so you can write a function to do this by yourself.