We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Hyperopt Resamples
   Python Version: 3.6.7
    CCXT version: 1.18.507
    Branch: Develop
    Last Commit ID: 4ae743e

  
## Step 3: Describe the problem:

self.ticker_interval is not implemented in the hyperopt interface, so you cannot resample data to higher timeframes.



--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `freqtrade/optimize/hyperopt_interface.py`
Content:
```
1 """
2 IHyperOpt interface
3 This module defines the interface to apply for hyperopts
4 """
5 
6 from abc import ABC, abstractmethod
7 from typing import Dict, Any, Callable, List
8 
9 from pandas import DataFrame
10 from skopt.space import Dimension
11 
12 
13 class IHyperOpt(ABC):
14     """
15     Interface for freqtrade hyperopts
16     Defines the mandatory structure must follow any custom strategies
17 
18     Attributes you can use:
19         minimal_roi -> Dict: Minimal ROI designed for the strategy
20         stoploss -> float: optimal stoploss designed for the strategy
21         ticker_interval -> int: value of the ticker interval to use for the strategy
22     """
23 
24     @staticmethod
25     @abstractmethod
26     def populate_indicators(dataframe: DataFrame, metadata: dict) -> DataFrame:
27         """
28         Populate indicators that will be used in the Buy and Sell strategy
29         :param dataframe: Raw data from the exchange and parsed by parse_ticker_dataframe()
30         :return: a Dataframe with all mandatory indicators for the strategies
31         """
32 
33     @staticmethod
34     @abstractmethod
35     def buy_strategy_generator(params: Dict[str, Any]) -> Callable:
36         """
37         Create a buy strategy generator
38         """
39 
40     @staticmethod
41     @abstractmethod
42     def sell_strategy_generator(params: Dict[str, Any]) -> Callable:
43         """
44         Create a sell strategy generator
45         """
46 
47     @staticmethod
48     @abstractmethod
49     def indicator_space() -> List[Dimension]:
50         """
51         Create an indicator space
52         """
53 
54     @staticmethod
55     @abstractmethod
56     def sell_indicator_space() -> List[Dimension]:
57         """
58         Create a sell indicator space
59         """
60 
61     @staticmethod
62     @abstractmethod
63     def generate_roi_table(params: Dict) -> Dict[int, float]:
64         """
65         Create an roi table
66         """
67 
68     @staticmethod
69     @abstractmethod
70     def stoploss_space() -> List[Dimension]:
71         """
72         Create a stoploss space
73         """
74 
75     @staticmethod
76     @abstractmethod
77     def roi_space() -> List[Dimension]:
78         """
79         Create a roi space
80         """
81
```

Path: `freqtrade/resolvers/hyperopt_resolver.py`
Content:
```
1 # pragma pylint: disable=attribute-defined-outside-init
2 
3 """
4 This module load custom hyperopts
5 """
6 import logging
7 from pathlib import Path
8 from typing import Optional, Dict
9 
10 from freqtrade.constants import DEFAULT_HYPEROPT
11 from freqtrade.optimize.hyperopt_interface import IHyperOpt
12 from freqtrade.resolvers import IResolver
13 
14 logger = logging.getLogger(__name__)
15 
16 
17 class HyperOptResolver(IResolver):
18     """
19     This class contains all the logic to load custom hyperopt class
20     """
21 
22     __slots__ = ['hyperopt']
23 
24     def __init__(self, config: Optional[Dict] = None) -> None:
25         """
26         Load the custom class from config parameter
27         :param config: configuration dictionary or None
28         """
29         config = config or {}
30 
31         # Verify the hyperopt is in the configuration, otherwise fallback to the default hyperopt
32         hyperopt_name = config.get('hyperopt') or DEFAULT_HYPEROPT
33         self.hyperopt = self._load_hyperopt(hyperopt_name, extra_dir=config.get('hyperopt_path'))
34 
35         if not hasattr(self.hyperopt, 'populate_buy_trend'):
36             logger.warning("Custom Hyperopt does not provide populate_buy_trend. "
37                            "Using populate_buy_trend from DefaultStrategy.")
38         if not hasattr(self.hyperopt, 'populate_sell_trend'):
39             logger.warning("Custom Hyperopt does not provide populate_sell_trend. "
40                            "Using populate_sell_trend from DefaultStrategy.")
41 
42     def _load_hyperopt(
43             self, hyperopt_name: str, extra_dir: Optional[str] = None) -> IHyperOpt:
44         """
45         Search and loads the specified hyperopt.
46         :param hyperopt_name: name of the module to import
47         :param extra_dir: additional directory to search for the given hyperopt
48         :return: HyperOpt instance or None
49         """
50         current_path = Path(__file__).parent.parent.joinpath('optimize').resolve()
51 
52         abs_paths = [
53             current_path.parent.parent.joinpath('user_data/hyperopts'),
54             current_path,
55         ]
56 
57         if extra_dir:
58             # Add extra hyperopt directory on top of search paths
59             abs_paths.insert(0, Path(extra_dir))
60 
61         for _path in abs_paths:
62             try:
63                 hyperopt = self._search_object(directory=_path, object_type=IHyperOpt,
64                                                object_name=hyperopt_name)
65                 if hyperopt:
66                     logger.info("Using resolved hyperopt %s from '%s'", hyperopt_name, _path)
67                     return hyperopt
68             except FileNotFoundError:
69                 logger.warning('Path "%s" does not exist', _path.relative_to(Path.cwd()))
70 
71         raise ImportError(
72             "Impossible to load Hyperopt '{}'. This class does not exist"
73             " or contains Python code errors".format(hyperopt_name)
74         )
75
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/freqtrade/optimize/hyperopt_interface.py b/freqtrade/optimize/hyperopt_interface.py
--- a/freqtrade/optimize/hyperopt_interface.py
+++ b/freqtrade/optimize/hyperopt_interface.py
@@ -20,6 +20,7 @@
         stoploss -> float: optimal stoploss designed for the strategy
         ticker_interval -> int: value of the ticker interval to use for the strategy
     """
+    ticker_interval: str
 
     @staticmethod
     @abstractmethod
diff --git a/freqtrade/resolvers/hyperopt_resolver.py b/freqtrade/resolvers/hyperopt_resolver.py
--- a/freqtrade/resolvers/hyperopt_resolver.py
+++ b/freqtrade/resolvers/hyperopt_resolver.py
@@ -32,6 +32,9 @@
         hyperopt_name = config.get('hyperopt') or DEFAULT_HYPEROPT
         self.hyperopt = self._load_hyperopt(hyperopt_name, extra_dir=config.get('hyperopt_path'))
 
+        # Assign ticker_interval to be used in hyperopt
+        self.hyperopt.__class__.ticker_interval = str(config['ticker_interval'])
+
         if not hasattr(self.hyperopt, 'populate_buy_trend'):
             logger.warning("Custom Hyperopt does not provide populate_buy_trend. "
                            "Using populate_buy_trend from DefaultStrategy.")

{"golden_diff": "diff --git a/freqtrade/optimize/hyperopt_interface.py b/freqtrade/optimize/hyperopt_interface.py\n--- a/freqtrade/optimize/hyperopt_interface.py\n+++ b/freqtrade/optimize/hyperopt_interface.py\n@@ -20,6 +20,7 @@\n         stoploss -> float: optimal stoploss designed for the strategy\n         ticker_interval -> int: value of the ticker interval to use for the strategy\n     \"\"\"\n+    ticker_interval: str\n \n     @staticmethod\n     @abstractmethod\ndiff --git a/freqtrade/resolvers/hyperopt_resolver.py b/freqtrade/resolvers/hyperopt_resolver.py\n--- a/freqtrade/resolvers/hyperopt_resolver.py\n+++ b/freqtrade/resolvers/hyperopt_resolver.py\n@@ -32,6 +32,9 @@\n         hyperopt_name = config.get('hyperopt') or DEFAULT_HYPEROPT\n         self.hyperopt = self._load_hyperopt(hyperopt_name, extra_dir=config.get('hyperopt_path'))\n \n+        # Assign ticker_interval to be used in hyperopt\n+        self.hyperopt.__class__.ticker_interval = str(config['ticker_interval'])\n+\n         if not hasattr(self.hyperopt, 'populate_buy_trend'):\n             logger.warning(\"Custom Hyperopt does not provide populate_buy_trend. \"\n                            \"Using populate_buy_trend from DefaultStrategy.\")\n", "issue": "Hyperopt Resamples\n   Python Version: 3.6.7\r\n    CCXT version: 1.18.507\r\n    Branch: Develop\r\n    Last Commit ID: 4ae743e\r\n\r\n  \r\n## Step 3: Describe the problem:\r\n\r\nself.ticker_interval is not implemented in the hyperopt interface, so you cannot resample data to higher timeframes.\r\n\r\n\n", "before_files": [{"content": "\"\"\"\nIHyperOpt interface\nThis module defines the interface to apply for hyperopts\n\"\"\"\n\nfrom abc import ABC, abstractmethod\nfrom typing import Dict, Any, Callable, List\n\nfrom pandas import DataFrame\nfrom skopt.space import Dimension\n\n\nclass IHyperOpt(ABC):\n    \"\"\"\n    Interface for freqtrade hyperopts\n    Defines the mandatory structure must follow any custom strategies\n\n    Attributes you can use:\n        minimal_roi -> Dict: Minimal ROI designed for the strategy\n        stoploss -> float: optimal stoploss designed for the strategy\n        ticker_interval -> int: value of the ticker interval to use for the strategy\n    \"\"\"\n\n    @staticmethod\n    @abstractmethod\n    def populate_indicators(dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Populate indicators that will be used in the Buy and Sell strategy\n        :param dataframe: Raw data from the exchange and parsed by parse_ticker_dataframe()\n        :return: a Dataframe with all mandatory indicators for the strategies\n        \"\"\"\n\n    @staticmethod\n    @abstractmethod\n    def buy_strategy_generator(params: Dict[str, Any]) -> Callable:\n        \"\"\"\n        Create a buy strategy generator\n        \"\"\"\n\n    @staticmethod\n    @abstractmethod\n    def sell_strategy_generator(params: Dict[str, Any]) -> Callable:\n        \"\"\"\n        Create a sell strategy generator\n        \"\"\"\n\n    @staticmethod\n    @abstractmethod\n    def indicator_space() -> List[Dimension]:\n        \"\"\"\n        Create an indicator space\n        \"\"\"\n\n    @staticmethod\n    @abstractmethod\n    def sell_indicator_space() -> List[Dimension]:\n        \"\"\"\n        Create a sell indicator space\n        \"\"\"\n\n    @staticmethod\n    @abstractmethod\n    def generate_roi_table(params: Dict) -> Dict[int, float]:\n        \"\"\"\n        Create an roi table\n        \"\"\"\n\n    @staticmethod\n    @abstractmethod\n    def stoploss_space() -> List[Dimension]:\n        \"\"\"\n        Create a stoploss space\n        \"\"\"\n\n    @staticmethod\n    @abstractmethod\n    def roi_space() -> List[Dimension]:\n        \"\"\"\n        Create a roi space\n        \"\"\"\n", "path": "freqtrade/optimize/hyperopt_interface.py"}, {"content": "# pragma pylint: disable=attribute-defined-outside-init\n\n\"\"\"\nThis module load custom hyperopts\n\"\"\"\nimport logging\nfrom pathlib import Path\nfrom typing import Optional, Dict\n\nfrom freqtrade.constants import DEFAULT_HYPEROPT\nfrom freqtrade.optimize.hyperopt_interface import IHyperOpt\nfrom freqtrade.resolvers import IResolver\n\nlogger = logging.getLogger(__name__)\n\n\nclass HyperOptResolver(IResolver):\n    \"\"\"\n    This class contains all the logic to load custom hyperopt class\n    \"\"\"\n\n    __slots__ = ['hyperopt']\n\n    def __init__(self, config: Optional[Dict] = None) -> None:\n        \"\"\"\n        Load the custom class from config parameter\n        :param config: configuration dictionary or None\n        \"\"\"\n        config = config or {}\n\n        # Verify the hyperopt is in the configuration, otherwise fallback to the default hyperopt\n        hyperopt_name = config.get('hyperopt') or DEFAULT_HYPEROPT\n        self.hyperopt = self._load_hyperopt(hyperopt_name, extra_dir=config.get('hyperopt_path'))\n\n        if not hasattr(self.hyperopt, 'populate_buy_trend'):\n            logger.warning(\"Custom Hyperopt does not provide populate_buy_trend. \"\n                           \"Using populate_buy_trend from DefaultStrategy.\")\n        if not hasattr(self.hyperopt, 'populate_sell_trend'):\n            logger.warning(\"Custom Hyperopt does not provide populate_sell_trend. \"\n                           \"Using populate_sell_trend from DefaultStrategy.\")\n\n    def _load_hyperopt(\n            self, hyperopt_name: str, extra_dir: Optional[str] = None) -> IHyperOpt:\n        \"\"\"\n        Search and loads the specified hyperopt.\n        :param hyperopt_name: name of the module to import\n        :param extra_dir: additional directory to search for the given hyperopt\n        :return: HyperOpt instance or None\n        \"\"\"\n        current_path = Path(__file__).parent.parent.joinpath('optimize').resolve()\n\n        abs_paths = [\n            current_path.parent.parent.joinpath('user_data/hyperopts'),\n            current_path,\n        ]\n\n        if extra_dir:\n            # Add extra hyperopt directory on top of search paths\n            abs_paths.insert(0, Path(extra_dir))\n\n        for _path in abs_paths:\n            try:\n                hyperopt = self._search_object(directory=_path, object_type=IHyperOpt,\n                                               object_name=hyperopt_name)\n                if hyperopt:\n                    logger.info(\"Using resolved hyperopt %s from '%s'\", hyperopt_name, _path)\n                    return hyperopt\n            except FileNotFoundError:\n                logger.warning('Path \"%s\" does not exist', _path.relative_to(Path.cwd()))\n\n        raise ImportError(\n            \"Impossible to load Hyperopt '{}'. This class does not exist\"\n            \" or contains Python code errors\".format(hyperopt_name)\n        )\n", "path": "freqtrade/resolvers/hyperopt_resolver.py"}], "after_files": [{"content": "\"\"\"\nIHyperOpt interface\nThis module defines the interface to apply for hyperopts\n\"\"\"\n\nfrom abc import ABC, abstractmethod\nfrom typing import Dict, Any, Callable, List\n\nfrom pandas import DataFrame\nfrom skopt.space import Dimension\n\n\nclass IHyperOpt(ABC):\n    \"\"\"\n    Interface for freqtrade hyperopts\n    Defines the mandatory structure must follow any custom strategies\n\n    Attributes you can use:\n        minimal_roi -> Dict: Minimal ROI designed for the strategy\n        stoploss -> float: optimal stoploss designed for the strategy\n        ticker_interval -> int: value of the ticker interval to use for the strategy\n    \"\"\"\n    ticker_interval: str\n\n    @staticmethod\n    @abstractmethod\n    def populate_indicators(dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Populate indicators that will be used in the Buy and Sell strategy\n        :param dataframe: Raw data from the exchange and parsed by parse_ticker_dataframe()\n        :return: a Dataframe with all mandatory indicators for the strategies\n        \"\"\"\n\n    @staticmethod\n    @abstractmethod\n    def buy_strategy_generator(params: Dict[str, Any]) -> Callable:\n        \"\"\"\n        Create a buy strategy generator\n        \"\"\"\n\n    @staticmethod\n    @abstractmethod\n    def sell_strategy_generator(params: Dict[str, Any]) -> Callable:\n        \"\"\"\n        Create a sell strategy generator\n        \"\"\"\n\n    @staticmethod\n    @abstractmethod\n    def indicator_space() -> List[Dimension]:\n        \"\"\"\n        Create an indicator space\n        \"\"\"\n\n    @staticmethod\n    @abstractmethod\n    def sell_indicator_space() -> List[Dimension]:\n        \"\"\"\n        Create a sell indicator space\n        \"\"\"\n\n    @staticmethod\n    @abstractmethod\n    def generate_roi_table(params: Dict) -> Dict[int, float]:\n        \"\"\"\n        Create an roi table\n        \"\"\"\n\n    @staticmethod\n    @abstractmethod\n    def stoploss_space() -> List[Dimension]:\n        \"\"\"\n        Create a stoploss space\n        \"\"\"\n\n    @staticmethod\n    @abstractmethod\n    def roi_space() -> List[Dimension]:\n        \"\"\"\n        Create a roi space\n        \"\"\"\n", "path": "freqtrade/optimize/hyperopt_interface.py"}, {"content": "# pragma pylint: disable=attribute-defined-outside-init\n\n\"\"\"\nThis module load custom hyperopts\n\"\"\"\nimport logging\nfrom pathlib import Path\nfrom typing import Optional, Dict\n\nfrom freqtrade.constants import DEFAULT_HYPEROPT\nfrom freqtrade.optimize.hyperopt_interface import IHyperOpt\nfrom freqtrade.resolvers import IResolver\n\nlogger = logging.getLogger(__name__)\n\n\nclass HyperOptResolver(IResolver):\n    \"\"\"\n    This class contains all the logic to load custom hyperopt class\n    \"\"\"\n\n    __slots__ = ['hyperopt']\n\n    def __init__(self, config: Optional[Dict] = None) -> None:\n        \"\"\"\n        Load the custom class from config parameter\n        :param config: configuration dictionary or None\n        \"\"\"\n        config = config or {}\n\n        # Verify the hyperopt is in the configuration, otherwise fallback to the default hyperopt\n        hyperopt_name = config.get('hyperopt') or DEFAULT_HYPEROPT\n        self.hyperopt = self._load_hyperopt(hyperopt_name, extra_dir=config.get('hyperopt_path'))\n\n        # Assign ticker_interval to be used in hyperopt\n        self.hyperopt.__class__.ticker_interval = str(config['ticker_interval'])\n\n        if not hasattr(self.hyperopt, 'populate_buy_trend'):\n            logger.warning(\"Custom Hyperopt does not provide populate_buy_trend. \"\n                           \"Using populate_buy_trend from DefaultStrategy.\")\n        if not hasattr(self.hyperopt, 'populate_sell_trend'):\n            logger.warning(\"Custom Hyperopt does not provide populate_sell_trend. \"\n                           \"Using populate_sell_trend from DefaultStrategy.\")\n\n    def _load_hyperopt(\n            self, hyperopt_name: str, extra_dir: Optional[str] = None) -> IHyperOpt:\n        \"\"\"\n        Search and loads the specified hyperopt.\n        :param hyperopt_name: name of the module to import\n        :param extra_dir: additional directory to search for the given hyperopt\n        :return: HyperOpt instance or None\n        \"\"\"\n        current_path = Path(__file__).parent.parent.joinpath('optimize').resolve()\n\n        abs_paths = [\n            current_path.parent.parent.joinpath('user_data/hyperopts'),\n            current_path,\n        ]\n\n        if extra_dir:\n            # Add extra hyperopt directory on top of search paths\n            abs_paths.insert(0, Path(extra_dir))\n\n        for _path in abs_paths:\n            try:\n                hyperopt = self._search_object(directory=_path, object_type=IHyperOpt,\n                                               object_name=hyperopt_name)\n                if hyperopt:\n                    logger.info(\"Using resolved hyperopt %s from '%s'\", hyperopt_name, _path)\n                    return hyperopt\n            except FileNotFoundError:\n                logger.warning('Path \"%s\" does not exist', _path.relative_to(Path.cwd()))\n\n        raise ImportError(\n            \"Impossible to load Hyperopt '{}'. This class does not exist\"\n            \" or contains Python code errors\".format(hyperopt_name)\n        )\n", "path": "freqtrade/resolvers/hyperopt_resolver.py"}]}