Optimization of the sensitivity of a double-dot magnetic detector