Hi
Any kind of optimization of code results is some degree of curve fitting with the past data.
Any system you trade you should first clearly understand the premise behind it.
For optimization do not look for maximum profit or max % of profitable trades etc.
Look for a broad range in the parameters where returns are stable / consistent
for e.g. lets say we are optimizing super trend for selecting the factor
here 1.8 gives maximum gains but 1.5 and 2.0 perform worst, wheres as
everything between 2.5 to 4, gives moderate but consistent results
then choose the mean of 2.5/4 maybe 3.2 or 3.5 if you prefer it over others
There are many different ratios etc but for me the most important one is profit factor
I have realized that it is tough for me to trade any thing that has profit factor under 2,
so its just not optimization it is also personalization
You need to understand yourself and then select system/parameters to suit your nature/temperament.
Thanks
Happy