Switch to using config instead of args.
This commit is contained in:
@@ -692,20 +692,19 @@ AVAILABLE_CLI_OPTIONS = {
|
|||||||
),
|
),
|
||||||
"minimum_trade_amount": Arg(
|
"minimum_trade_amount": Arg(
|
||||||
'--minimum-trade-amount',
|
'--minimum-trade-amount',
|
||||||
help='set INT minimum trade amount',
|
help='Minimum trade amount for lookahead-analysis',
|
||||||
type=check_int_positive,
|
type=check_int_positive,
|
||||||
metavar='INT',
|
metavar='INT',
|
||||||
),
|
),
|
||||||
"targeted_trade_amount": Arg(
|
"targeted_trade_amount": Arg(
|
||||||
'--targeted-trade-amount',
|
'--targeted-trade-amount',
|
||||||
help='set INT targeted trade amount',
|
help='Targeted trade amount for lookahead analysis',
|
||||||
type=check_int_positive,
|
type=check_int_positive,
|
||||||
metavar='INT',
|
metavar='INT',
|
||||||
),
|
),
|
||||||
"lookahead_analysis_exportfilename": Arg(
|
"lookahead_analysis_exportfilename": Arg(
|
||||||
'--lookahead-analysis-exportfilename',
|
'--lookahead-analysis-exportfilename',
|
||||||
help="Use this filename to store lookahead-analysis-results",
|
help="Use this filename to store lookahead-analysis-results",
|
||||||
default=None,
|
|
||||||
type=str
|
type=str
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ def start_lookahead_analysis(args: Dict[str, Any]) -> None:
|
|||||||
if lookaheadAnalysis_instances:
|
if lookaheadAnalysis_instances:
|
||||||
LookaheadAnalysisSubFunctions.text_table_lookahead_analysis_instances(
|
LookaheadAnalysisSubFunctions.text_table_lookahead_analysis_instances(
|
||||||
lookaheadAnalysis_instances)
|
lookaheadAnalysis_instances)
|
||||||
if config['lookahead_analysis_exportfilename'] is not None:
|
if config.get('lookahead_analysis_exportfilename') is not None:
|
||||||
LookaheadAnalysisSubFunctions.export_to_csv(config, lookaheadAnalysis_instances)
|
LookaheadAnalysisSubFunctions.export_to_csv(config, lookaheadAnalysis_instances)
|
||||||
else:
|
else:
|
||||||
logger.error("There were no strategies specified neither through "
|
logger.error("There were no strategies specified neither through "
|
||||||
|
|||||||
@@ -479,6 +479,19 @@ class Configuration:
|
|||||||
self._args_to_config(config, argname='analysis_csv_path',
|
self._args_to_config(config, argname='analysis_csv_path',
|
||||||
logstring='Path to store analysis CSVs: {}')
|
logstring='Path to store analysis CSVs: {}')
|
||||||
|
|
||||||
|
self._args_to_config(config, argname='analysis_csv_path',
|
||||||
|
logstring='Path to store analysis CSVs: {}')
|
||||||
|
|
||||||
|
# Lookahead analysis results
|
||||||
|
self._args_to_config(config, argname='targeted_trade_amount',
|
||||||
|
logstring='Targeted Trade amount: {}')
|
||||||
|
|
||||||
|
self._args_to_config(config, argname='minimum_trade_amount',
|
||||||
|
logstring='Minimum Trade amount: {}')
|
||||||
|
|
||||||
|
self._args_to_config(config, argname='lookahead_analysis_exportfilename',
|
||||||
|
logstring='Path to store lookahead-analysis-results: {}')
|
||||||
|
|
||||||
def _process_runmode(self, config: Config) -> None:
|
def _process_runmode(self, config: Config) -> None:
|
||||||
|
|
||||||
self._args_to_config(config, argname='dry_run',
|
self._args_to_config(config, argname='dry_run',
|
||||||
|
|||||||
@@ -166,6 +166,7 @@ CONF_SCHEMA = {
|
|||||||
'reduce_df_footprint': {'type': 'boolean', 'default': False},
|
'reduce_df_footprint': {'type': 'boolean', 'default': False},
|
||||||
'minimum_trade_amount': {'type': 'number', 'default': 10},
|
'minimum_trade_amount': {'type': 'number', 'default': 10},
|
||||||
'targeted_trade_amount': {'type': 'number', 'default': 20},
|
'targeted_trade_amount': {'type': 'number', 'default': 20},
|
||||||
|
'lookahead_analysis_exportfilename': {'type': 'string'},
|
||||||
'liquidation_buffer': {'type': 'number', 'minimum': 0.0, 'maximum': 0.99},
|
'liquidation_buffer': {'type': 'number', 'minimum': 0.0, 'maximum': 0.99},
|
||||||
'backtest_breakdown': {
|
'backtest_breakdown': {
|
||||||
'type': 'array',
|
'type': 'array',
|
||||||
|
|||||||
Reference in New Issue
Block a user