Yes that is true the ma_period variable isnt used in the trade rule, I get it now why it was not optimized.
But in reality, the ma_period affects the bands of the bollinger thereby affecting the entry and exit signals.

How can I include the ma_period variable in optimization yet excluded from the trade rules?