mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-09-20 01:21:11 +00:00
ruff format: remaining files
This commit is contained in:
parent
fea1653e31
commit
876a8f9e3e
|
@ -9,5 +9,5 @@ To launch Freqtrade as a module
|
||||||
from freqtrade import main
|
from freqtrade import main
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == "__main__":
|
||||||
main.main()
|
main.main()
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -3,6 +3,7 @@
|
||||||
Main Freqtrade bot script.
|
Main Freqtrade bot script.
|
||||||
Read the documentation to know what cli arguments you need.
|
Read the documentation to know what cli arguments you need.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import sys
|
import sys
|
||||||
from typing import Any, List, Optional
|
from typing import Any, List, Optional
|
||||||
|
@ -20,7 +21,7 @@ from freqtrade.loggers import setup_logging_pre
|
||||||
from freqtrade.util.gc_setup import gc_set_threshold
|
from freqtrade.util.gc_setup import gc_set_threshold
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger('freqtrade')
|
logger = logging.getLogger("freqtrade")
|
||||||
|
|
||||||
|
|
||||||
def main(sysargv: Optional[List[str]] = None) -> None:
|
def main(sysargv: Optional[List[str]] = None) -> None:
|
||||||
|
@ -36,10 +37,10 @@ def main(sysargv: Optional[List[str]] = None) -> None:
|
||||||
args = arguments.get_parsed_arg()
|
args = arguments.get_parsed_arg()
|
||||||
|
|
||||||
# Call subcommand.
|
# Call subcommand.
|
||||||
if 'func' in args:
|
if "func" in args:
|
||||||
logger.info(f'freqtrade {__version__}')
|
logger.info(f"freqtrade {__version__}")
|
||||||
gc_set_threshold()
|
gc_set_threshold()
|
||||||
return_code = args['func'](args)
|
return_code = args["func"](args)
|
||||||
else:
|
else:
|
||||||
# No subcommand was issued.
|
# No subcommand was issued.
|
||||||
raise OperationalException(
|
raise OperationalException(
|
||||||
|
@ -54,19 +55,21 @@ def main(sysargv: Optional[List[str]] = None) -> None:
|
||||||
except SystemExit as e: # pragma: no cover
|
except SystemExit as e: # pragma: no cover
|
||||||
return_code = e
|
return_code = e
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
logger.info('SIGINT received, aborting ...')
|
logger.info("SIGINT received, aborting ...")
|
||||||
return_code = 0
|
return_code = 0
|
||||||
except ConfigurationError as e:
|
except ConfigurationError as e:
|
||||||
logger.error(f"Configuration error: {e}\n"
|
logger.error(
|
||||||
f"Please make sure to review the documentation at {DOCS_LINK}.")
|
f"Configuration error: {e}\n"
|
||||||
|
f"Please make sure to review the documentation at {DOCS_LINK}."
|
||||||
|
)
|
||||||
except FreqtradeException as e:
|
except FreqtradeException as e:
|
||||||
logger.error(str(e))
|
logger.error(str(e))
|
||||||
return_code = 2
|
return_code = 2
|
||||||
except Exception:
|
except Exception:
|
||||||
logger.exception('Fatal exception!')
|
logger.exception("Fatal exception!")
|
||||||
finally:
|
finally:
|
||||||
sys.exit(return_code)
|
sys.exit(return_code)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__': # pragma: no cover
|
if __name__ == "__main__": # pragma: no cover
|
||||||
main()
|
main()
|
||||||
|
|
|
@ -64,7 +64,7 @@ class FreqaiExampleHybridStrategy(IStrategy):
|
||||||
# "120": 0.0, # exit after 120 minutes at break even
|
# "120": 0.0, # exit after 120 minutes at break even
|
||||||
"60": 0.01,
|
"60": 0.01,
|
||||||
"30": 0.02,
|
"30": 0.02,
|
||||||
"0": 0.04
|
"0": 0.04,
|
||||||
}
|
}
|
||||||
|
|
||||||
plot_config = {
|
plot_config = {
|
||||||
|
|
|
@ -53,7 +53,7 @@ class SampleStrategy(IStrategy):
|
||||||
# "120": 0.0, # exit after 120 minutes at break even
|
# "120": 0.0, # exit after 120 minutes at break even
|
||||||
"60": 0.01,
|
"60": 0.01,
|
||||||
"30": 0.02,
|
"30": 0.02,
|
||||||
"0": 0.04
|
"0": 0.04,
|
||||||
}
|
}
|
||||||
|
|
||||||
# Optimal stoploss designed for the strategy.
|
# Optimal stoploss designed for the strategy.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user