This snippet shows how to use timeframes as input field. For that you just have to use the ENUM_TIMEFRAMES. It contains all of the predefined timeframes. This way you can use multiple times in a single optimization.
Source code viewer
input ENUM_TIMEFRAMES timeframeForMyIndicator = PERIOD_CURRENT; // You can use the custom time in an indicator. forceIndicator = iForce(Symbol(), timeframeForMyIndicator);Programming Language: MQL5