Repository: freqtrade/freqtrade

Issue:
error when running freqtrade with jsonschema==3.0.0a3
```
root@ghost# freqtrade
/usr/local/lib/python3.6/dist-packages/scikit_learn-0.20rc1-py3.6-linux-x86_64.egg/sklearn/externals/joblib/externals/cloudpickle/cloudpickle.py:47: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
  import imp
Fatal exception!
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/freqtrade-0.17.2-py3.6.egg/freqtrade/main.py", line 42, in main
    config = Configuration(args).get_config()
  File "/usr/local/lib/python3.6/dist-packages/freqtrade-0.17.2-py3.6.egg/freqtrade/configuration.py", line 252, in get_config
    self.config = self.load_config()
  File "/usr/local/lib/python3.6/dist-packages/freqtrade-0.17.2-py3.6.egg/freqtrade/configuration.py", line 46, in load_config
    config = self._load_config_file(self.args.config)
  File "/usr/local/lib/python3.6/dist-packages/freqtrade-0.17.2-py3.6.egg/freqtrade/configuration.py", line 84, in _load_config_file
    return self._validate_config(conf)
  File "/usr/local/lib/python3.6/dist-packages/freqtrade-0.17.2-py3.6.egg/freqtrade/configuration.py", line 235, in _validate_config
    validate(conf, constants.CONF_SCHEMA)
  File "/usr/local/lib/python3.6/dist-packages/jsonschema-3.0.0a2-py3.6.egg/jsonschema/validators.py", line 822, in validate
    cls.check_schema(schema)
  File "/usr/local/lib/python3.6/dist-packages/jsonschema-3.0.0a2-py3.6.egg/jsonschema/validators.py", line 244, in check_schema
    raise SchemaError.create_from(error)
jsonschema.exceptions.SchemaError: True is not of type 'number'

Failed validating 'type' in metaschema['properties']['properties']['additionalProperties']['properties']['exclusiveMaximum']:
    {'type': 'number'}

On schema['properties']['stoploss']['exclusiveMaximum']:
    True
```


Discussion:
You have a error in your configuration.
I think you need to lowercase "True" ... (in json it's "true") ... 

if that does not work, please share your configuration (remove API Keys first!!), we should be able to help you with that.

"True" ... (in json it's "true") ... <== where i can find that statement?
i have removed the api and still the same
The statement with "True" should be in your configuration file. 

If you are willing to post the config here (without api key's) it should be easier to identify the particular problem - as it allows me to copy/paste your configuration file and try to run the bot with it.
This is obviously a problem in config file. given we don't have config file after 4 days I consider the issue resolved.
```json
{
    "max_open_trades": 3,
    "stake_currency": "BTC",
    "stake_amount": 0.05,
    "fiat_display_currency": "USD",
    "ticker_interval" : "5m",
    "dry_run": true,
    "trailing_stop": false,
    "unfilledtimeout": {
        "buy": 10,
        "sell": 30
    },
    "bid_strategy": {
        "ask_last_balance": 0.0,
        "use_order_book": false,
        "order_book_top": 1,
        "check_depth_of_market": {
            "enabled": false,
            "bids_to_ask_delta": 1
        }
    },
    "ask_strategy":{
        "use_order_book": false,
        "order_book_min": 1,
        "order_book_max": 9
    },
    "exchange": {
        "name": "bittrex",
        "key": "",
        "secret": "",
        "ccxt_rate_limit": true,
        "pair_whitelist": [
            "ETH/BTC",
            "LTC/BTC",
            "ETC/BTC",
            "DASH/BTC",
            "ZEC/BTC",
            "XLM/BTC",
            "NXT/BTC",
            "POWR/BTC",
            "ADA/BTC",
            "XMR/BTC"
        ],
        "pair_blacklist": [
            "DOGE/BTC"
        ]
    },
    "experimental": {
        "use_sell_signal": false,
        "sell_profit_only": false,
        "ignore_roi_if_buy_signal": false
    },
    "telegram": {
        "enabled": true,
        "token": "",
        "chat_id": ""
    },
    "initial_state": "running",
    "internals": {
        "process_throttle_secs": 5
    }
}
```
The configuration above is valid (once telegram-tokens are inserted).
are you still receiving the above error with this configuration?
yes i still have an error
i am running on centos vps
still the same error than the one at the top of this issue?
yes sir
i installed on my ubuntu, they have the same error
Your configuration (as is above) does work for me just fine.

please try to run the bot with the default config (no changes):
``` bash
python3 freqtrade --config config.json.example 
```

this should work fine (it starts the bot in dry-mode - without telegram enabled).
```neo@ghost:~/freqtrade$ python3 freqtrade --config config.json.example
/usr/local/lib/python3.6/dist-packages/scikit_learn-0.20rc1-py3.6-linux-x86_64.egg/sklearn/externals/joblib/externals/cloudpickle/cloudpickle.py:47: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
  import imp
Fatal exception!
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/freqtrade-0.17.2-py3.6.egg/freqtrade/main.py", line 42, in main
    config = Configuration(args).get_config()
  File "/usr/local/lib/python3.6/dist-packages/freqtrade-0.17.2-py3.6.egg/freqtrade/configuration.py", line 252, in get_config
    self.config = self.load_config()
  File "/usr/local/lib/python3.6/dist-packages/freqtrade-0.17.2-py3.6.egg/freqtrade/configuration.py", line 46, in load_config
    config = self._load_config_file(self.args.config)
  File "/usr/local/lib/python3.6/dist-packages/freqtrade-0.17.2-py3.6.egg/freqtrade/configuration.py", line 84, in _load_config_file
    return self._validate_config(conf)
  File "/usr/local/lib/python3.6/dist-packages/freqtrade-0.17.2-py3.6.egg/freqtrade/configuration.py", line 235, in _validate_config
    validate(conf, constants.CONF_SCHEMA)
  File "/usr/local/lib/python3.6/dist-packages/jsonschema-3.0.0a2-py3.6.egg/jsonschema/validators.py", line 822, in validate
    cls.check_schema(schema)
  File "/usr/local/lib/python3.6/dist-packages/jsonschema-3.0.0a2-py3.6.egg/jsonschema/validators.py", line 244, in check_schema
    raise SchemaError.create_from(error)
jsonschema.exceptions.SchemaError: False is not of type 'number'

Failed validating 'type' in metaschema['properties']['properties']['additionalProperties']['properties']['properties']['additionalProperties']['properties']['exclusiveMaximum']:
    {'type': 'number'}

On schema['properties']['bid_strategy']['properties']['ask_last_balance']['exclusiveMaximum']:
```
this does not seem to make sense - i just tried this with the latest version and it does work with the default configuration.

what's the output of `git log --format="%H" -n 1`?


`neo@ghost:~/freqtrade$ git log --format="%H" -n 1
e1c9b77c4495fcc6e7ad86f4106ee7b14ae49dcd
`
can you give me youtube link how to install freqtrade on centos and ubuntu step by step
try sudo freqtrade?
unfortunately we don't have a youtube video on how to install freqtrade, and i honestly doubt the value of such videos as a written instruction normally shows the same thing in fewer time (and with copy/paste instructions).

the error you're getting suggests a problem with the configuration - however on a key you don't seem to have in the configuration you posted, which seems odd as i haven't seen this problem reported by anyone else.



I have the same issue, after migrating server. This is my config file:
```
{
  "max_open_trades": 99,
  "stake_currency": "BTC",
  "stake_amount": 0.0012,
  "fiat_display_currency": "USD",
  "ticker_interval": "5m",
  "dry_run": false,
  "trailing_stop": false,
  "trailing_stop_positive": 0.01,
  "trailing_stop_positive_offset": 0.02,
  "unfilledtimeout": {
    "buy": 10,
    "sell": 30
  },
  "bid_strategy": {
    "ask_last_balance": 0.0,
    "use_order_book": false,
    "order_book_top": 1,
    "check_depth_of_market": {
      "enabled": false,
      "bids_to_ask_delta": 1
    }
  },
  "ask_strategy": {
    "use_order_book": false,
    "order_book_min": 1,
    "order_book_max": 9
  },
  "exchange": {
    "name": "bittrex",
    "key": "",
    "secret": "",
    "ccxt_config": {
      "enableRateLimit": true
    },
    "ccxt_async_config": {
      "enableRateLimit": false
    },
    "pair_whitelist": [
      "LTC/BTC",
      "DASH/BTC",
      "NXT/BTC",
      "XMR/BTC",
      "XRP/BTC",
      "DOGE/BTC",
      "RDD/BTC",
      "OMG/BTC",
      "BCH/BTC",
      "ETC/BTC",
      "ADA/BTC",
      "NEO/BTC",
      "ETH/BTC",
      "CLOAK/BTC",
      "POWR/BTC",
      "TRX/BTC",
      "DGB/BTC"
    ],
    "pair_blacklist": [
      "TUSD/BTC",
      "OCN/BTC",
      "IHT/BTC",
      "KMD/BTC"
    ]
  },
  "experimental": {
    "use_sell_signal": true,
    "sell_profit_only": true,
    "ignore_roi_if_buy_signal": true
  },
  "edge": {
    "enabled": false,
    "process_throttle_secs": 3600,
    "calculate_since_number_of_days": 7,
    "total_capital_in_stake_currency": 0.5,
    "allowed_risk": 0.01,
    "stoploss_range_min": -0.01,
    "stoploss_range_max": -0.1,
    "stoploss_range_step": -0.01,
    "minimum_winrate": 0.60,
    "minimum_expectancy": 0.20,
    "min_trade_number": 10,
    "max_trade_duration_minute": 1440,
    "remove_pumps": false
  },
  "telegram": {
    "enabled": true,
    "token": "";
    "chat_id": ""
  },
  "initial_state": "running",
  "forcebuy_enable": false,
  "internals": {
    "process_throttle_secs": 5
  },
  "strategy": "Mike",
  "strategy_path": "user_data/"
}
```
After run this:
`.env/bin/python .env/bin/freqtrade --dynamic-whitelist 30 --config config.json`

And this is my output:

```
Fatal exception!
Traceback (most recent call last):
  File "/home/user/projects/freqtrade/.env/lib/python3.7/site-packages/freqtrade-0.17.3-py3.7.egg/freqtrade/main.py", line 42, in main
    config = Configuration(args).get_config()
  File "/home/user/projects/freqtrade/.env/lib/python3.7/site-packages/freqtrade-0.17.3-py3.7.egg/freqtrade/configuration.py", line 295, in get_config
    self.config = self.load_config()
  File "/home/user/projects/freqtrade/.env/lib/python3.7/site-packages/freqtrade-0.17.3-py3.7.egg/freqtrade/configuration.py", line 47, in load_config
    config = self._load_config_file(self.args.config)
  File "/home/user/projects/freqtrade/.env/lib/python3.7/site-packages/freqtrade-0.17.3-py3.7.egg/freqtrade/configuration.py", line 91, in _load_config_file
    return self._validate_config(conf)
  File "/home/user/projects/freqtrade/.env/lib/python3.7/site-packages/freqtrade-0.17.3-py3.7.egg/freqtrade/configuration.py", line 278, in _validate_config
    validate(conf, constants.CONF_SCHEMA)
  File "/home/user/projects/freqtrade/.env/lib/python3.7/site-packages/jsonschema-3.0.0a3-py3.7.egg/jsonschema/validators.py", line 860, in validate
    cls.check_schema(schema)
  File "/home/user/projects/freqtrade/.env/lib/python3.7/site-packages/jsonschema-3.0.0a3-py3.7.egg/jsonschema/validators.py", line 250, in check_schema
    raise SchemaError.create_from(error)
jsonschema.exceptions.SchemaError: True is not of type 'number'

Failed validating 'type' in metaschema['properties']['properties']['additionalProperties']['properties']['exclusiveMaximum']:
    {'type': 'number'}

On schema['properties']['stoploss']['exclusiveMaximum']:
    True
```


Hi, how did you install the bot?
jsonschema seems to be an alpha-version (3.0.0a3) - and i can recreate the error when using that specific version.

seems like jsonschema changed something with "exclusiveMaximum" ... 
best thing i can tell you right now is to downgrade jsonschema to version 2.6.0 - that's how the bot was tested and is working.

will investigate though.

Related info for myself: https://json-schema.org/understanding-json-schema/reference/numeric.html

Resolving patch:
diff --git a/freqtrade/configuration.py b/freqtrade/configuration.py
--- a/freqtrade/configuration.py
+++ b/freqtrade/configuration.py
@@ -275,7 +275,7 @@ def _validate_config(self, conf: Dict[str, Any]) -> Dict[str, Any]:
         :return: Returns the config if valid, otherwise throw an exception
         """
         try:
-            validate(conf, constants.CONF_SCHEMA)
+            validate(conf, constants.CONF_SCHEMA, Draft4Validator)
             return conf
         except ValidationError as exception:
             logger.critical(


Test patch:
diff --git a/freqtrade/tests/test_configuration.py b/freqtrade/tests/test_configuration.py
--- a/freqtrade/tests/test_configuration.py
+++ b/freqtrade/tests/test_configuration.py
@@ -6,7 +6,7 @@
 from unittest.mock import MagicMock
 
 import pytest
-from jsonschema import validate, ValidationError
+from jsonschema import validate, ValidationError, Draft4Validator
 
 from freqtrade import constants
 from freqtrade import OperationalException
@@ -486,4 +486,4 @@ def test_load_config_warn_forcebuy(default_conf, mocker, caplog) -> None:
 
 
 def test_validate_default_conf(default_conf) -> None:
-    validate(default_conf, constants.CONF_SCHEMA)
+    validate(default_conf, constants.CONF_SCHEMA, Draft4Validator)