Skip to content

Commit 3bc639a

Browse files
author
Joe Jevnik
committed
REL: 1.0.0
1 parent 9f614de commit 3bc639a

File tree

2 files changed

+66
-17
lines changed

2 files changed

+66
-17
lines changed

docs/source/whatsnew/1.0.0.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@ Development
22
-----------
33

44
:Release: 1.0.0
5-
:Date: TBD
6-
7-
.. warning::
8-
This release is still under active development. All changes listed are
9-
subject to change at any time.
5+
:Date: May 19, 2016
106

117

128
Highlights

zipline/api.pyi

Lines changed: 65 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -109,20 +109,20 @@ def future_chain(root_symbol, as_of_date=None):
109109
def future_symbol(symbol):
110110
"""Lookup a futures contract with a given symbol.
111111
112-
Parameters
113-
----------
114-
symbol : str
115-
The symbol of the desired contract.
112+
Parameters
113+
----------
114+
symbol : str
115+
The symbol of the desired contract.
116116
117-
Returns
118-
-------
119-
future : Future
120-
The future that trades with the name ``symbol``.
117+
Returns
118+
-------
119+
future : Future
120+
The future that trades with the name ``symbol``.
121121
122-
Raises
123-
------
124-
SymbolNotFound
125-
Raised when no contract named 'symbol' is found.
122+
Raises
123+
------
124+
SymbolNotFound
125+
Raised when no contract named 'symbol' is found.
126126
"""
127127

128128
def get_datetime(tz=None):
@@ -208,6 +208,10 @@ def order(asset, amount, limit_price=None, stop_price=None, style=None):
208208
The amount of shares to order. If ``amount`` is positive, this is
209209
the number of shares to buy or cover. If ``amount`` is negative,
210210
this is the number of shares to sell or short.
211+
limit_price : float, optional
212+
The limit price for the order.
213+
stop_price : float, optional
214+
The stop price for the order.
211215
style : ExecutionStyle, optional
212216
The execution style for the order.
213217
@@ -216,6 +220,16 @@ def order(asset, amount, limit_price=None, stop_price=None, style=None):
216220
order_id : str
217221
The unique identifier for this order.
218222
223+
Notes
224+
-----
225+
The ``limit_price`` and ``stop_price`` arguments provide shorthands for
226+
passing common execution styles. Passing ``limit_price=N`` is
227+
equivalent to ``style=LimitOrder(N)``. Similarly, passing
228+
``stop_price=M`` is equivalent to ``style=StopOrder(M)``, and passing
229+
``limit_price=N`` and ``stop_price=M`` is equivalent to
230+
``style=StopLimitOrder(N, M)``. It is an error to pass both a ``style``
231+
and ``limit_price`` or ``stop_price``.
232+
219233
See Also
220234
--------
221235
:class:`zipline.finance.execution.ExecutionStyle`
@@ -234,6 +248,10 @@ def order_percent(asset, percent, limit_price=None, stop_price=None, style=None)
234248
percent : float
235249
The percentage of the porfolio value to allocate to ``asset``.
236250
This is specified as a decimal, for example: 0.50 means 50%.
251+
limit_price : float, optional
252+
The limit price for the order.
253+
stop_price : float, optional
254+
The stop price for the order.
237255
style : ExecutionStyle
238256
The execution style for the order.
239257
@@ -242,6 +260,11 @@ def order_percent(asset, percent, limit_price=None, stop_price=None, style=None)
242260
order_id : str
243261
The unique identifier for this order.
244262
263+
Notes
264+
-----
265+
See :func:`zipline.api.order` for more information about
266+
``limit_price``, ``stop_price``, and ``style``
267+
245268
See Also
246269
--------
247270
:class:`zipline.finance.execution.ExecutionStyle`
@@ -262,6 +285,10 @@ def order_target(asset, target, limit_price=None, stop_price=None, style=None):
262285
The asset that this order is for.
263286
target : int
264287
The desired number of shares of ``asset``.
288+
limit_price : float, optional
289+
The limit price for the order.
290+
stop_price : float, optional
291+
The stop price for the order.
265292
style : ExecutionStyle
266293
The execution style for the order.
267294
@@ -285,6 +312,9 @@ def order_target(asset, target, limit_price=None, stop_price=None, style=None):
285312
call to ``order_target`` will not have been filled when the second
286313
``order_target`` call is made.
287314
315+
See :func:`zipline.api.order` for more information about
316+
``limit_price``, ``stop_price``, and ``style``
317+
288318
See Also
289319
--------
290320
:class:`zipline.finance.execution.ExecutionStyle`
@@ -308,6 +338,10 @@ def order_target_percent(asset, target, limit_price=None, stop_price=None, style
308338
The desired percentage of the porfolio value to allocate to
309339
``asset``. This is specified as a decimal, for example:
310340
0.50 means 50%.
341+
limit_price : float, optional
342+
The limit price for the order.
343+
stop_price : float, optional
344+
The stop price for the order.
311345
style : ExecutionStyle
312346
The execution style for the order.
313347
@@ -330,6 +364,9 @@ def order_target_percent(asset, target, limit_price=None, stop_price=None, style
330364
because the first call to ``order_target_percent`` will not have been
331365
filled when the second ``order_target_percent`` call is made.
332366
367+
See :func:`zipline.api.order` for more information about
368+
``limit_price``, ``stop_price``, and ``style``
369+
333370
See Also
334371
--------
335372
:class:`zipline.finance.execution.ExecutionStyle`
@@ -353,6 +390,10 @@ def order_target_value(asset, target, limit_price=None, stop_price=None, style=N
353390
The asset that this order is for.
354391
target : float
355392
The desired total value of ``asset``.
393+
limit_price : float, optional
394+
The limit price for the order.
395+
stop_price : float, optional
396+
The stop price for the order.
356397
style : ExecutionStyle
357398
The execution style for the order.
358399
@@ -375,6 +416,9 @@ def order_target_value(asset, target, limit_price=None, stop_price=None, style=N
375416
call to ``order_target_value`` will not have been filled when the
376417
second ``order_target_value`` call is made.
377418
419+
See :func:`zipline.api.order` for more information about
420+
``limit_price``, ``stop_price``, and ``style``
421+
378422
See Also
379423
--------
380424
:class:`zipline.finance.execution.ExecutionStyle`
@@ -399,6 +443,10 @@ def order_value(asset, value, limit_price=None, stop_price=None, style=None):
399443
400444
value > 0 :: Buy/Cover
401445
value < 0 :: Sell/Short
446+
limit_price : float, optional
447+
The limit price for the order.
448+
stop_price : float, optional
449+
The stop price for the order.
402450
style : ExecutionStyle
403451
The execution style for the order.
404452
@@ -407,6 +455,11 @@ def order_value(asset, value, limit_price=None, stop_price=None, style=None):
407455
order_id : str
408456
The unique identifier for this order.
409457
458+
Notes
459+
-----
460+
See :func:`zipline.api.order` for more information about
461+
``limit_price``, ``stop_price``, and ``style``
462+
410463
See Also
411464
--------
412465
:class:`zipline.finance.execution.ExecutionStyle`

0 commit comments

Comments
 (0)