  The search for continuous gravitational waves in a wide parameter space at
fixed computing cost is most efficiently done with semicoherent methods, e.g.
StackSlide, due to the prohibitive computing cost of the fully coherent search
strategies. Prix&Shaltev arXiv:1201.4321 have developed a semi-analytic method
for finding \emph{optimal} StackSlide parameters at fixed computing cost under
ideal data conditions, i.e. gap-less data and constant noise floor. In this
work we consider more realistic conditions by allowing for gaps in the data and
changes in noise level. We show how the sensitivity optimization can be
decoupled from the data selection problem. To find optimal semicoherent search
parameters we apply a numerical optimization using as example the semicoherent
StackSlide search. We also describe three different data selection algorithms.
Thus the outcome of the numerical optimization consists of the optimal search
parameters and the selected dataset. We first test the numerical optimization
procedure under ideal conditions and show that we can reproduce the results of
the analytical method. Then we gradually relax the conditions on the data and
find that a compact data selection algorithm yields higher sensitivity compared
to a greedy data selection procedure.
