Skip to content

Commit

Permalink
DOC: Replace run_algo.py in docs with zipline run
Browse files Browse the repository at this point in the history
  • Loading branch information
richafrank committed Aug 18, 2016
1 parent aae9f84 commit 9abf22a
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 26 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
50 changes: 28 additions & 22 deletions docs/notebooks/tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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: <current-time>]\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"
]
},
{
Expand Down Expand Up @@ -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"
]
},
{
Expand Down
6 changes: 3 additions & 3 deletions docs/source/beginner-tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9abf22a

Please sign in to comment.