A system, comprising: an implantable stimulator device implantable in a patient, wherein the stimulation device comprises a lead with a plurality of electrodes for providing stimulation in accordance with stimulation parameters; and an external device programmed with an algorithm and configured to communicate with the implantable stimulator device, wherein the algorithm is configured to determine for the patient through testing an optimized longitudinal position along an axis of the lead and a first optimized amplitude for stimulation, wherein the optimized longitudinal position and the first optimized amplitude comprise first stimulation parameters; characterized in that the algorithm is further configured to determine whether the optimized longitudinal position is proximate to a set of directional electrodes on the lead, wherein the set of directional electrodes span around the axis of the lead at different rotational positions; if the optimized longitudinal position is not proximate to the set of directional electrodes on the lead, determine that the first stimulation parameters are optimized for the patient; and if the optimized longitudinal position is proximate to the set of directional electrodes on the lead, determine for the patient through testing an optimized rotational position and a second optimized amplitude for stimulation at the optimized longitudinal position, wherein the optimized longitudinal position, the optimized rotational position, and the second optimized amplitude comprise second stimulation parameters, and wherein the second stimulation parameters are determined to be optimized for the patient. an implantable stimulator device implantable in a patient, wherein the stimulation device comprises a lead with a plurality of electrodes for providing stimulation in accordance with stimulation parameters; and an external device programmed with an algorithm and configured to communicate with the implantable stimulator device, wherein the algorithm is configured to determine for the patient through testing an optimized longitudinal position along an axis of the lead and a first optimized amplitude for stimulation, wherein the optimized longitudinal position and the first optimized amplitude comprise first stimulation parameters; determine whether the optimized longitudinal position is proximate to a set of directional electrodes on the lead, wherein the set of directional electrodes span around the axis of the lead at different rotational positions; if the optimized longitudinal position is not proximate to the set of directional electrodes on the lead, determine that the first stimulation parameters are optimized for the patient; and if the optimized longitudinal position is proximate to the set of directional electrodes on the lead, determine for the patient through testing an optimized rotational position and a second optimized amplitude for stimulation at the optimized longitudinal position, wherein the optimized longitudinal position, the optimized rotational position, and the second optimized amplitude comprise second stimulation parameters, and wherein the second stimulation parameters are determined to be optimized for the patient.