extra filename option added

This commit is contained in:
Emilio Basualdo 2022-08-20 16:54:58 -03:00
parent cdd4745693
commit e2ab13a94c

View File

@ -112,6 +112,9 @@ class HyperStrategyMixin:
self._ft_load_params(protection_params, 'protection', hyperopt) self._ft_load_params(protection_params, 'protection', hyperopt)
def load_params_from_file(self) -> Dict: def load_params_from_file(self) -> Dict:
filename_str = self.__class__.__name__
filename = Path(filename_str).with_suffix('.json')
if not filename.is_file():
filename_str = getattr(self, '__file__', '') filename_str = getattr(self, '__file__', '')
if not filename_str: if not filename_str:
return {} return {}