Skip to content

Commit

Permalink
DOC: added documentation to get_orderbook API function and changed th…
Browse files Browse the repository at this point in the history
…e documentation in live trading regarding get_orderbook
  • Loading branch information
EmbarAlmog committed Oct 4, 2018
1 parent b6eafc1 commit 86587f0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions catalyst/exchange/exchange_algorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -1163,6 +1163,7 @@ def _get_orderbook(self, asset, order_type='all', limit=None):
def get_orderbook(self, asset, order_type='all', limit=None):
"""
Retrieve the orderbook for the given trading pair.
This function is supported only in live and paper trading modes.
Parameters
----------
Expand Down
11 changes: 6 additions & 5 deletions docs/source/live-trading.rst
Original file line number Diff line number Diff line change
Expand Up @@ -243,15 +243,16 @@ these modes in the future with live mode).
Advanced Options
^^^^^^^^^^^^^^^^

In live and paper mode, in addition to the OHLCV data, the order book information is accessible as well.
By running the following code, a dictionary representing the order book in depth of 10 for `etc_btc` in Bitfinex will
be returned:
In live and paper mode, in addition to the OHLCV data, the order book information is accessible as well,
by running
`get_orderbook API function <https://enigma.co/catalyst/appendix.html#catalyst.api.get_orderbook>`_.
For example:

.. code-block:: bash
context.exchanges['bitfinex'].get_orderbook(symbol('etc_btc'), order_type='all', limit=10)
get_orderbook(symbol('etc_btc'), order_type='all', limit=10)
The following example returns a dictionary representing the order book in depth of 10 for `etc_btc` in Bitfinex.
It is possible to retrieve only the bids or the asks from the order book by
passing ``'bids'`` or ``'asks'`` in the ``order_type`` argument
(by default this parameter receives the ``'all'`` value).

0 comments on commit 86587f0

Please sign in to comment.