diff --git a/docs/release-notes/zipline-0.8.0.md b/docs/release-notes/zipline-0.8.0.md index d6ff13d1..06d96b9d 100644 --- a/docs/release-notes/zipline-0.8.0.md +++ b/docs/release-notes/zipline-0.8.0.md @@ -78,10 +78,10 @@ data[security].stddev(3) > # take half of my available cash and buy AAPL order_percent('AAPL', 0.5, percent_of='cash') - > + > # rebalance my short position, as a percentage of my current short book order_target_percent('MSFT', 0.1, percent_of='shorts') - > + > # rebalance within a custom group of stocks tech_stocks = ('AAPL', 'MSFT', 'GOOGL') tech_filter = lambda p: p.sid in tech_stocks @@ -91,6 +91,8 @@ data[security].stddev(3) ### Major performance enhancements to history (by Dale Jung) [PR488](https://github.com/quantopian/zipline/commit/38e8d5214d46f089020703712dc6b3f4f6ee084d) +### Command line option to for printing algo to stdout (by Andrea D'Amore) [PR545](https://github.com/quantopian/zipline/pull/545) + ## Contributors The following people have contributed to this release, ordered by numbers of commit: @@ -112,4 +114,5 @@ The following people have contributed to this release, ordered by numbers of com 1 Mete Atamel 1 Nicholas Pezolano 1 Philipp Kosel + 1 Andrea D'Amore ``` diff --git a/scripts/run_algo.py b/scripts/run_algo.py index dc3cbcee..de657a77 100755 --- a/scripts/run_algo.py +++ b/scripts/run_algo.py @@ -22,5 +22,5 @@ from zipline.utils import parse_args, run_pipeline if __name__ == "__main__": logbook.StderrHandler().push_application() parsed = parse_args(sys.argv[1:]) - run_pipeline(print_algo=True, **parsed) + run_pipeline(**parsed) sys.exit(0) diff --git a/zipline/utils/cli.py b/zipline/utils/cli.py index ad9d58d1..cc75fd99 100644 --- a/zipline/utils/cli.py +++ b/zipline/utils/cli.py @@ -100,12 +100,17 @@ def parse_args(argv, ipython_mode=False): parser.add_argument('--start', '-s') parser.add_argument('--end', '-e') parser.add_argument('--capital_base') - parser.add_argument('--source', '-d') + parser.add_argument('--source', '-d', choices=('yahoo',)) parser.add_argument('--source_time_column', '-t') parser.add_argument('--symbols') parser.add_argument('--output', '-o') parser.add_argument('--metadata_path', '-m') parser.add_argument('--metadata_index', '-x') + parser.add_argument('--print-algo', '-p', dest='print_algo', + action='store_true') + parser.add_argument('--no-print-algo', '-q', dest='print_algo', + action='store_false') + if ipython_mode: parser.add_argument('--local_namespace', action='store_true')