remove use_custom_entry_price as a config option
This commit is contained in:
parent
16146357b3
commit
b3dafb378e
@ -480,7 +480,6 @@ class FreqtradeBot(LoggingMixin):
|
|||||||
else:
|
else:
|
||||||
# Calculate price
|
# Calculate price
|
||||||
buy_limit_requested = self.exchange.get_rate(pair, refresh=True, side="buy")
|
buy_limit_requested = self.exchange.get_rate(pair, refresh=True, side="buy")
|
||||||
if self.config.get('use_custom_entry_price', False):
|
|
||||||
custom_entry_price = strategy_safe_wrapper(self.strategy.custom_entry_price,
|
custom_entry_price = strategy_safe_wrapper(self.strategy.custom_entry_price,
|
||||||
default_retval=stake_amount)(
|
default_retval=stake_amount)(
|
||||||
pair=pair, current_time=datetime.now(timezone.utc),
|
pair=pair, current_time=datetime.now(timezone.utc),
|
||||||
|
@ -79,7 +79,6 @@ class StrategyResolver(IResolver):
|
|||||||
("trailing_stop_positive_offset", 0.0),
|
("trailing_stop_positive_offset", 0.0),
|
||||||
("trailing_only_offset_is_reached", None),
|
("trailing_only_offset_is_reached", None),
|
||||||
("use_custom_stoploss", None),
|
("use_custom_stoploss", None),
|
||||||
("use_custom_entry_price", None),
|
|
||||||
("process_only_new_candles", None),
|
("process_only_new_candles", None),
|
||||||
("order_types", None),
|
("order_types", None),
|
||||||
("order_time_in_force", None),
|
("order_time_in_force", None),
|
||||||
|
@ -129,7 +129,6 @@ class ShowConfig(BaseModel):
|
|||||||
trailing_stop_positive_offset: Optional[float]
|
trailing_stop_positive_offset: Optional[float]
|
||||||
trailing_only_offset_is_reached: Optional[bool]
|
trailing_only_offset_is_reached: Optional[bool]
|
||||||
use_custom_stoploss: Optional[bool]
|
use_custom_stoploss: Optional[bool]
|
||||||
use_custom_entry_price: Optional[bool]
|
|
||||||
timeframe: Optional[str]
|
timeframe: Optional[str]
|
||||||
timeframe_ms: int
|
timeframe_ms: int
|
||||||
timeframe_min: int
|
timeframe_min: int
|
||||||
|
@ -116,7 +116,6 @@ class RPC:
|
|||||||
'trailing_stop_positive_offset': config.get('trailing_stop_positive_offset'),
|
'trailing_stop_positive_offset': config.get('trailing_stop_positive_offset'),
|
||||||
'trailing_only_offset_is_reached': config.get('trailing_only_offset_is_reached'),
|
'trailing_only_offset_is_reached': config.get('trailing_only_offset_is_reached'),
|
||||||
'use_custom_stoploss': config.get('use_custom_stoploss'),
|
'use_custom_stoploss': config.get('use_custom_stoploss'),
|
||||||
'use_custom_entry_price': config.get('use_custom_entry_price'),
|
|
||||||
'bot_name': config.get('bot_name', 'freqtrade'),
|
'bot_name': config.get('bot_name', 'freqtrade'),
|
||||||
'timeframe': config.get('timeframe'),
|
'timeframe': config.get('timeframe'),
|
||||||
'timeframe_ms': timeframe_to_msecs(config['timeframe']
|
'timeframe_ms': timeframe_to_msecs(config['timeframe']
|
||||||
|
@ -288,7 +288,6 @@ class IStrategy(ABC, HyperStrategyMixin):
|
|||||||
For full documentation please go to https://www.freqtrade.io/en/latest/strategy-advanced/
|
For full documentation please go to https://www.freqtrade.io/en/latest/strategy-advanced/
|
||||||
|
|
||||||
When not implemented by a strategy, returns None, orderbook is used to set entry price
|
When not implemented by a strategy, returns None, orderbook is used to set entry price
|
||||||
Only called when use_custom_entry_price is set to True.
|
|
||||||
|
|
||||||
:param pair: Pair that's currently analyzed
|
:param pair: Pair that's currently analyzed
|
||||||
:param current_time: datetime object, containing the current datetime
|
:param current_time: datetime object, containing the current datetime
|
||||||
@ -662,8 +661,6 @@ class IStrategy(ABC, HyperStrategyMixin):
|
|||||||
:param low: Low value of this candle, only set in backtesting
|
:param low: Low value of this candle, only set in backtesting
|
||||||
:param high: High value of this candle, only set in backtesting
|
:param high: High value of this candle, only set in backtesting
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if self.use_custom_entry_price:
|
|
||||||
entry_price_value = strategy_safe_wrapper(self.custom_entry_price, default_retval=None)(
|
entry_price_value = strategy_safe_wrapper(self.custom_entry_price, default_retval=None)(
|
||||||
pair=pair,
|
pair=pair,
|
||||||
current_time=current_time,
|
current_time=current_time,
|
||||||
|
@ -908,7 +908,6 @@ def test_execute_buy(mocker, default_conf, fee, limit_buy_order, limit_buy_order
|
|||||||
def test_execute_buy_custom_entry_price(mocker, default_conf, fee, limit_buy_order_open) -> None:
|
def test_execute_buy_custom_entry_price(mocker, default_conf, fee, limit_buy_order_open) -> None:
|
||||||
patch_RPCManager(mocker)
|
patch_RPCManager(mocker)
|
||||||
patch_exchange(mocker)
|
patch_exchange(mocker)
|
||||||
default_conf.update({'use_custom_entry_price': True})
|
|
||||||
freqtrade = FreqtradeBot(default_conf)
|
freqtrade = FreqtradeBot(default_conf)
|
||||||
freqtrade.strategy.confirm_trade_entry = MagicMock(return_value=False)
|
freqtrade.strategy.confirm_trade_entry = MagicMock(return_value=False)
|
||||||
stake_amount = 3
|
stake_amount = 3
|
||||||
|
Loading…
Reference in New Issue
Block a user