Calculating the SNR from the power spectrum. Is my suggestion relevant?
Assuming the noise is evenly distributed among all frequencies, this approach makes sense in principle. However, some corrections:


You should not integrate over $pxx(n)f(n)dn$, since n is already the frequency. I think, you mean $\Delta_f(n)$, which is the frequency step between two bins. Assuming $\Delta_f(n)$ is equal and independent of n, then you can even cancel it in the equation.
You need to divide the noise and signal components by the respective bandwidth of the integral. Otherwise you will calculate more noise, when the bandwidth increases. 
currently, you calculate (signal+noise)/noise. Though, you want to calculate signal/noise, i.e. (signal+noise-noise)/noise