Optimizing the experiment setup manually cause prolongation in the time period of the experiment. Furthermore, as a result of increasing experimental studies, the time spend on beamline waiting lists in X-ray facilities will significantly extend. To solve these foreseen problems, it is crucial to optimize the experimental setups before the day of experiment. In this study, KB-mirror parameters was optimized with a modified genetic algorithm using XRayTracer simulation software and the performance results of this new algorithm are given. Considering that the results match with the theoretical expectation and the algorithm is more efficient than the existing ones, it is seen that this technique can also be used in more complex experimental setups.