TSL validator removed from exchange
This commit is contained in:
parent
29305dd070
commit
b5034cf535
@ -118,7 +118,6 @@ class Exchange(object):
|
|||||||
self.validate_pairs(config['exchange']['pair_whitelist'])
|
self.validate_pairs(config['exchange']['pair_whitelist'])
|
||||||
self.validate_ordertypes(config.get('order_types', {}))
|
self.validate_ordertypes(config.get('order_types', {}))
|
||||||
self.validate_order_time_in_force(config.get('order_time_in_force', {}))
|
self.validate_order_time_in_force(config.get('order_time_in_force', {}))
|
||||||
self.validate_trailing_stoploss(config)
|
|
||||||
|
|
||||||
if config.get('ticker_interval'):
|
if config.get('ticker_interval'):
|
||||||
# Check if timeframe is available
|
# Check if timeframe is available
|
||||||
@ -285,28 +284,6 @@ class Exchange(object):
|
|||||||
raise OperationalException(
|
raise OperationalException(
|
||||||
f'Time in force policies are not supporetd for {self.name} yet.')
|
f'Time in force policies are not supporetd for {self.name} yet.')
|
||||||
|
|
||||||
def validate_trailing_stoploss(self, config) -> None:
|
|
||||||
"""
|
|
||||||
Validates the trailing stoploss configuration
|
|
||||||
"""
|
|
||||||
# Skip if trailing stoploss is not activated
|
|
||||||
if not config.get('trailing_stop', False):
|
|
||||||
return
|
|
||||||
|
|
||||||
tsl_positive = float(config.get('trailing_stop_positive', 0))
|
|
||||||
tsl_offset = float(config.get('trailing_stop_positive_offset', 0))
|
|
||||||
tsl_only_offset = config.get('trailing_only_offset_is_reached', False)
|
|
||||||
|
|
||||||
if tsl_only_offset:
|
|
||||||
if tsl_positive == 0.0:
|
|
||||||
raise OperationalException(
|
|
||||||
f'The config trailing_only_offset_is_reached need '
|
|
||||||
'trailing_stop_positive_offset to be more than 0 in your config.')
|
|
||||||
if tsl_positive > 0 and 0 < tsl_offset <= tsl_positive:
|
|
||||||
raise OperationalException(
|
|
||||||
f'The config trailing_stop_positive_offset need '
|
|
||||||
'to be greater than trailing_stop_positive_offset in your config.')
|
|
||||||
|
|
||||||
def exchange_has(self, endpoint: str) -> bool:
|
def exchange_has(self, endpoint: str) -> bool:
|
||||||
"""
|
"""
|
||||||
Checks if exchange implements a specific API endpoint.
|
Checks if exchange implements a specific API endpoint.
|
||||||
|
Loading…
Reference in New Issue
Block a user