# Buggy code
def __init__(self, config: dict, validate: bool = True) -> None:
    """
    Initializes this module with the given config,
    it does basic validation whether the specified exchange and pairs are valid.
    :return: None
    """
    self._api: ccxt.Exchange = None
    self._api_async: ccxt_async.Exchange = None

    self._config.update(config)

    self._cached_ticker: Dict[str, Any] = {}

    # Holds last candle refreshed time of each pair
    self._pairs_last_refresh_time: Dict[Tuple[str, str], int] = {}
    # Timestamp of last markets refresh
    self._last_markets_refresh: int = 0

    # Holds candles
    self._klines: Dict[Tuple[str, str], DataFrame] = {}

    # Holds all open sell orders for dry_run
    self._dry_run_open_orders: Dict[str, Any] = {}

    if config["dry_run"]:
        logger.info("Instance is running with dry_run enabled")

    exchange_config = config["exchange"]

    # Deep merge ft_has with default ft_has options
    self._ft_has = deep_merge_dicts(self._ft_has, deepcopy(self._ft_has_default))
    if exchange_config.get("_ft_has_params"):
        self._ft_has = deep_merge_dicts(
            exchange_config.get("_ft_has_params"), self._ft_has
        )
        logger.info(
            "Overriding exchange._ft_has with config params, result: %s", self._ft_has
        )

    # Assign this directly for easy access
    self._ohlcv_candle_limit = self._ft_has["ohlcv_candle_limit"]
    self._ohlcv_partial_candle = self._ft_has["ohlcv_partial_candle"]

    self._trades_pagination = self._ft_has["trades_pagination"]
    self._trades_pagination_arg = self._ft_has["trades_pagination_arg"]

    # Initialize ccxt objects
    ccxt_config = self._ccxt_config.copy()
    ccxt_config = deep_merge_dicts(exchange_config.get("ccxt_config", {}), ccxt_config)
    self._api = self._init_ccxt(exchange_config, ccxt_kwargs=ccxt_config)

    ccxt_async_config = self._ccxt_config.copy()
    ccxt_async_config = deep_merge_dicts(
        exchange_config.get("ccxt_async_config", {}), ccxt_async_config
    )
    self._api_async = self._init_ccxt(
        exchange_config, ccxt_async, ccxt_kwargs=ccxt_async_config
    )

    logger.info('Using Exchange "%s"', self.name)

    if validate:
        # Check if timeframe is available
        self.validate_timeframes(config.get("ticker_interval"))

        # Initial markets load
        self._load_markets()

        # Check if all pairs are available
        self.validate_stakecurrency(config["stake_currency"])
        self.validate_pairs(config["exchange"]["pair_whitelist"])
        self.validate_ordertypes(config.get("order_types", {}))
        self.validate_order_time_in_force(config.get("order_time_in_force", {}))
        self.validate_required_startup_candles(config.get("startup_candle_count", 0))

    # Converts the interval provided in minutes in config to seconds
    self.markets_refresh_interval: int = (
        exchange_config.get("markets_refresh_interval", 60) * 60
    )


# Traceback (Exception)
2020-02-20 22:47:28,025 - freqtrade - ERROR - Fatal exception!
Traceback (most recent call last):
File "/opt/tradebot/freqtrade/.env/lib/python3.7/site-packages/talib/__init__.py", line 20, in wrapper
for arg in chain(args, kwargs.values())
StopIteration

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/freqtrade/freqtrade/main.py", line 36, in main
return_code = args['func'](args)
File "/freqtrade/freqtrade/commands/optimize_commands.py", line 76, in start_hyperopt
hyperopt.start()
File "/freqtrade/freqtrade/optimize/hyperopt.py", line 488, in start
preprocessed = self.backtesting.strategy.tickerdata_to_dataframe(data)
File "/freqtrade/freqtrade/strategy/interface.py", line 448, in tickerdata_to_dataframe
for pair, pair_data in tickerdata.items()}
File "/freqtrade/freqtrade/strategy/interface.py", line 448, in <dictcomp>
for pair, pair_data in tickerdata.items()}
File "/freqtrade/freqtrade/strategy/interface.py", line 464, in advise_indicators
return self.populate_indicators(dataframe, metadata)
File "/freqtrade/user_data/strategies/MyDev.py", line 205, in populate_indicators
dataframe['mfi'] = ta.MFI(dataframe)
File "talib/_abstract.pxi", line 352, in talib._ta_lib.Function.__call__
File "talib/_abstract.pxi", line 383, in talib._ta_lib.Function.__call_function
File "/opt/tradebot/freqtrade/.env/lib/python3.7/site-packages/talib/__init__.py", line 24, in wrapper
return func(*args, **kwargs)
File "talib/_func.pxi", line 8454, in talib._ta_lib.MFI
Exception: volume is not double

# Fixed code
def __init__(self, config: Dict[str, Any], validate: bool = True) -> None:
    """
    Initializes this module with the given config,
    it does basic validation whether the specified exchange and pairs are valid.
    :return: None
    """
    self._api: ccxt.Exchange = None
    self._api_async: ccxt_async.Exchange = None

    self._config.update(config)

    # Holds last candle refreshed time of each pair
    self._pairs_last_refresh_time: Dict[Tuple[str, str], int] = {}
    # Timestamp of last markets refresh
    self._last_markets_refresh: int = 0

    # Holds candles
    self._klines: Dict[Tuple[str, str], DataFrame] = {}

    # Holds all open sell orders for dry_run
    self._dry_run_open_orders: Dict[str, Any] = {}

    if config["dry_run"]:
        logger.info("Instance is running with dry_run enabled")

    exchange_config = config["exchange"]

    # Deep merge ft_has with default ft_has options
    self._ft_has = deep_merge_dicts(self._ft_has, deepcopy(self._ft_has_default))
    if exchange_config.get("_ft_has_params"):
        self._ft_has = deep_merge_dicts(
            exchange_config.get("_ft_has_params"), self._ft_has
        )
        logger.info(
            "Overriding exchange._ft_has with config params, result: %s", self._ft_has
        )

    # Assign this directly for easy access
    self._ohlcv_candle_limit = self._ft_has["ohlcv_candle_limit"]
    self._ohlcv_partial_candle = self._ft_has["ohlcv_partial_candle"]

    self._trades_pagination = self._ft_has["trades_pagination"]
    self._trades_pagination_arg = self._ft_has["trades_pagination_arg"]

    # Initialize ccxt objects
    ccxt_config = self._ccxt_config.copy()
    ccxt_config = deep_merge_dicts(exchange_config.get("ccxt_config", {}), ccxt_config)
    self._api = self._init_ccxt(exchange_config, ccxt_kwargs=ccxt_config)

    ccxt_async_config = self._ccxt_config.copy()
    ccxt_async_config = deep_merge_dicts(
        exchange_config.get("ccxt_async_config", {}), ccxt_async_config
    )
    self._api_async = self._init_ccxt(
        exchange_config, ccxt_async, ccxt_kwargs=ccxt_async_config
    )

    logger.info('Using Exchange "%s"', self.name)

    if validate:
        # Check if timeframe is available
        self.validate_timeframes(config.get("ticker_interval"))

        # Initial markets load
        self._load_markets()

        # Check if all pairs are available
        self.validate_stakecurrency(config["stake_currency"])
        self.validate_pairs(config["exchange"]["pair_whitelist"])
        self.validate_ordertypes(config.get("order_types", {}))
        self.validate_order_time_in_force(config.get("order_time_in_force", {}))
        self.validate_required_startup_candles(config.get("startup_candle_count", 0))

    # Converts the interval provided in minutes in config to seconds
    self.markets_refresh_interval: int = (
        exchange_config.get("markets_refresh_interval", 60) * 60
    )