gurudesh/pytracebugs huggingface dataset:
# Buggy code
def sell(
    self, pair: str, ordertype: str, amount: float, rate: float, time_in_force="gtc"
) -> Dict:
    if self._config["dry_run"]:
        dry_order = self.dry_run_order(pair, ordertype, "sell", amount, rate)
        return dry_order

    params = self._params.copy()
    if time_in_force != "gtc" and ordertype != "market":
        params.update({"timeInForce": time_in_force})

    return self.create_order(pair, ordertype, "sell", amount, rate, params)


# 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 sell(
    self,
    pair: str,
    ordertype: str,
    amount: float,
    rate: float,
    time_in_force: str = "gtc",
) -> Dict:
    if self._config["dry_run"]:
        dry_order = self.dry_run_order(pair, ordertype, "sell", amount, rate)
        return dry_order

    params = self._params.copy()
    if time_in_force != "gtc" and ordertype != "market":
        params.update({"timeInForce": time_in_force})

    return self.create_order(pair, ordertype, "sell", amount, rate, params)
# Buggy code
def is_exchange_known_ccxt(exchange_name: str, ccxt_module=None) -> bool:
    return exchange_name in ccxt_exchanges(ccxt_module)


# 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 is_exchange_known_ccxt(
    exchange_name: str, ccxt_module: CcxtModuleType = None
) -> bool:
    return exchange_name in ccxt_exchanges(ccxt_module)
# Buggy code
def ccxt_exchanges(ccxt_module=None) -> List[str]:
    """
    Return the list of all exchanges known to ccxt
    """
    return ccxt_module.exchanges if ccxt_module is not None else ccxt.exchanges


# 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 ccxt_exchanges(ccxt_module: CcxtModuleType = None) -> List[str]:
    """
    Return the list of all exchanges known to ccxt
    """
    return ccxt_module.exchanges if ccxt_module is not None else ccxt.exchanges
# Buggy code
def available_exchanges(ccxt_module=None) -> List[str]:
    """
    Return exchanges available to the bot, i.e. non-bad exchanges in the ccxt list
    """
    exchanges = ccxt_exchanges(ccxt_module)
    return [x for x in exchanges if not is_exchange_bad(x)]


# 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 available_exchanges(ccxt_module: CcxtModuleType = None) -> List[str]:
    """
    Return exchanges available to the bot, i.e. non-bad exchanges in the ccxt list
    """
    exchanges = ccxt_exchanges(ccxt_module)
    return [x for x in exchanges if not is_exchange_bad(x)]
# Buggy code
def market_is_active(market):
    """
    Return True if the market is active.
    """
    # "It's active, if the active flag isn't explicitly set to false. If it's missing or
    # true then it's true. If it's undefined, then it's most likely true, but not 100% )"
    # See https://github.com/ccxt/ccxt/issues/4874,
    # https://github.com/ccxt/ccxt/issues/4075#issuecomment-434760520
    return market.get("active", True) is not False


# 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 market_is_active(market: Dict) -> bool:
    """
    Return True if the market is active.
    """
    # "It's active, if the active flag isn't explicitly set to false. If it's missing or
    # true then it's true. If it's undefined, then it's most likely true, but not 100% )"
    # See https://github.com/ccxt/ccxt/issues/4874,
    # https://github.com/ccxt/ccxt/issues/4075#issuecomment-434760520
    return market.get("active", True) is not False
# Buggy code
def _notify_buy(self, trade: Trade, order_type: str):
    """
    Sends rpc notification when a buy occured.
    """
    msg = {
        "type": RPCMessageType.BUY_NOTIFICATION,
        "exchange": self.exchange.name.capitalize(),
        "pair": trade.pair,
        "limit": trade.open_rate,
        "order_type": order_type,
        "stake_amount": trade.stake_amount,
        "stake_currency": self.config["stake_currency"],
        "fiat_currency": self.config.get("fiat_display_currency", None),
    }

    # Send the message
    self.rpc.send_msg(msg)


# 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 _notify_buy(self, trade: Trade, order_type: str) -> None:
    """
    Sends rpc notification when a buy occured.
    """
    msg = {
        "type": RPCMessageType.BUY_NOTIFICATION,
        "exchange": self.exchange.name.capitalize(),
        "pair": trade.pair,
        "limit": trade.open_rate,
        "order_type": order_type,
        "stake_amount": trade.stake_amount,
        "stake_currency": self.config["stake_currency"],
        "fiat_currency": self.config.get("fiat_display_currency", None),
        "amount": trade.amount,
        "open_date": trade.open_date or datetime.utcnow(),
        "current_rate": trade.open_rate_requested,
    }

    # Send the message
    self.rpc.send_msg(msg)
# Buggy code
def _check_and_execute_sell(
    self, trade: Trade, sell_rate: float, buy: bool, sell: bool
) -> bool:
    """
    Check and execute sell
    """
    should_sell = self.strategy.should_sell(
        trade,
        sell_rate,
        datetime.utcnow(),
        buy,
        sell,
        force_stoploss=self.edge.stoploss(trade.pair) if self.edge else 0,
    )

    if should_sell.sell_flag:
        self.execute_sell(trade, sell_rate, should_sell.sell_type)
        logger.info("executed sell, reason: %s", should_sell.sell_type)
        return True
    return False


# 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 _check_and_execute_sell(
    self, trade: Trade, sell_rate: float, buy: bool, sell: bool
) -> bool:
    """
    Check and execute sell
    """
    should_sell = self.strategy.should_sell(
        trade,
        sell_rate,
        datetime.utcnow(),
        buy,
        sell,
        force_stoploss=self.edge.stoploss(trade.pair) if self.edge else 0,
    )

    if should_sell.sell_flag:
        logger.info(f"Executing Sell for {trade.pair}. Reason: {should_sell.sell_type}")
        self.execute_sell(trade, sell_rate, should_sell.sell_type)
        return True
    return False
# Buggy code
def file_dump_json(filename: Path, data, is_zip=False) -> None:
    """
    Dump JSON data into a file
    :param filename: file to create
    :param data: JSON Data to save
    :return:
    """
    logger.info(f'dumping json to "{filename}"')

    if is_zip:
        if filename.suffix != ".gz":
            filename = filename.with_suffix(".gz")
        with gzip.open(filename, "w") as fp:
            rapidjson.dump(data, fp, default=str, number_mode=rapidjson.NM_NATIVE)
    else:
        with open(filename, "w") as fp:
            rapidjson.dump(data, fp, default=str, number_mode=rapidjson.NM_NATIVE)

    logger.debug(f'done json to "{filename}"')


# 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 file_dump_json(filename: Path, data: Any, is_zip: bool = False) -> None:
    """
    Dump JSON data into a file
    :param filename: file to create
    :param data: JSON Data to save
    :return:
    """

    if is_zip:
        if filename.suffix != ".gz":
            filename = filename.with_suffix(".gz")
        logger.info(f'dumping json to "{filename}"')

        with gzip.open(filename, "w") as fp:
            rapidjson.dump(data, fp, default=str, number_mode=rapidjson.NM_NATIVE)
    else:
        logger.info(f'dumping json to "{filename}"')
        with open(filename, "w") as fp:
            rapidjson.dump(data, fp, default=str, number_mode=rapidjson.NM_NATIVE)

    logger.debug(f'done json to "{filename}"')
# Buggy code
def json_load(datafile: IO):
    """
    load data with rapidjson
    Use this to have a consistent experience,
    sete number_mode to "NM_NATIVE" for greatest speed
    """
    return rapidjson.load(datafile, number_mode=rapidjson.NM_NATIVE)


# 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 json_load(datafile: IO) -> Any:
    """
    load data with rapidjson
    Use this to have a consistent experience,
    sete number_mode to "NM_NATIVE" for greatest speed
    """
    return rapidjson.load(datafile, number_mode=rapidjson.NM_NATIVE)
# Buggy code
def plural(num, singular: str, plural: str = None) -> str:
    return singular if (num == 1 or num == -1) else plural or singular + "s"


# 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 plural(num: float, singular: str, plural: str = None) -> str:
    return singular if (num == 1 or num == -1) else plural or singular + "s"
# Buggy code
def render_template(templatefile: str, arguments: dict = {}):
    from jinja2 import Environment, PackageLoader, select_autoescape

    env = Environment(
        loader=PackageLoader("freqtrade", "templates"),
        autoescape=select_autoescape(["html", "xml"]),
    )
    template = env.get_template(templatefile)

    return template.render(**arguments)


# 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 render_template(templatefile: str, arguments: dict = {}) -> str:
    from jinja2 import Environment, PackageLoader, select_autoescape

    env = Environment(
        loader=PackageLoader("freqtrade", "templates"),
        autoescape=select_autoescape(["html", "xml"]),
    )
    template = env.get_template(templatefile)
    return template.render(**arguments)
# Buggy code
def get_lock_filename(config) -> str:
    return str(config["user_data_dir"] / "hyperopt.lock")


# 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 get_lock_filename(config: Dict[str, Any]) -> str:
    return str(config["user_data_dir"] / "hyperopt.lock")
# Buggy code
def clean_hyperopt(self):
    """
    Remove hyperopt pickle files to restart hyperopt.
    """
    for f in [self.tickerdata_pickle, self.trials_file]:
        p = Path(f)
        if p.is_file():
            logger.info(f"Removing `{p}`.")
            p.unlink()


# 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 clean_hyperopt(self) -> None:
    """
    Remove hyperopt pickle files to restart hyperopt.
    """
    for f in [self.tickerdata_pickle, self.trials_file]:
        p = Path(f)
        if p.is_file():
            logger.info(f"Removing `{p}`.")
            p.unlink()
# Buggy code
def _read_trials(trials_file) -> List:
    """
    Read hyperopt trials file
    """
    logger.info("Reading Trials from '%s'", trials_file)
    trials = load(trials_file)
    return trials


# 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 _read_trials(trials_file: Path) -> List:
    """
    Read hyperopt trials file
    """
    logger.info("Reading Trials from '%s'", trials_file)
    trials = load(trials_file)
    return trials
# Buggy code
def _params_update_for_json(result_dict, params, space: str):
    if space in params:
        space_params = Hyperopt._space_params(params, space)
        if space in ["buy", "sell"]:
            result_dict.setdefault("params", {}).update(space_params)
        elif space == "roi":
            # Convert keys in min_roi dict to strings because
            # rapidjson cannot dump dicts with integer keys...
            # OrderedDict is used to keep the numeric order of the items
            # in the dict.
            result_dict["minimal_roi"] = OrderedDict(
                (str(k), v) for k, v in space_params.items()
            )
        else:  # 'stoploss', 'trailing'
            result_dict.update(space_params)


# 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 _params_update_for_json(result_dict, params, space: str) -> None:
    if space in params:
        space_params = Hyperopt._space_params(params, space)
        if space in ["buy", "sell"]:
            result_dict.setdefault("params", {}).update(space_params)
        elif space == "roi":
            # Convert keys in min_roi dict to strings because
            # rapidjson cannot dump dicts with integer keys...
            # OrderedDict is used to keep the numeric order of the items
            # in the dict.
            result_dict["minimal_roi"] = OrderedDict(
                (str(k), v) for k, v in space_params.items()
            )
        else:  # 'stoploss', 'trailing'
            result_dict.update(space_params)
# Buggy code
def _params_pretty_print(params, space: str, header: str):
    if space in params:
        space_params = Hyperopt._space_params(params, space, 5)
        if space == "stoploss":
            print(header, space_params.get("stoploss"))
        else:
            print(header)
            pprint(space_params, indent=4)


# 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 _params_pretty_print(params, space: str, header: str) -> None:
    if space in params:
        space_params = Hyperopt._space_params(params, space, 5)
        if space == "stoploss":
            print(header, space_params.get("stoploss"))
        else:
            print(header)
            pprint(space_params, indent=4)
# Buggy code
def is_best_loss(results, current_best_loss) -> bool:
    return results["loss"] < current_best_loss


# 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 is_best_loss(results, current_best_loss: float) -> bool:
    return results["loss"] < current_best_loss
# Buggy code
def load_previous_results(trials_file) -> List:
    """
    Load data for epochs from the file if we have one
    """
    trials: List = []
    if trials_file.is_file() and trials_file.stat().st_size > 0:
        trials = Hyperopt._read_trials(trials_file)
        if trials[0].get("is_best") is None:
            raise OperationalException(
                "The file with Hyperopt results is incompatible with this version "
                "of Freqtrade and cannot be loaded."
            )
        logger.info(f"Loaded {len(trials)} previous evaluations from disk.")
    return trials


# 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 load_previous_results(trials_file: Path) -> List:
    """
    Load data for epochs from the file if we have one
    """
    trials: List = []
    if trials_file.is_file() and trials_file.stat().st_size > 0:
        trials = Hyperopt._read_trials(trials_file)
        if trials[0].get("is_best") is None:
            raise OperationalException(
                "The file with Hyperopt results is incompatible with this version "
                "of Freqtrade and cannot be loaded."
            )
        logger.info(f"Loaded {len(trials)} previous evaluations from disk.")
    return trials
# Buggy code
def __init__(
    self, exchange, pairlistmanager, config, pairlistconfig: dict, pairlist_pos: int
) -> None:
    """
    :param exchange: Exchange instance
    :param pairlistmanager: Instanciating Pairlist manager
    :param config: Global bot configuration
    :param pairlistconfig: Configuration for this pairlist - can be empty.
    :param pairlist_pos: Position of the filter in the pairlist-filter-list
    """
    self._exchange = exchange
    self._pairlistmanager = pairlistmanager
    self._config = config
    self._pairlistconfig = pairlistconfig
    self._pairlist_pos = pairlist_pos


# 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,
    exchange,
    pairlistmanager,
    config: Dict[str, Any],
    pairlistconfig: Dict[str, Any],
    pairlist_pos: int,
) -> None:
    """
    :param exchange: Exchange instance
    :param pairlistmanager: Instanciating Pairlist manager
    :param config: Global bot configuration
    :param pairlistconfig: Configuration for this pairlist - can be empty.
    :param pairlist_pos: Position of the filter in the pairlist-filter-list
    """
    self._exchange = exchange
    self._pairlistmanager = pairlistmanager
    self._config = config
    self._pairlistconfig = pairlistconfig
    self._pairlist_pos = pairlist_pos
# Buggy code
def filter_pairlist(self, pairlist: List[str], tickers: Dict) -> List[str]:
    """
    Filters and sorts pairlists and assigns and returns them again.
    """
    stoploss = None
    if self._config.get("stoploss") is not None:
        # Precalculate sanitized stoploss value to avoid recalculation for every pair
        stoploss = 1 - abs(self._config.get("stoploss"))
    # Copy list since we're modifying this list
    for p in deepcopy(pairlist):
        ticker = tickers.get(p)
        # Filter out assets which would not allow setting a stoploss
        if not ticker or (
            stoploss and not self._validate_precision_filter(ticker, stoploss)
        ):
            pairlist.remove(p)
            continue

    return pairlist


# 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 filter_pairlist(self, pairlist: List[str], tickers: Dict) -> List[str]:
    """
    Filters and sorts pairlists and assigns and returns them again.
    """
    stoploss = self._config.get("stoploss")
    if stoploss is not None:
        # Precalculate sanitized stoploss value to avoid recalculation for every pair
        stoploss = 1 - abs(stoploss)
    # Copy list since we're modifying this list
    for p in deepcopy(pairlist):
        ticker = tickers.get(p)
        # Filter out assets which would not allow setting a stoploss
        if not ticker or (
            stoploss and not self._validate_precision_filter(ticker, stoploss)
        ):
            pairlist.remove(p)
            continue

    return pairlist