I'm not sure what you are trying to do. If you pass the ma_period to the BBands function, it will be optimized. But why would you want to exclude it from the trade rules?