From 9abf22ab3d777c400bc4bad3ec9f614cc37b3a9b Mon Sep 17 00:00:00 2001 From: Richard Frank Date: Wed, 17 Aug 2016 21:27:28 -0400 Subject: [PATCH] DOC: Replace run_algo.py in docs with zipline run --- README.rst | 2 +- docs/notebooks/tutorial.ipynb | 50 +++++++++++++++++-------------- docs/source/beginner-tutorial.rst | 6 ++-- 3 files changed, 32 insertions(+), 26 deletions(-) diff --git a/README.rst b/README.rst index eb2292ba..500bf29d 100644 --- a/README.rst +++ b/README.rst @@ -161,7 +161,7 @@ line, run: .. code:: bash - python run_algo.py -f dual_moving_average.py --symbols AAPL --start 2011-1-1 --end 2012-1-1 -o dma.pickle + zipline run -f dual_moving_average.py --symbols AAPL --start 2011-1-1 --end 2012-1-1 -o dma.pickle This will download the AAPL price data from Yahoo! Finance in the specified time range and stream it through the algorithm and save the diff --git a/docs/notebooks/tutorial.ipynb b/docs/notebooks/tutorial.ipynb index 5718eb12..beebd193 100644 --- a/docs/notebooks/tutorial.ipynb +++ b/docs/notebooks/tutorial.ipynb @@ -102,33 +102,39 @@ "name": "stdout", "output_type": "stream", "text": [ - "usage: run_algo.py [-h] [-c FILE] [--algofile ALGOFILE] [--data-frequency {minute,daily}] [--start START] [--end END]\r\n", - " [--capital_base CAPITAL_BASE] [--source {yahoo}] [--source_time_column SOURCE_TIME_COLUMN]\r\n", - " [--output OUTPUT] [--metadata_path METADATA_PATH] [--metadata_index METADATA_INDEX] [--print-algo] [--no-print-algo]\r\n", + "Usage: zipline run [OPTIONS]\r\n", "\r\n", - "Zipline version 0.8.0rc1.\r\n", + " Run a backtest for the given algorithm.\r\n", "\r\n", - "optional arguments:\r\n", - " -h, --help show this help message and exit\r\n", - " -c FILE, --conf_file FILE\r\n", - " Specify config file\r\n", - " --algofile ALGOFILE, -f ALGOFILE\r\n", - " --data-frequency {minute,daily}\r\n", - " --start START, -s START\r\n", - " --end END, -e END\r\n", - " --capital_base CAPITAL_BASE\r\n", - " --source {yahoo}, -d {yahoo}\r\n", - " --source_time_column SOURCE_TIME_COLUMN, -t SOURCE_TIME_COLUMN\r\n", - " --output OUTPUT, -o OUTPUT\r\n", - " --metadata_path METADATA_PATH, -m METADATA_PATH\r\n", - " --metadata_index METADATA_INDEX, -x METADATA_INDEX\r\n", - " --print-algo, -p\r\n", - " --no-print-algo, -q\r\n" + "Options:\r\n", + " -f, --algofile FILENAME The file that contains the algorithm to run.\r\n", + " -t, --algotext TEXT The algorithm script to run.\r\n", + " -D, --define TEXT Define a name to be bound in the namespace\r\n", + " before executing the algotext. For example\r\n", + " '-Dname=value'. The value may be any python\r\n", + " expression. These are evaluated in order so\r\n", + " they may refer to previously defined names.\r\n", + " --data-frequency [daily|minute]\r\n", + " The data frequency of the simulation.\r\n", + " [default: daily]\r\n", + " --capital-base FLOAT The starting capital for the simulation.\r\n", + " [default: 10000000.0]\r\n", + " -b, --bundle BUNDLE-NAME The data bundle to use for the simulation.\r\n", + " [default: quantopian-quandl]\r\n", + " --bundle-timestamp TIMESTAMP The date to lookup data on or before.\r\n", + " [default: ]\r\n", + " -s, --start DATE The start date of the simulation.\r\n", + " -e, --end DATE The end date of the simulation.\r\n", + " -o, --output FILENAME The location to write the perf data. If this\r\n", + " is '-' the perf will be written to stdout.\r\n", + " [default: -]\r\n", + " --print-algo / --no-print-algo Print the algorithm to stdout.\r\n", + " --help Show this message and exit.\r\n" ] } ], "source": [ - "!run_algo.py --help" + "!zipline run --help" ] }, { @@ -161,7 +167,7 @@ } ], "source": [ - "!run_algo.py -f ../../zipline/examples/buyapple.py --start 2000-1-1 --end 2014-1-1 -o buyapple_out.pickle" + "!zipline run -f ../../zipline/examples/buyapple.py --start 2000-1-1 --end 2014-1-1 -o buyapple_out.pickle" ] }, { diff --git a/docs/source/beginner-tutorial.rst b/docs/source/beginner-tutorial.rst index e6897ac3..66d22f31 100644 --- a/docs/source/beginner-tutorial.rst +++ b/docs/source/beginner-tutorial.rst @@ -122,11 +122,11 @@ on OSX): .. code-block:: bash - $ python -m zipline run --help + $ zipline run --help .. parsed-literal:: - Usage: __main__.py run [OPTIONS] + Usage: zipline run [OPTIONS] Run a backtest for the given algorithm. @@ -168,7 +168,7 @@ supply the command line args all the time (see the .conf files in the examples directory). Thus, to execute our algorithm from above and save the results to -``buyapple_out.pickle`` we would call ``python -m zipline run`` as follows: +``buyapple_out.pickle`` we would call ``zipline run`` as follows: .. code-block:: python