add --limit-max-trades

This commit is contained in:
gcarq
2017-11-23 00:25:06 +01:00
parent 02ca2ed585
commit 4a707d7452
3 changed files with 40 additions and 16 deletions

View File

@@ -150,6 +150,12 @@ def build_subcommands(parser: argparse.ArgumentParser) -> None:
type=int,
metavar='INT',
)
backtest.add_argument(
'--limit-max-trades',
help='uses max_open_trades from config to simulate real world limitations',
action='store_true',
dest='limit_max_trades',
)
def start_backtesting(args) -> None:
@@ -165,6 +171,7 @@ def start_backtesting(args) -> None:
'BACKTEST_LIVE': 'true' if args.live else '',
'BACKTEST_CONFIG': args.config,
'BACKTEST_TICKER_INTERVAL': str(args.ticker_interval),
'BACKTEST_LIMIT_MAX_TRADES': 'true' if args.limit_max_trades else '',
})
path = os.path.join(os.path.dirname(__file__), 'tests', 'test_backtesting.py')
pytest.main(['-s', path])