I am trying to fit the data with a complicated function with 5 fit parameters.
Can someone suggest what is the best way to fit in root.
Can someone suggest how does a template fit works and will it be applicable in this case?
I am defining a function and then fitting that function to the data.
The main problem is that the fit depends heavily on the initial value of parameter. Even if I change the initial value of a parameter from 1000000 to 1000010 (for exmple) the fit deviates from data and most of the time it does not even converge. Fit status says failed.
I know the order of fit parameter but I do not know the exact range.

Normally the best way in a complicated fit is to minimize the numerical error in both computing the function to minimize and within Minuit in the derivatives computation.
One way of doing this is to define parameter that have ranges around 1. Now if a parameter has an initial value so large it is better to redefining (by translating it and scaling it) such that its initial value is not very large (e.g. within a [-10,10] range and its expected error (scale) is around 1.