Not sure what is the problem. You can have any variable as parameter. Whether this variable is set by input variable, set within the EA source, or read from a file. It does not matter.
Also, you can check if the EA runs in optimization mode and if true read the parameters from the input instead of another source.
Found it

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I am trying to follow this article
https://www.mql5.com/en/articles/4917
He is setting the optimized parameters as global variables.
But how do I use them in my EA?
I can't set input parameters to global variables because they require a constant.
And if I cancel all the inputs and just make them regular variables, then I won't be able to use the bot in the strategy tester...