Undo changes
This commit is contained in:
parent
a50bde10de
commit
2eb33707c9
@ -137,12 +137,6 @@ class Configuration:
|
|||||||
setup_logging(config)
|
setup_logging(config)
|
||||||
|
|
||||||
def _process_trading_options(self, config: Dict[str, Any]) -> None:
|
def _process_trading_options(self, config: Dict[str, Any]) -> None:
|
||||||
|
|
||||||
# Allow_position_stacking defaults to False
|
|
||||||
if not config.get('allow_position_stacking'):
|
|
||||||
config['allow_position_stacking'] = False
|
|
||||||
logger.info('Allow_position_stacking is set to ' + str(config['allow_position_stacking']))
|
|
||||||
|
|
||||||
if config['runmode'] not in TRADING_MODES:
|
if config['runmode'] not in TRADING_MODES:
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -504,3 +498,4 @@ class Configuration:
|
|||||||
config['pairs'] = load_file(pairs_file)
|
config['pairs'] = load_file(pairs_file)
|
||||||
if 'pairs' in config:
|
if 'pairs' in config:
|
||||||
config['pairs'].sort()
|
config['pairs'].sort()
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ Freqtrade is the main module of this bot. It contains the class Freqtrade()
|
|||||||
import copy
|
import copy
|
||||||
import logging
|
import logging
|
||||||
import traceback
|
import traceback
|
||||||
from datetime import datetime, timedelta, timezone
|
from datetime import datetime, timezone
|
||||||
from math import isclose
|
from math import isclose
|
||||||
from threading import Lock
|
from threading import Lock
|
||||||
from typing import Any, Dict, List, Optional
|
from typing import Any, Dict, List, Optional
|
||||||
@ -359,8 +359,6 @@ class FreqtradeBot(LoggingMixin):
|
|||||||
logger.info("Active pair whitelist is empty.")
|
logger.info("Active pair whitelist is empty.")
|
||||||
return trades_created
|
return trades_created
|
||||||
# Remove pairs for currently opened trades from the whitelist
|
# Remove pairs for currently opened trades from the whitelist
|
||||||
# Allow rebuying of the same pair if allow_position_stacking is set to True
|
|
||||||
if not self.config['allow_position_stacking']:
|
|
||||||
for trade in Trade.get_open_trades():
|
for trade in Trade.get_open_trades():
|
||||||
if trade.pair in whitelist:
|
if trade.pair in whitelist:
|
||||||
whitelist.remove(trade.pair)
|
whitelist.remove(trade.pair)
|
||||||
@ -594,11 +592,6 @@ class FreqtradeBot(LoggingMixin):
|
|||||||
|
|
||||||
self._notify_enter(trade, order_type)
|
self._notify_enter(trade, order_type)
|
||||||
|
|
||||||
# Lock pair for 1 timeframe duration to prevent immediate rebuys
|
|
||||||
if self.config['allow_position_stacking']:
|
|
||||||
self.strategy.lock_pair(trade.pair, datetime.now(timezone.utc) + timedelta(minutes=timeframe_to_minutes(self.config['timeframe'])),
|
|
||||||
reason='Prevent immediate rebuys')
|
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def _notify_enter(self, trade: Trade, order_type: str) -> None:
|
def _notify_enter(self, trade: Trade, order_type: str) -> None:
|
||||||
@ -1436,3 +1429,4 @@ class FreqtradeBot(LoggingMixin):
|
|||||||
return max(
|
return max(
|
||||||
min(valid_custom_price, max_custom_price_allowed),
|
min(valid_custom_price, max_custom_price_allowed),
|
||||||
min_custom_price_allowed)
|
min_custom_price_allowed)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user