This function is not universal. It needs to be modified for a specific indicator. And even different strategies. Somewhere the exact peak is important, somewhere it can be neglected.
The ideal "eco" function should be made for a specific customer.
Yes, of course I can try.