mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-11-29 08:33:07 +00:00
refactor: move lookup dictionary outside of loop
This commit is contained in:
@@ -222,11 +222,11 @@ class HyperoptTools:
|
|||||||
all_spaces = list(params.keys() | non_optimized.keys())
|
all_spaces = list(params.keys() | non_optimized.keys())
|
||||||
spaces = ["buy", "sell", "protection", "roi", "stoploss", "trailing", "max_open_trades"]
|
spaces = ["buy", "sell", "protection", "roi", "stoploss", "trailing", "max_open_trades"]
|
||||||
spaces += [s for s in all_spaces if s not in spaces]
|
spaces += [s for s in all_spaces if s not in spaces]
|
||||||
|
lookup = {
|
||||||
|
"roi": "ROI",
|
||||||
|
"trailing": "Trailing stop",
|
||||||
|
}
|
||||||
for space in spaces:
|
for space in spaces:
|
||||||
lookup = {
|
|
||||||
"roi": "ROI",
|
|
||||||
"trailing": "Trailing stop",
|
|
||||||
}
|
|
||||||
name = lookup.get(
|
name = lookup.get(
|
||||||
space, space.capitalize() if space in HYPEROPT_BUILTIN_SPACES else space
|
space, space.capitalize() if space in HYPEROPT_BUILTIN_SPACES else space
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user