added liquidation_buffer to constants.py

This commit is contained in:
Sam Germain 2022-02-11 00:43:45 -06:00 committed by Matthias
parent 3c3675ea1a
commit fb3a6e2ce8
2 changed files with 1 additions and 4 deletions

View File

@ -156,6 +156,7 @@ CONF_SCHEMA = {
'ignore_buying_expired_candle_after': {'type': 'number'}, 'ignore_buying_expired_candle_after': {'type': 'number'},
'trading_mode': {'type': 'string', 'enum': TRADING_MODES}, 'trading_mode': {'type': 'string', 'enum': TRADING_MODES},
'margin_mode': {'type': 'string', 'enum': MARGIN_MODES}, 'margin_mode': {'type': 'string', 'enum': MARGIN_MODES},
'liquidation_buffer': {'type': 'number', 'minimum': 0.0, 'maximum': 0.99},
'backtest_breakdown': { 'backtest_breakdown': {
'type': 'array', 'type': 'array',
'items': {'type': 'string', 'enum': BACKTEST_BREAKDOWNS} 'items': {'type': 'string', 'enum': BACKTEST_BREAKDOWNS}

View File

@ -143,10 +143,6 @@ class Exchange:
else None else None
) )
self.liquidation_buffer = config.get('liquidation_buffer', 0.05) self.liquidation_buffer = config.get('liquidation_buffer', 0.05)
if self.liquidation_buffer < 0.0:
raise OperationalException('Cannot have a negative liquidation_buffer')
if self.liquidation_buffer > 0.99:
raise OperationalException('Liquidation_buffer must be below 0.99')
# Initialize ccxt objects # Initialize ccxt objects
ccxt_config = self._ccxt_config ccxt_config = self._ccxt_config