The bar period cannot be directly optimized. What you could do is optimizing the slider(0) position, but this works only under special circumstances, since the bar period is very fundamental to a system.

Better optimize time periods of indicators.