In AmiBroker there is optimize option. It allows you to fine tune values for indicators or even any other parameters. Is there anything like that in pine script? couldn't find it easily using google.
No. Can't be done automatically yet on TV. Adding the feature is being considered though.