From 3bc639ac674764f27281e3b6db007b999a374405 Mon Sep 17 00:00:00 2001 From: Joe Jevnik Date: Thu, 19 May 2016 20:35:07 -0400 Subject: [PATCH] REL: 1.0.0 --- docs/source/whatsnew/1.0.0.txt | 6 +-- zipline/api.pyi | 77 ++++++++++++++++++++++++++++------ 2 files changed, 66 insertions(+), 17 deletions(-) diff --git a/docs/source/whatsnew/1.0.0.txt b/docs/source/whatsnew/1.0.0.txt index d4a16de393..8a2c63693b 100644 --- a/docs/source/whatsnew/1.0.0.txt +++ b/docs/source/whatsnew/1.0.0.txt @@ -2,11 +2,7 @@ Development ----------- :Release: 1.0.0 -:Date: TBD - -.. warning:: - This release is still under active development. All changes listed are - subject to change at any time. +:Date: May 19, 2016 Highlights diff --git a/zipline/api.pyi b/zipline/api.pyi index 3a1f6ba79d..769306f6b7 100644 --- a/zipline/api.pyi +++ b/zipline/api.pyi @@ -109,20 +109,20 @@ def future_chain(root_symbol, as_of_date=None): def future_symbol(symbol): """Lookup a futures contract with a given symbol. - Parameters - ---------- - symbol : str - The symbol of the desired contract. + Parameters + ---------- + symbol : str + The symbol of the desired contract. - Returns - ------- - future : Future - The future that trades with the name ``symbol``. + Returns + ------- + future : Future + The future that trades with the name ``symbol``. - Raises - ------ - SymbolNotFound - Raised when no contract named 'symbol' is found. + Raises + ------ + SymbolNotFound + Raised when no contract named 'symbol' is found. """ def get_datetime(tz=None): @@ -208,6 +208,10 @@ def order(asset, amount, limit_price=None, stop_price=None, style=None): The amount of shares to order. If ``amount`` is positive, this is the number of shares to buy or cover. If ``amount`` is negative, this is the number of shares to sell or short. + limit_price : float, optional + The limit price for the order. + stop_price : float, optional + The stop price for the order. style : ExecutionStyle, optional The execution style for the order. @@ -216,6 +220,16 @@ def order(asset, amount, limit_price=None, stop_price=None, style=None): order_id : str The unique identifier for this order. + Notes + ----- + The ``limit_price`` and ``stop_price`` arguments provide shorthands for + passing common execution styles. Passing ``limit_price=N`` is + equivalent to ``style=LimitOrder(N)``. Similarly, passing + ``stop_price=M`` is equivalent to ``style=StopOrder(M)``, and passing + ``limit_price=N`` and ``stop_price=M`` is equivalent to + ``style=StopLimitOrder(N, M)``. It is an error to pass both a ``style`` + and ``limit_price`` or ``stop_price``. + See Also -------- :class:`zipline.finance.execution.ExecutionStyle` @@ -234,6 +248,10 @@ def order_percent(asset, percent, limit_price=None, stop_price=None, style=None) percent : float The percentage of the porfolio value to allocate to ``asset``. This is specified as a decimal, for example: 0.50 means 50%. + limit_price : float, optional + The limit price for the order. + stop_price : float, optional + The stop price for the order. style : ExecutionStyle The execution style for the order. @@ -242,6 +260,11 @@ def order_percent(asset, percent, limit_price=None, stop_price=None, style=None) order_id : str The unique identifier for this order. + Notes + ----- + See :func:`zipline.api.order` for more information about + ``limit_price``, ``stop_price``, and ``style`` + See Also -------- :class:`zipline.finance.execution.ExecutionStyle` @@ -262,6 +285,10 @@ def order_target(asset, target, limit_price=None, stop_price=None, style=None): The asset that this order is for. target : int The desired number of shares of ``asset``. + limit_price : float, optional + The limit price for the order. + stop_price : float, optional + The stop price for the order. style : ExecutionStyle The execution style for the order. @@ -285,6 +312,9 @@ def order_target(asset, target, limit_price=None, stop_price=None, style=None): call to ``order_target`` will not have been filled when the second ``order_target`` call is made. + See :func:`zipline.api.order` for more information about + ``limit_price``, ``stop_price``, and ``style`` + See Also -------- :class:`zipline.finance.execution.ExecutionStyle` @@ -308,6 +338,10 @@ def order_target_percent(asset, target, limit_price=None, stop_price=None, style The desired percentage of the porfolio value to allocate to ``asset``. This is specified as a decimal, for example: 0.50 means 50%. + limit_price : float, optional + The limit price for the order. + stop_price : float, optional + The stop price for the order. style : ExecutionStyle The execution style for the order. @@ -330,6 +364,9 @@ def order_target_percent(asset, target, limit_price=None, stop_price=None, style because the first call to ``order_target_percent`` will not have been filled when the second ``order_target_percent`` call is made. + See :func:`zipline.api.order` for more information about + ``limit_price``, ``stop_price``, and ``style`` + See Also -------- :class:`zipline.finance.execution.ExecutionStyle` @@ -353,6 +390,10 @@ def order_target_value(asset, target, limit_price=None, stop_price=None, style=N The asset that this order is for. target : float The desired total value of ``asset``. + limit_price : float, optional + The limit price for the order. + stop_price : float, optional + The stop price for the order. style : ExecutionStyle The execution style for the order. @@ -375,6 +416,9 @@ def order_target_value(asset, target, limit_price=None, stop_price=None, style=N call to ``order_target_value`` will not have been filled when the second ``order_target_value`` call is made. + See :func:`zipline.api.order` for more information about + ``limit_price``, ``stop_price``, and ``style`` + See Also -------- :class:`zipline.finance.execution.ExecutionStyle` @@ -399,6 +443,10 @@ def order_value(asset, value, limit_price=None, stop_price=None, style=None): value > 0 :: Buy/Cover value < 0 :: Sell/Short + limit_price : float, optional + The limit price for the order. + stop_price : float, optional + The stop price for the order. style : ExecutionStyle The execution style for the order. @@ -407,6 +455,11 @@ def order_value(asset, value, limit_price=None, stop_price=None, style=None): order_id : str The unique identifier for this order. + Notes + ----- + See :func:`zipline.api.order` for more information about + ``limit_price``, ``stop_price``, and ``style`` + See Also -------- :class:`zipline.finance.execution.ExecutionStyle`