Repository: freqtrade/freqtrade

Issue:
Fiat convert not working
## Step 1: Have you search for this issue before posting it?

If you have discovered a bug in the bot, please [search our issue tracker](https://github.com/freqtrade/freqtrade/issues?q=is%3Aissue). 
If it hasn't been reported, please create a new issue.

## Step 2: Describe your environment

  * Operating system: ubuntu 18.04
  * Python Version: 3.6.9 (`python -V`)
  * CCXT version:  (`pip freeze | grep ccxt`)
  * Branch:  Develop
  * Last Commit ID: no git (`git log --format="%H" -n 1`)

asn1crypto==0.24.0
cryptography==2.1.4
enum34==1.1.6
idna==2.6
ipaddress==1.0.17
keyring==10.6.0
keyrings.alt==3.0
pycrypto==2.6.1
pygobject==3.26.1
pyxdg==0.25
SecretStorage==2.3.1
six==1.11.0
  
## Step 3: Describe the problem:

*Explain the problem you have encountered*

### Steps to reproduce:

  1. On my telegram bot I click `/daily` or any other function that included GBP
  
![image](https://user-images.githubusercontent.com/53098717/76038848-9a558e80-5f42-11ea-9832-f4fb99ceecf9.png)

All my currency values have changed to 0 or they have disapeared. This has happened for all functions that show currency values.  When i click `status table` the currency has disapeared entirely. 
  
### Observed Results:

  * What happened?
While on telegram all currency values have changed to 0 or disapeared. I have queried the trades in my database and things seem to be normal. However, I am not sure whether the database stores actual currency values or whether the crypto values are converted to GBP by the bot or extracted from binance. 
  * What did you expect to happen?
For the actual values to show.
### Relevant code exceptions or logs:

using docker so cant get logs

  ```
  // paste your log here
  ```



Discussion:
Please provide us with the logs from the following 2 timepoints:

a) when this bot did start up ... (for the first 1-5 minutes)
b) when you run the telegram command.


the most likely cause is a problem with coinmarktcap (again) - which we've had several times in the past, and usually a restart of the bot once their API recovers solves the problem.
Related historic issues: #2865, #2589
@xmatthias thank you. For future reference how do I access logs when using docker? Because none of my logs show on my terminal.
`docker logs freqtrade`?
`docker logs -f freqtrade` all entries + tail new logs
`docker logs --tail 100 -f freqtrade`   only the last 100 entries + tail new logs
@xmatthias 

Below are my logs:

  ```
2020-03-06 14:56:20,785 - freqtrade.loggers - INFO - Verbosity set to 0
2020-03-06 14:56:20,785 - freqtrade.configuration.configuration - INFO - Runmode set to live.
2020-03-06 14:56:20,786 - freqtrade.configuration.configuration - INFO - Dry run is disabled
2020-03-06 14:56:20,786 - freqtrade.configuration.configuration - INFO - Using DB: "sqlite:///tradesv3.sqlite"
2020-03-06 14:56:20,786 - freqtrade.configuration.configuration - INFO - Using max_open_trades: 15 ...
2020-03-06 14:56:20,786 - freqtrade.configuration.configuration - INFO - Using user-data directory: /freqtrade/user_data ...
2020-03-06 14:56:20,786 - freqtrade.configuration.configuration - INFO - Using data directory: /freqtrade/user_data/data/binance ...
2020-03-06 14:56:20,787 - freqtrade.configuration.check_exchange - INFO - Checking exchange...
2020-03-06 14:56:20,787 - freqtrade.configuration.check_exchange - INFO - Exchange "binance" is officially supported by the Freqtrade development team.
2020-03-06 14:56:20,787 - freqtrade.configuration.configuration - INFO - Using pairlist from configuration.
2020-03-06 14:56:20,787 - freqtrade.freqtradebot - INFO - Starting freqtrade develop
2020-03-06 14:56:20,843 - freqtrade.resolvers.iresolver - INFO - Using resolved strategy bbADXRSI from '/freqtrade/user_data/strategies/bbADXRSI.py'...
2020-03-06 14:56:20,844 - freqtrade.resolvers.strategy_resolver - INFO - Override strategy 'ticker_interval' with value in config file: 15m.
2020-03-06 14:56:20,844 - freqtrade.resolvers.strategy_resolver - INFO - Override strategy 'trailing_stop' with value in config file: True.
2020-03-06 14:56:20,844 - freqtrade.resolvers.strategy_resolver - INFO - Override strategy 'stake_currency' with value in config file: BTC.
2020-03-06 14:56:20,844 - freqtrade.resolvers.strategy_resolver - INFO - Override strategy 'stake_amount' with value in config file: 0.0055.
2020-03-06 14:56:20,844 - freqtrade.resolvers.strategy_resolver - INFO - Override strategy 'unfilledtimeout' with value in config file: {'buy': 10, 'sell': 30}.
2020-03-06 14:56:20,844 - freqtrade.resolvers.strategy_resolver - INFO - Override strategy 'use_sell_signal' with value in config file: True.
2020-03-06 14:56:20,844 - freqtrade.resolvers.strategy_resolver - INFO - Override strategy 'sell_profit_only' with value in config file: True.
2020-03-06 14:56:20,845 - freqtrade.resolvers.strategy_resolver - INFO - Override strategy 'ignore_roi_if_buy_signal' with value in config file: False.
2020-03-06 14:56:20,845 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using minimal_roi: {'4000': 0, '1440': 0.05, '800': 0.06, '600': 0.08}
2020-03-06 14:56:20,845 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using ticker_interval: 15m
2020-03-06 14:56:20,845 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using stoploss: -0.29
2020-03-06 14:56:20,845 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using trailing_stop: True
2020-03-06 14:56:20,845 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using trailing_stop_positive: 0.29018
2020-03-06 14:56:20,845 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using trailing_stop_positive_offset: 0.29555
2020-03-06 14:56:20,846 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using trailing_only_offset_is_reached: True
2020-03-06 14:56:20,846 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using process_only_new_candles: False
2020-03-06 14:56:20,846 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using order_types: {'buy': 'limit', 'sell': 'limit', 'stoploss': 'limit', 'stoploss_on_exchange': False}
2020-03-06 14:56:20,846 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using order_time_in_force: {'buy': 'gtc', 'sell': 'gtc'}
2020-03-06 14:56:20,846 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using stake_currency: BTC
2020-03-06 14:56:20,846 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using stake_amount: 0.0055
2020-03-06 14:56:20,846 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using startup_candle_count: 20
2020-03-06 14:56:20,846 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using unfilledtimeout: {'buy': 10, 'sell': 30}
2020-03-06 14:56:20,847 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using use_sell_signal: True
2020-03-06 14:56:20,847 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using sell_profit_only: True
2020-03-06 14:56:20,847 - freqtrade.resolvers.strategy_resolver - INFO - Strategy using ignore_roi_if_buy_signal: False
2020-03-06 14:56:20,847 - freqtrade.configuration.config_validation - INFO - Validating configuration ...
2020-03-06 14:56:20,849 - freqtrade.exchange.exchange - INFO - Applying additional ccxt config: {'enableRateLimit': True}
2020-03-06 14:56:20,853 - freqtrade.exchange.exchange - INFO - Applying additional ccxt config: {'enableRateLimit': True, 'rateLimit': 200}
2020-03-06 14:56:20,856 - freqtrade.exchange.exchange - INFO - Using Exchange "Binance"
2020-03-06 14:56:21,037 - freqtrade.resolvers.exchange_resolver - INFO - Using resolved exchange 'Binance'...
2020-03-06 14:56:21,374 - freqtrade.wallets - INFO - Wallets synced.
2020-03-06 14:56:21,380 - freqtrade.resolvers.iresolver - INFO - Using resolved pairlist StaticPairList from '/freqtrade/freqtrade/pairlist/StaticPairList.py'...
2020-03-06 14:56:21,380 - freqtrade.rpc.rpc_manager - INFO - Enabling rpc.telegram ...
2020-03-06 14:56:22,438 - freqtrade.rpc.telegram - INFO - rpc.telegram is listening for following commands: [['status'], ['profit'], ['balance'], ['start'], ['stop'], ['forcesell'], ['forcebuy'], ['performance'], ['daily'], ['count'], ['reload_conf'], ['show_config'], ['stopbuy'], ['whitelist'], ['blacklist'], ['edge'], ['help'], ['version']]
2020-03-06 14:56:22,564 - freqtrade.rpc.fiat_convert - ERROR - Could not load FIAT Cryptocurrency map for the following problem: KeyError
2020-03-06 14:56:22,565 - freqtrade.rpc.rpc_manager - INFO - Sending rpc message: {'type': status, 'status': 'running'}
2020-03-06 14:56:23,404 - freqtrade.worker - INFO - Changing state to: RUNNING
2020-03-06 14:56:23,404 - freqtrade.rpc.rpc_manager - INFO - Sending rpc message: {'type': custom, 'status': "*Exchange:* `binance`\n*Stake per trade:* `0.0055 BTC`\n*Minimum ROI:* `{'4000': 0, '1440': 0.05, '800': 0.06, '600': 0.08}`\n*Trailing Stoploss:* `-0.29`\n*Ticker Interval:* `15m`\n*Strategy:* `bbADXRSI`"}
2020-03-06 14:56:23,776 - freqtrade.rpc.rpc_manager - INFO - Sending rpc message: {'type': status, 'status': "Searching for BTC pairs to buy and sell based on [{'StaticPairList': 'StaticPairList'}]"}
2020-03-06 14:56:24,081 - freqtrade.persistence - INFO - Found open trade: Trade(id=46, pair=ETC/BTC, amount=5.85000000, open_rate=0.00094000, open_since=2020-03-04 06:15:13)
2020-03-06 14:56:24,081 - freqtrade.persistence - INFO - Found open trade: Trade(id=51, pair=ALGO/BTC, amount=124.00000000, open_rate=0.00004425, open_since=2020-03-05 06:15:13)
2020-03-06 14:56:24,081 - freqtrade.persistence - INFO - Found open trade: Trade(id=52, pair=KMD/BTC, amount=0.46000000, open_rate=0.00007140, open_since=2020-03-05 07:30:20)
2020-03-06 14:56:24,081 - freqtrade.persistence - INFO - Found open trade: Trade(id=53, pair=ATOM/BTC, amount=12.82000000, open_rate=0.00042880, open_since=2020-03-05 08:15:15)
2020-03-06 14:56:24,082 - freqtrade.persistence - INFO - Found open trade: Trade(id=59, pair=TRX/BTC, amount=2750.00000000, open_rate=0.00000200, open_since=2020-03-06 10:00:43)
2020-03-06 14:56:24,082 - freqtrade.persistence - INFO - Found open trade: Trade(id=60, pair=ONT/BTC, amount=68.32000000, open_rate=0.00008050, open_since=2020-03-06 13:30:18)
2020-03-06 14:56:27,545 - freqtrade.rpc.telegram - INFO - Executing handler: _status for chat_id: 1056836157
2020-03-06 14:56:27,545 - freqtrade.rpc.telegram - INFO - Executing handler: _status_table for chat_id: 1056836157
2020-03-06 14:56:27,558 - freqtrade.rpc.fiat_convert - WARNING - unsupported crypto-symbol BTC - returning 0.0
2020-03-06 14:56:29,335 - freqtrade.data.converter - INFO - Missing data fillup for HBAR/BTC: before: 499 - after: 507
2020-03-06 14:56:29,358 - freqtrade.data.converter - INFO - Missing data fillup for ADA/BTC: before: 499 - after: 507
2020-03-06 14:56:29,381 - freqtrade.data.converter - INFO - Missing data fillup for DASH/BTC: before: 499 - after: 507
2020-03-06 14:56:29,403 - freqtrade.data.converter - INFO - Missing data fillup for ALGO/BTC: before: 499 - after: 507
2020-03-06 14:56:29,426 - freqtrade.data.converter - INFO - Missing data fillup for LTC/BTC: before: 499 - after: 507
2020-03-06 14:56:29,448 - freqtrade.data.converter - INFO - Missing data fillup for XLM/BTC: before: 499 - after: 507
2020-03-06 14:56:29,471 - freqtrade.data.converter - INFO - Missing data fillup for XEM/BTC: before: 499 - after: 507
2020-03-06 14:56:29,493 - freqtrade.data.converter - INFO - Missing data fillup for ETC/BTC: before: 499 - after: 507
2020-03-06 14:56:29,516 - freqtrade.data.converter - INFO - Missing data fillup for BAT/BTC: before: 499 - after: 507
2020-03-06 14:56:29,538 - freqtrade.data.converter - INFO - Missing data fillup for BCH/BTC: before: 499 - after: 507
2020-03-06 14:56:29,563 - freqtrade.data.converter - INFO - Missing data fillup for XRP/BTC: before: 499 - after: 507
2020-03-06 14:56:29,586 - freqtrade.data.converter - INFO - Missing data fillup for ENJ/BTC: before: 499 - after: 507
2020-03-06 14:56:29,608 - freqtrade.data.converter - INFO - Missing data fillup for ATOM/BTC: before: 499 - after: 507
2020-03-06 14:56:29,630 - freqtrade.data.converter - INFO - Missing data fillup for ETH/BTC: before: 499 - after: 507
2020-03-06 14:56:29,653 - freqtrade.data.converter - INFO - Missing data fillup for NANO/BTC: before: 499 - after: 507
2020-03-06 14:56:29,675 - freqtrade.data.converter - INFO - Missing data fillup for NEO/BTC: before: 499 - after: 507
2020-03-06 14:56:29,697 - freqtrade.data.converter - INFO - Missing data fillup for NXS/BTC: before: 499 - after: 507
2020-03-06 14:56:29,720 - freqtrade.data.converter - INFO - Missing data fillup for XMR/BTC: before: 499 - after: 507
2020-03-06 14:56:29,743 - freqtrade.data.converter - INFO - Missing data fillup for LINK/BTC: before: 499 - after: 507
2020-03-06 14:56:29,765 - freqtrade.data.converter - INFO - Missing data fillup for ZEC/BTC: before: 499 - after: 507
2020-03-06 14:56:29,788 - freqtrade.data.converter - INFO - Missing data fillup for IOTA/BTC: before: 499 - after: 507
2020-03-06 14:56:29,810 - freqtrade.data.converter - INFO - Missing data fillup for KMD/BTC: before: 499 - after: 507
2020-03-06 14:56:29,832 - freqtrade.data.converter - INFO - Missing data fillup for TRX/BTC: before: 499 - after: 507
2020-03-06 14:56:29,855 - freqtrade.data.converter - INFO - Missing data fillup for QTUM/BTC: before: 499 - after: 507
2020-03-06 14:56:29,877 - freqtrade.data.converter - INFO - Missing data fillup for RVN/BTC: before: 499 - after: 507
2020-03-06 14:56:29,899 - freqtrade.data.converter - INFO - Missing data fillup for OMG/BTC: before: 499 - after: 507
2020-03-06 14:56:29,921 - freqtrade.data.converter - INFO - Missing data fillup for EOS/BTC: before: 499 - after: 507
2020-03-06 14:56:29,944 - freqtrade.data.converter - INFO - Missing data fillup for ONT/BTC: before: 499 - after: 507
2020-03-06 14:56:32,874 - freqtrade.worker - INFO - Bot heartbeat. PID=1, version='develop', state='RUNNING'
2020-03-06 14:56:33,854 - freqtrade.rpc.telegram - INFO - Executing handler: _daily for chat_id: 1056836157
2020-03-06 14:57:32,901 - freqtrade.worker - INFO - Bot heartbeat. PID=1, version='develop', state='RUNNING'
2020-03-06 14:58:32,929 - freqtrade.worker - INFO - Bot heartbeat. PID=1, version='develop', state='RUNNING'
  ```


The log is showing the issue is this:

`2020-03-06 14:56:27,558 - freqtrade.rpc.fiat_convert - WARNING - unsupported crypto-symbol BTC - returning 0.0` 


`coinmarketcap==5.0.3` isn't working anymore. See [this](https://pro.coinmarketcap.com/migrate/)

I switched to [CoinGecko](https://github.com/man-c/pycoingecko) 

I'm not using the last version of Freqtrade, but it looks really similar to mine, you could maybe use this, it's tested and working fine (feel free to put it in an MR):

fiat_convert.py:
```
"""
Module that define classes to convert Crypto-currency to FIAT
e.g BTC to USD
"""

import logging
import time
from typing import Dict, List

from pycoingecko import CoinGeckoAPI
from requests.exceptions import RequestException

from freqtrade.constants import SUPPORTED_FIAT

logger = logging.getLogger(__name__)


class CryptoFiat(object):
    """
    Object to describe what is the price of Crypto-currency in a FIAT
    """
    # Constants
    # 10 minutes
    CACHE_DURATION = 10 * 60

    def __init__(self, crypto_symbol: str, fiat_symbol: str, price: float) -> None:
        """
        Create an object that will contains the price for a crypto-currency in fiat
        :param crypto_symbol: Crypto-currency you want to convert (e.g BTC)
        :param fiat_symbol: FIAT currency you want to convert to (e.g USD)
        :param price: Price in FIAT
        """

        # Public attributes
        self.crypto_symbol = None
        self.fiat_symbol = None
        self.price = 0.0

        # Private attributes
        self._expiration = 0.0

        self.crypto_symbol = crypto_symbol.upper()
        self.fiat_symbol = fiat_symbol.upper()
        self.set_price(price=price)

    def set_price(self, price: float) -> None:
        """
        Set the price of the Crypto-currency in FIAT and set the expiration time
        :param price: Price of the current Crypto currency in the fiat
        :return: None
        """
        self.price = price
        self._expiration = time.time() + self.CACHE_DURATION

    def is_expired(self) -> bool:
        """
        Return if the current price is still valid or needs to be refreshed
        :return: bool, true the price is expired and needs to be refreshed, false the price is
         still valid
        """
        return self._expiration - time.time() <= 0


class CryptoToFiatConverter(object):
    """
    Main class to initiate Crypto to FIAT.
    This object contains a list of pair Crypto, FIAT
    This object is also a Singleton
    """
    __instance = None
    _coinmarketcap: CoinGeckoAPI = None

    _cryptomap: Dict = {}

    def __new__(cls):
        if CryptoToFiatConverter.__instance is None:
            CryptoToFiatConverter.__instance = object.__new__(cls)
            try:
                CryptoToFiatConverter._coinmarketcap = CoinGeckoAPI()
            except BaseException:
                CryptoToFiatConverter._coinmarketcap = CoinGeckoAPI()
        return CryptoToFiatConverter.__instance

    def __init__(self) -> None:
        logger.info("Init \'CryptoToFiatConverter\'.")
        self._pairs: List[CryptoFiat] = []
        self._load_cryptomap()
        logger.info("\'CryptoToFiatConverter\' initiated.")

    def _load_cryptomap(self) -> None:
        try:
            coinlistings = self._coinmarketcap.get_coins_list()
            self._cryptomap = dict(map(lambda coin: (coin["symbol"], str(coin["id"])),
                                       coinlistings))
        except (ValueError, RequestException) as exception:
            logger.error(
                "Could not load FIAT Cryptocurrency map for the following problem: %s",
                exception
            )

    def convert_amount(self, crypto_amount: float, crypto_symbol: str, fiat_symbol: str) -> float:
        """
        Convert an amount of crypto-currency to fiat
        :param crypto_amount: amount of crypto-currency to convert
        :param crypto_symbol: crypto-currency used
        :param fiat_symbol: fiat to convert to
        :return: float, value in fiat of the crypto-currency amount
        """
        if crypto_symbol == fiat_symbol:
            return crypto_amount
        price = self.get_price(crypto_symbol=crypto_symbol, fiat_symbol=fiat_symbol)
        return float(crypto_amount) * float(price)

    def get_price(self, crypto_symbol: str, fiat_symbol: str) -> float:
        """
        Return the price of the Crypto-currency in Fiat
        :param crypto_symbol: Crypto-currency you want to convert (e.g BTC)
        :param fiat_symbol: FIAT currency you want to convert to (e.g USD)
        :return: Price in FIAT
        """
        crypto_symbol = crypto_symbol.upper()
        fiat_symbol = fiat_symbol.upper()

        # Check if the fiat convertion you want is supported
        if not self._is_supported_fiat(fiat=fiat_symbol):
            raise ValueError(f'The fiat {fiat_symbol} is not supported.')

        # Get the pair that interest us and return the price in fiat
        for pair in self._pairs:
            if pair.crypto_symbol == crypto_symbol and pair.fiat_symbol == fiat_symbol:
                # If the price is expired we refresh it, avoid to call the API all the time
                if pair.is_expired():
                    pair.set_price(
                        price=self._find_price(
                            crypto_symbol=pair.crypto_symbol,
                            fiat_symbol=pair.fiat_symbol
                        )
                    )

                # return the last price we have for this pair
                return pair.price

        # The pair does not exist, so we create it and return the price
        return self._add_pair(
            crypto_symbol=crypto_symbol,
            fiat_symbol=fiat_symbol,
            price=self._find_price(
                crypto_symbol=crypto_symbol,
                fiat_symbol=fiat_symbol
            )
        )

    def _add_pair(self, crypto_symbol: str, fiat_symbol: str, price: float) -> float:
        """
        :param crypto_symbol: Crypto-currency you want to convert (e.g BTC)
        :param fiat_symbol: FIAT currency you want to convert to (e.g USD)
        :return: price in FIAT
        """
        self._pairs.append(
            CryptoFiat(
                crypto_symbol=crypto_symbol,
                fiat_symbol=fiat_symbol,
                price=price
            )
        )

        return price

    def _is_supported_fiat(self, fiat: str) -> bool:
        """
        Check if the FIAT your want to convert to is supported
        :param fiat: FIAT to check (e.g USD)
        :return: bool, True supported, False not supported
        """

        fiat = fiat.upper()

        return fiat in SUPPORTED_FIAT

    def _find_price(self, crypto_symbol: str, fiat_symbol: str) -> float:
        """
        Call CoinMarketCap API to retrieve the price in the FIAT
        :param crypto_symbol: Crypto-currency you want to convert (e.g BTC)
        :param fiat_symbol: FIAT currency you want to convert to (e.g USD)
        :return: float, price of the crypto-currency in Fiat
        """
        # Check if the fiat convertion you want is supported
        if not self._is_supported_fiat(fiat=fiat_symbol):
            raise ValueError(f'The fiat {fiat_symbol} is not supported.')

        # No need to convert if both crypto and fiat are the same
        if crypto_symbol == fiat_symbol:
            return 1.0

        crypto_symbol = crypto_symbol.lower()
        if crypto_symbol not in self._cryptomap:
            # return 0 for unsupported stake currencies (fiat-convert should not break the bot)
            logger.warning("resultfiat: unsupported crypto-symbol %s - returning 0.0", crypto_symbol)
            return 0.0

        try:
            return float(
                self._coinmarketcap.get_price(
                    self._cryptomap[crypto_symbol], fiat_symbol.lower())
                [self._cryptomap[crypto_symbol]][fiat_symbol.lower()]
            )
        except BaseException as exception:
            logger.error("Error in _find_price: %s", exception)
            return 0.0
```


No, i think it's the following right at startup.

`2020-03-06 14:56:22,564 - freqtrade.rpc.fiat_convert - ERROR - Could not load FIAT Cryptocurrency map for the following problem: KeyError`

the endpoint we use (https://api.coinmarketcap.com/v2/listings/) does return 
```
{"statusCode": 410,"error": "Gone","message": "WARNING: This API is now offline. Please switch to the new CoinMarketCap API. (https://pro.coinmarketcap.com/migrate/)"}
```

However - this behavior is not consistent - retrying from different ip addresses does seem to work on some, but not from others.

now the turnoff of the coinmarket api has been anounced for december 2018 ... but so far it always came back after approx. one day.

Switching to coingekko might be one possibility - but i'm not sure what FIAT currencies it supports- and there's other services out there too providing similar services.

Thank you all for the support. 

@xmatthias 
How would I get the new coinmarketcap API? 

Edited comment: It doesn't seem to be free. I will try CoinGeko and if that doesn't work I will just have to wait for another day and see if CoinMarketCap works.

@odemolliens
If I were to use CoinGeko would I only have to change the `fiat_convert.py` file? 
@odemolliens I copied and pasted the code you provided in a new file. However, it isn't working. Do I need to make any changes to the code or any other files?
well honestly, my recommendation is to wait until either coinmarketcap works again, or until we have decided on a different API / fiat convert provider.

The code above is untested - and running it is at your own risk without our support.

Remember that FIAT  conversation is an optional module for information purposes only - so while it may be slightly inconvenient not to have it active, it will not impact trading itself - and it can be intentionally disabled by removing the config option "fiat_currency" completely.
Thank you. Shall I leave this case open until it is working again and then notify you?
@King-Techno as mentionned earlier I don't use the last version of freqtrade. That's why you have issues I presume. Compare my file to yours and just adapt what is needed.

Resolving patch:
diff --git a/freqtrade/constants.py b/freqtrade/constants.py
--- a/freqtrade/constants.py
+++ b/freqtrade/constants.py
@@ -43,7 +43,7 @@
     "EUR", "GBP", "HKD", "HUF", "IDR", "ILS", "INR", "JPY",
     "KRW", "MXN", "MYR", "NOK", "NZD", "PHP", "PKR", "PLN",
     "RUB", "SEK", "SGD", "THB", "TRY", "TWD", "ZAR", "USD",
-    "BTC", "XBT", "ETH", "XRP", "LTC", "BCH", "USDT"
+    "BTC", "ETH", "XRP", "LTC", "BCH"
 ]
 
 MINIMAL_CONFIG = {
diff --git a/freqtrade/rpc/fiat_convert.py b/freqtrade/rpc/fiat_convert.py
--- a/freqtrade/rpc/fiat_convert.py
+++ b/freqtrade/rpc/fiat_convert.py
@@ -7,7 +7,7 @@
 import time
 from typing import Dict, List
 
-from coinmarketcap import Market
+from pycoingecko import CoinGeckoAPI
 
 from freqtrade.constants import SUPPORTED_FIAT
 
@@ -38,8 +38,8 @@ def __init__(self, crypto_symbol: str, fiat_symbol: str, price: float) -> None:
         # Private attributes
         self._expiration = 0.0
 
-        self.crypto_symbol = crypto_symbol.upper()
-        self.fiat_symbol = fiat_symbol.upper()
+        self.crypto_symbol = crypto_symbol.lower()
+        self.fiat_symbol = fiat_symbol.lower()
         self.set_price(price=price)
 
     def set_price(self, price: float) -> None:
@@ -67,17 +67,20 @@ class CryptoToFiatConverter:
     This object is also a Singleton
     """
     __instance = None
-    _coinmarketcap: Market = None
+    _coingekko: CoinGeckoAPI = None
 
     _cryptomap: Dict = {}
 
     def __new__(cls):
+        """
+        This class is a singleton - cannot be instantiated twice.
+        """
         if CryptoToFiatConverter.__instance is None:
             CryptoToFiatConverter.__instance = object.__new__(cls)
             try:
-                CryptoToFiatConverter._coinmarketcap = Market()
+                CryptoToFiatConverter._coingekko = CoinGeckoAPI()
             except BaseException:
-                CryptoToFiatConverter._coinmarketcap = None
+                CryptoToFiatConverter._coingekko = None
         return CryptoToFiatConverter.__instance
 
     def __init__(self) -> None:
@@ -86,14 +89,12 @@ def __init__(self) -> None:
 
     def _load_cryptomap(self) -> None:
         try:
-            coinlistings = self._coinmarketcap.listings()
-            self._cryptomap = dict(map(lambda coin: (coin["symbol"], str(coin["id"])),
-                                       coinlistings["data"]))
-        except (BaseException) as exception:
+            coinlistings = self._coingekko.get_coins_list()
+            # Create mapping table from synbol to coingekko_id
+            self._cryptomap = {x['symbol']: x['id'] for x in coinlistings}
+        except (Exception) as exception:
             logger.error(
-                "Could not load FIAT Cryptocurrency map for the following problem: %s",
-                type(exception).__name__
-            )
+                f"Could not load FIAT Cryptocurrency map for the following problem: {exception}")
 
     def convert_amount(self, crypto_amount: float, crypto_symbol: str, fiat_symbol: str) -> float:
         """
@@ -115,8 +116,8 @@ def get_price(self, crypto_symbol: str, fiat_symbol: str) -> float:
         :param fiat_symbol: FIAT currency you want to convert to (e.g USD)
         :return: Price in FIAT
         """
-        crypto_symbol = crypto_symbol.upper()
-        fiat_symbol = fiat_symbol.upper()
+        crypto_symbol = crypto_symbol.lower()
+        fiat_symbol = fiat_symbol.lower()
 
         # Check if the fiat convertion you want is supported
         if not self._is_supported_fiat(fiat=fiat_symbol):
@@ -170,15 +171,13 @@ def _is_supported_fiat(self, fiat: str) -> bool:
         :return: bool, True supported, False not supported
         """
 
-        fiat = fiat.upper()
-
-        return fiat in SUPPORTED_FIAT
+        return fiat.upper() in SUPPORTED_FIAT
 
     def _find_price(self, crypto_symbol: str, fiat_symbol: str) -> float:
         """
-        Call CoinMarketCap API to retrieve the price in the FIAT
-        :param crypto_symbol: Crypto-currency you want to convert (e.g BTC)
-        :param fiat_symbol: FIAT currency you want to convert to (e.g USD)
+        Call CoinGekko API to retrieve the price in the FIAT
+        :param crypto_symbol: Crypto-currency you want to convert (e.g btc)
+        :param fiat_symbol: FIAT currency you want to convert to (e.g usd)
         :return: float, price of the crypto-currency in Fiat
         """
         # Check if the fiat convertion you want is supported
@@ -195,12 +194,13 @@ def _find_price(self, crypto_symbol: str, fiat_symbol: str) -> float:
             return 0.0
 
         try:
+            _gekko_id = self._cryptomap[crypto_symbol]
             return float(
-                self._coinmarketcap.ticker(
-                    currency=self._cryptomap[crypto_symbol],
-                    convert=fiat_symbol
-                )['data']['quotes'][fiat_symbol.upper()]['price']
+                self._coingekko.get_price(
+                    ids=_gekko_id,
+                    vs_currencies=fiat_symbol
+                )[_gekko_id][fiat_symbol]
             )
-        except BaseException as exception:
+        except Exception as exception:
             logger.error("Error in _find_price: %s", exception)
             return 0.0
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -73,7 +73,7 @@
           'jsonschema',
           'TA-Lib',
           'tabulate',
-          'coinmarketcap',
+          'pycoingecko',
           'py_find_1st',
           'python-rapidjson',
           'sdnotify',


Test patch:
diff --git a/tests/conftest.py b/tests/conftest.py
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -167,23 +167,23 @@ def patch_get_signal(freqtrade: FreqtradeBot, value=(True, False)) -> None:
 
 
 @pytest.fixture(autouse=True)
-def patch_coinmarketcap(mocker) -> None:
+def patch_coingekko(mocker) -> None:
     """
-    Mocker to coinmarketcap to speed up tests
-    :param mocker: mocker to patch coinmarketcap class
+    Mocker to coingekko to speed up tests
+    :param mocker: mocker to patch coingekko class
     :return: None
     """
 
-    tickermock = MagicMock(return_value={'price_usd': 12345.0})
-    listmock = MagicMock(return_value={'data': [{'id': 1, 'name': 'Bitcoin', 'symbol': 'BTC',
-                                                 'website_slug': 'bitcoin'},
-                                                {'id': 1027, 'name': 'Ethereum', 'symbol': 'ETH',
-                                                 'website_slug': 'ethereum'}
-                                                ]})
+    tickermock = MagicMock(return_value={'bitcoin': {'usd': 12345.0}, 'ethereum': {'usd': 12345.0}})
+    listmock = MagicMock(return_value=[{'id': 'bitcoin', 'name': 'Bitcoin', 'symbol': 'btc',
+                                        'website_slug': 'bitcoin'},
+                                       {'id': 'ethereum', 'name': 'Ethereum', 'symbol': 'eth',
+                                        'website_slug': 'ethereum'}
+                                       ])
     mocker.patch.multiple(
-        'freqtrade.rpc.fiat_convert.Market',
-        ticker=tickermock,
-        listings=listmock,
+        'freqtrade.rpc.fiat_convert.CoinGeckoAPI',
+        get_price=tickermock,
+        get_coins_list=listmock,
 
     )
 
diff --git a/tests/rpc/test_fiat_convert.py b/tests/rpc/test_fiat_convert.py
--- a/tests/rpc/test_fiat_convert.py
+++ b/tests/rpc/test_fiat_convert.py
@@ -8,7 +8,7 @@
 from requests.exceptions import RequestException
 
 from freqtrade.rpc.fiat_convert import CryptoFiat, CryptoToFiatConverter
-from tests.conftest import log_has
+from tests.conftest import log_has, log_has_re
 
 
 def test_pair_convertion_object():
@@ -22,8 +22,8 @@ def test_pair_convertion_object():
     assert pair_convertion.CACHE_DURATION == 6 * 60 * 60
 
     # Check a regular usage
-    assert pair_convertion.crypto_symbol == 'BTC'
-    assert pair_convertion.fiat_symbol == 'USD'
+    assert pair_convertion.crypto_symbol == 'btc'
+    assert pair_convertion.fiat_symbol == 'usd'
     assert pair_convertion.price == 12345.0
     assert pair_convertion.is_expired() is False
 
@@ -57,15 +57,15 @@ def test_fiat_convert_add_pair(mocker):
     fiat_convert._add_pair(crypto_symbol='btc', fiat_symbol='usd', price=12345.0)
     pair_len = len(fiat_convert._pairs)
     assert pair_len == 1
-    assert fiat_convert._pairs[0].crypto_symbol == 'BTC'
-    assert fiat_convert._pairs[0].fiat_symbol == 'USD'
+    assert fiat_convert._pairs[0].crypto_symbol == 'btc'
+    assert fiat_convert._pairs[0].fiat_symbol == 'usd'
     assert fiat_convert._pairs[0].price == 12345.0
 
     fiat_convert._add_pair(crypto_symbol='btc', fiat_symbol='Eur', price=13000.2)
     pair_len = len(fiat_convert._pairs)
     assert pair_len == 2
-    assert fiat_convert._pairs[1].crypto_symbol == 'BTC'
-    assert fiat_convert._pairs[1].fiat_symbol == 'EUR'
+    assert fiat_convert._pairs[1].crypto_symbol == 'btc'
+    assert fiat_convert._pairs[1].fiat_symbol == 'eur'
     assert fiat_convert._pairs[1].price == 13000.2
 
 
@@ -100,15 +100,15 @@ def test_fiat_convert_get_price(mocker):
 
     fiat_convert = CryptoToFiatConverter()
 
-    with pytest.raises(ValueError, match=r'The fiat US DOLLAR is not supported.'):
-        fiat_convert.get_price(crypto_symbol='BTC', fiat_symbol='US Dollar')
+    with pytest.raises(ValueError, match=r'The fiat us dollar is not supported.'):
+        fiat_convert.get_price(crypto_symbol='btc', fiat_symbol='US Dollar')
 
     # Check the value return by the method
     pair_len = len(fiat_convert._pairs)
     assert pair_len == 0
-    assert fiat_convert.get_price(crypto_symbol='BTC', fiat_symbol='USD') == 28000.0
-    assert fiat_convert._pairs[0].crypto_symbol == 'BTC'
-    assert fiat_convert._pairs[0].fiat_symbol == 'USD'
+    assert fiat_convert.get_price(crypto_symbol='btc', fiat_symbol='usd') == 28000.0
+    assert fiat_convert._pairs[0].crypto_symbol == 'btc'
+    assert fiat_convert._pairs[0].fiat_symbol == 'usd'
     assert fiat_convert._pairs[0].price == 28000.0
     assert fiat_convert._pairs[0]._expiration != 0
     assert len(fiat_convert._pairs) == 1
@@ -116,13 +116,13 @@ def test_fiat_convert_get_price(mocker):
     # Verify the cached is used
     fiat_convert._pairs[0].price = 9867.543
     expiration = fiat_convert._pairs[0]._expiration
-    assert fiat_convert.get_price(crypto_symbol='BTC', fiat_symbol='USD') == 9867.543
+    assert fiat_convert.get_price(crypto_symbol='btc', fiat_symbol='usd') == 9867.543
     assert fiat_convert._pairs[0]._expiration == expiration
 
     # Verify the cache expiration
     expiration = time.time() - 2 * 60 * 60
     fiat_convert._pairs[0]._expiration = expiration
-    assert fiat_convert.get_price(crypto_symbol='BTC', fiat_symbol='USD') == 28000.0
+    assert fiat_convert.get_price(crypto_symbol='btc', fiat_symbol='usd') == 28000.0
     assert fiat_convert._pairs[0]._expiration is not expiration
 
 
@@ -143,15 +143,15 @@ def test_loadcryptomap(mocker):
     fiat_convert = CryptoToFiatConverter()
     assert len(fiat_convert._cryptomap) == 2
 
-    assert fiat_convert._cryptomap["BTC"] == "1"
+    assert fiat_convert._cryptomap["btc"] == "bitcoin"
 
 
 def test_fiat_init_network_exception(mocker):
     # Because CryptoToFiatConverter is a Singleton we reset the listings
     listmock = MagicMock(side_effect=RequestException)
     mocker.patch.multiple(
-        'freqtrade.rpc.fiat_convert.Market',
-        listings=listmock,
+        'freqtrade.rpc.fiat_convert.CoinGeckoAPI',
+        get_coins_list=listmock,
     )
     # with pytest.raises(RequestEsxception):
     fiat_convert = CryptoToFiatConverter()
@@ -163,24 +163,24 @@ def test_fiat_init_network_exception(mocker):
 
 
 def test_fiat_convert_without_network(mocker):
-    # Because CryptoToFiatConverter is a Singleton we reset the value of _coinmarketcap
+    # Because CryptoToFiatConverter is a Singleton we reset the value of _coingekko
 
     fiat_convert = CryptoToFiatConverter()
 
-    cmc_temp = CryptoToFiatConverter._coinmarketcap
-    CryptoToFiatConverter._coinmarketcap = None
+    cmc_temp = CryptoToFiatConverter._coingekko
+    CryptoToFiatConverter._coingekko = None
 
-    assert fiat_convert._coinmarketcap is None
-    assert fiat_convert._find_price(crypto_symbol='BTC', fiat_symbol='USD') == 0.0
-    CryptoToFiatConverter._coinmarketcap = cmc_temp
+    assert fiat_convert._coingekko is None
+    assert fiat_convert._find_price(crypto_symbol='btc', fiat_symbol='usd') == 0.0
+    CryptoToFiatConverter._coingekko = cmc_temp
 
 
 def test_fiat_invalid_response(mocker, caplog):
     # Because CryptoToFiatConverter is a Singleton we reset the listings
     listmock = MagicMock(return_value="{'novalidjson':DEADBEEFf}")
     mocker.patch.multiple(
-        'freqtrade.rpc.fiat_convert.Market',
-        listings=listmock,
+        'freqtrade.rpc.fiat_convert.CoinGeckoAPI',
+        get_coins_list=listmock,
     )
     # with pytest.raises(RequestEsxception):
     fiat_convert = CryptoToFiatConverter()
@@ -189,8 +189,8 @@ def test_fiat_invalid_response(mocker, caplog):
 
     length_cryptomap = len(fiat_convert._cryptomap)
     assert length_cryptomap == 0
-    assert log_has('Could not load FIAT Cryptocurrency map for the following problem: TypeError',
-                   caplog)
+    assert log_has_re('Could not load FIAT Cryptocurrency map for the following problem: .*',
+                      caplog)
 
 
 def test_convert_amount(mocker):
diff --git a/tests/rpc/test_rpc.py b/tests/rpc/test_rpc.py
--- a/tests/rpc/test_rpc.py
+++ b/tests/rpc/test_rpc.py
@@ -95,8 +95,8 @@ def test_rpc_trade_status(default_conf, ticker, fee, mocker) -> None:
 
 def test_rpc_status_table(default_conf, ticker, fee, mocker) -> None:
     mocker.patch.multiple(
-        'freqtrade.rpc.fiat_convert.Market',
-        ticker=MagicMock(return_value={'price_usd': 15000.0}),
+        'freqtrade.rpc.fiat_convert.CoinGeckoAPI',
+        get_price=MagicMock(return_value={'bitcoin': {'usd': 15000.0}}),
     )
     mocker.patch('freqtrade.rpc.rpc.CryptoToFiatConverter._find_price', return_value=15000.0)
     mocker.patch('freqtrade.rpc.telegram.Telegram', MagicMock())
@@ -178,7 +178,7 @@ def test_rpc_daily_profit(default_conf, update, ticker, fee,
                 day[1] == '0.00006217 BTC')
 
         assert (day[2] == '0.000 USD' or
-                day[2] == '0.933 USD')
+                day[2] == '0.767 USD')
     # ensure first day is current date
     assert str(days[0][0]) == str(datetime.utcnow().date())
 
@@ -190,8 +190,8 @@ def test_rpc_daily_profit(default_conf, update, ticker, fee,
 def test_rpc_trade_statistics(default_conf, ticker, ticker_sell_up, fee,
                               limit_buy_order, limit_sell_order, mocker) -> None:
     mocker.patch.multiple(
-        'freqtrade.rpc.fiat_convert.Market',
-        ticker=MagicMock(return_value={'price_usd': 15000.0}),
+        'freqtrade.rpc.fiat_convert.CoinGeckoAPI',
+        get_price=MagicMock(return_value={'bitcoin': {'usd': 15000.0}}),
     )
     mocker.patch('freqtrade.rpc.rpc.CryptoToFiatConverter._find_price', return_value=15000.0)
     mocker.patch('freqtrade.rpc.telegram.Telegram', MagicMock())
@@ -273,8 +273,8 @@ def test_rpc_trade_statistics(default_conf, ticker, ticker_sell_up, fee,
 def test_rpc_trade_statistics_closed(mocker, default_conf, ticker, fee,
                                      ticker_sell_up, limit_buy_order, limit_sell_order):
     mocker.patch.multiple(
-        'freqtrade.rpc.fiat_convert.Market',
-        ticker=MagicMock(return_value={'price_usd': 15000.0}),
+        'freqtrade.rpc.fiat_convert.CoinGeckoAPI',
+        get_price=MagicMock(return_value={'bitcoin': {'usd': 15000.0}}),
     )
     mocker.patch('freqtrade.rpc.fiat_convert.CryptoToFiatConverter._find_price',
                  return_value=15000.0)
@@ -341,8 +341,8 @@ def test_rpc_balance_handle_error(default_conf, mocker):
     # ETH will be skipped due to mocked Error below
 
     mocker.patch.multiple(
-        'freqtrade.rpc.fiat_convert.Market',
-        ticker=MagicMock(return_value={'price_usd': 15000.0}),
+        'freqtrade.rpc.fiat_convert.CoinGeckoAPI',
+        get_price=MagicMock(return_value={'bitcoin': {'usd': 15000.0}}),
     )
     mocker.patch('freqtrade.rpc.rpc.CryptoToFiatConverter._find_price', return_value=15000.0)
     mocker.patch('freqtrade.rpc.telegram.Telegram', MagicMock())
@@ -380,8 +380,8 @@ def test_rpc_balance_handle(default_conf, mocker, tickers):
     }
 
     mocker.patch.multiple(
-        'freqtrade.rpc.fiat_convert.Market',
-        ticker=MagicMock(return_value={'price_usd': 15000.0}),
+        'freqtrade.rpc.fiat_convert.CoinGeckoAPI',
+        get_price=MagicMock(return_value={'bitcoin': {'usd': 15000.0}}),
     )
     mocker.patch('freqtrade.rpc.rpc.CryptoToFiatConverter._find_price', return_value=15000.0)
     mocker.patch('freqtrade.rpc.telegram.Telegram', MagicMock())
diff --git a/tests/rpc/test_rpc_telegram.py b/tests/rpc/test_rpc_telegram.py
--- a/tests/rpc/test_rpc_telegram.py
+++ b/tests/rpc/test_rpc_telegram.py
@@ -1210,7 +1210,7 @@ def test_send_msg_buy_notification(default_conf, mocker) -> None:
            '*Amount:* `1333.33333333`\n' \
            '*Open Rate:* `0.00001099`\n' \
            '*Current Rate:* `0.00001099`\n' \
-           '*Total:* `(0.001000 BTC, 0.000 USD)`'
+           '*Total:* `(0.001000 BTC, 12.345 USD)`'
 
 
 def test_send_msg_buy_cancel_notification(default_conf, mocker) -> None: