Undo changes

This commit is contained in:
incrementby1 2021-10-27 15:58:41 +02:00
parent a50bde10de
commit 2eb33707c9
2 changed files with 7 additions and 18 deletions

View File

@ -137,12 +137,6 @@ class Configuration:
setup_logging(config)
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:
return
@ -504,3 +498,4 @@ class Configuration:
config['pairs'] = load_file(pairs_file)
if 'pairs' in config:
config['pairs'].sort()

View File

@ -4,7 +4,7 @@ Freqtrade is the main module of this bot. It contains the class Freqtrade()
import copy
import logging
import traceback
from datetime import datetime, timedelta, timezone
from datetime import datetime, timezone
from math import isclose
from threading import Lock
from typing import Any, Dict, List, Optional
@ -359,12 +359,10 @@ class FreqtradeBot(LoggingMixin):
logger.info("Active pair whitelist is empty.")
return trades_created
# 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():
if trade.pair in whitelist:
whitelist.remove(trade.pair)
logger.debug('Ignoring %s in pair whitelist', trade.pair)
for trade in Trade.get_open_trades():
if trade.pair in whitelist:
whitelist.remove(trade.pair)
logger.debug('Ignoring %s in pair whitelist', trade.pair)
if not whitelist:
logger.info("No currency pair in active pair whitelist, "
@ -594,11 +592,6 @@ class FreqtradeBot(LoggingMixin):
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
def _notify_enter(self, trade: Trade, order_type: str) -> None:
@ -1436,3 +1429,4 @@ class FreqtradeBot(LoggingMixin):
return max(
min(valid_custom_price, max_custom_price_allowed),
min_custom_price_allowed)