freqtrade/freqtrade · error · ConfigurationError

Please migrate your time_in_force settings to use 'entry' an

Error message

Please migrate your time_in_force settings to use 'entry' and 'exit'.

What it means

order_time_in_force previously used 'buy'/'sell' keys; these were renamed to 'entry'/'exit'. In spot mode old keys are auto-migrated with a deprecation warning, but in futures/margin (non-spot trading_mode) the migration is refused and the config rejected, because leveraged trading requires unambiguous order semantics.

Source

Thrown at freqtrade/configuration/config_validation.py:225

                "DEPRECATED: "
                "Please use `order_book_top` instead of `order_book_min` and `order_book_max` "
                "for your `exit_pricing` configuration."
            )


def validate_migrated_strategy_settings(conf: dict[str, Any]) -> None:
    _validate_time_in_force(conf)
    _validate_order_types(conf)
    _validate_unfilledtimeout(conf)
    _validate_pricing_rules(conf)
    _strategy_settings(conf)


def _validate_time_in_force(conf: dict[str, Any]) -> None:
    time_in_force = conf.get("order_time_in_force", {})
    if "buy" in time_in_force or "sell" in time_in_force:
        if conf.get("trading_mode", TradingMode.SPOT) != TradingMode.SPOT:
            raise ConfigurationError(
                "Please migrate your time_in_force settings to use 'entry' and 'exit'."
            )
        else:
            logger.warning(
                "DEPRECATED: Using 'buy' and 'sell' for time_in_force is deprecated."
                "Please migrate your time_in_force settings to use 'entry' and 'exit'."
            )
            process_deprecated_setting(
                conf, "order_time_in_force", "buy", "order_time_in_force", "entry"
            )

            process_deprecated_setting(
                conf, "order_time_in_force", "sell", "order_time_in_force", "exit"
            )


def _validate_order_types(conf: dict[str, Any]) -> None:
    order_types = conf.get("order_types", {})

View on GitHub (pinned to 1c8edfe4d1)

Solutions

  1. Rename the keys: "order_time_in_force": {"entry": "gtc", "exit": "gtc"}
  2. Remove the old 'buy'/'sell' keys entirely — sensible defaults (gtc) apply if you have no custom values
  3. Check order_types and unfilledtimeout sections too: the same buy/sell wording is rejected in futures mode

Example fix

// before
"order_time_in_force": {"buy": "gtc", "sell": "gtc"}
// after
"order_time_in_force": {"entry": "gtc", "exit": "gtc"}
Defensive patterns

Strategy: validation

Validate before calling

LEGACY = {"buy": "entry", "sell": "exit"}
tif = conf.get("order_time_in_force", {})
if any(k in tif for k in LEGACY):
    if conf.get("trading_mode", "spot") != "spot":
        raise ValueError("Migrate order_time_in_force buy/sell keys before using futures mode")
    for old, new in LEGACY.items():
        if old in tif:
            tif[new] = tif.pop(old)

Prevention

When it happens

Trigger: Config with "order_time_in_force": {"buy": "gtc"} (or 'sell') and "trading_mode": "futures". In spot mode the same config only logs a DEPRECATED warning and migrates.

Common situations: User converts a working spot config to futures trading by flipping trading_mode and margin_mode, leaving the old buy/sell time-in-force keys in place.

Related errors


AI-assisted analysis of freqtrade/freqtrade@1c8edfe4d1 (2026-08-15). Data as JSON: /api/errors/9f8e7693589b57d1. Report an issue: GitHub.