{"record":{"id":"9f8e7693589b57d1","repo":"freqtrade/freqtrade","slug":"please-migrate-your-time-in-force-settings-to-use","errorCode":null,"errorMessage":"Please migrate your time_in_force settings to use 'entry' and 'exit'.","messagePattern":"Please migrate your time_in_force settings to use 'entry' and 'exit'\\.","errorType":"exception","errorClass":"ConfigurationError","httpStatus":null,"severity":"error","filePath":"freqtrade/configuration/config_validation.py","lineNumber":225,"sourceCode":"                \"DEPRECATED: \"\n                \"Please use `order_book_top` instead of `order_book_min` and `order_book_max` \"\n                \"for your `exit_pricing` configuration.\"\n            )\n\n\ndef validate_migrated_strategy_settings(conf: dict[str, Any]) -> None:\n    _validate_time_in_force(conf)\n    _validate_order_types(conf)\n    _validate_unfilledtimeout(conf)\n    _validate_pricing_rules(conf)\n    _strategy_settings(conf)\n\n\ndef _validate_time_in_force(conf: dict[str, Any]) -> None:\n    time_in_force = conf.get(\"order_time_in_force\", {})\n    if \"buy\" in time_in_force or \"sell\" in time_in_force:\n        if conf.get(\"trading_mode\", TradingMode.SPOT) != TradingMode.SPOT:\n            raise ConfigurationError(\n                \"Please migrate your time_in_force settings to use 'entry' and 'exit'.\"\n            )\n        else:\n            logger.warning(\n                \"DEPRECATED: Using 'buy' and 'sell' for time_in_force is deprecated.\"\n                \"Please migrate your time_in_force settings to use 'entry' and 'exit'.\"\n            )\n            process_deprecated_setting(\n                conf, \"order_time_in_force\", \"buy\", \"order_time_in_force\", \"entry\"\n            )\n\n            process_deprecated_setting(\n                conf, \"order_time_in_force\", \"sell\", \"order_time_in_force\", \"exit\"\n            )\n\n\ndef _validate_order_types(conf: dict[str, Any]) -> None:\n    order_types = conf.get(\"order_types\", {})","sourceCodeStart":207,"sourceCodeEnd":243,"githubUrl":"https://github.com/freqtrade/freqtrade/blob/1c8edfe4d1e8d11bd4b40e8fc3237c26c3a60e15/freqtrade/configuration/config_validation.py#L207-L243","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Rename the keys: \"order_time_in_force\": {\"entry\": \"gtc\", \"exit\": \"gtc\"}","Remove the old 'buy'/'sell' keys entirely — sensible defaults (gtc) apply if you have no custom values","Check order_types and unfilledtimeout sections too: the same buy/sell wording is rejected in futures mode"],"exampleFix":"// before\n\"order_time_in_force\": {\"buy\": \"gtc\", \"sell\": \"gtc\"}\n// after\n\"order_time_in_force\": {\"entry\": \"gtc\", \"exit\": \"gtc\"}","handlingStrategy":"validation","validationCode":"LEGACY = {\"buy\": \"entry\", \"sell\": \"exit\"}\ntif = conf.get(\"order_time_in_force\", {})\nif any(k in tif for k in LEGACY):\n    if conf.get(\"trading_mode\", \"spot\") != \"spot\":\n        raise ValueError(\"Migrate order_time_in_force buy/sell keys before using futures mode\")\n    for old, new in LEGACY.items():\n        if old in tif:\n            tif[new] = tif.pop(old)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["When switching trading_mode to futures, run a keyword sweep for buy/sell/emergency/force in the config","Standardize all configs on entry/exit wording even for spot to avoid this class entirely"],"tags":["freqtrade","config","validation","time-in-force","migration","futures","deprecated"],"backgroundTag":null,"analyzedSha":"1c8edfe4d1e8d11bd4b40e8fc3237c26c3a60e15","analyzedAt":"2026-08-15T05:09:08.096Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}