@@ -198,6 +198,24 @@ def get_environment(field='platform'):
198
198
Raised when ``field`` is not a valid option.
199
199
"""
200
200
201
+ def get_open_orders (asset = None ):
202
+ """Retrieve all of the current open orders.
203
+
204
+ Parameters
205
+ ----------
206
+ asset : Asset
207
+ If passed and not None, return only the open orders for the given
208
+ asset instead of all open orders.
209
+
210
+ Returns
211
+ -------
212
+ open_orders : dict[list[Order]] or list[Order]
213
+ If no asset is passed this will return a dict mapping Assets
214
+ to a list containing all the open orders for the asset.
215
+ If an asset is passed then this will return a list of the open
216
+ orders for this asset.
217
+ """
218
+
201
219
def get_order (order_id ):
202
220
"""Lookup an order based on the order id returned from one of the
203
221
order functions.
@@ -267,7 +285,7 @@ def order_percent(asset, percent, limit_price=None, stop_price=None, style=None)
267
285
asset : Asset
268
286
The asset that this order is for.
269
287
percent : float
270
- The percentage of the porfolio value to allocate to ``asset``.
288
+ The percentage of the portfolio value to allocate to ``asset``.
271
289
This is specified as a decimal, for example: 0.50 means 50%.
272
290
limit_price : float, optional
273
291
The limit price for the order.
@@ -356,7 +374,7 @@ def order_target_percent(asset, target, limit_price=None, stop_price=None, style
356
374
asset : Asset
357
375
The asset that this order is for.
358
376
target : float
359
- The desired percentage of the porfolio value to allocate to
377
+ The desired percentage of the portfolio value to allocate to
360
378
``asset``. This is specified as a decimal, for example:
361
379
0.50 means 50%.
362
380
limit_price : float, optional
@@ -633,20 +651,6 @@ def set_max_leverage(max_leverage):
633
651
be no maximum.
634
652
"""
635
653
636
- def set_min_leverage (min_leverage , timedelta ):
637
-
638
- """
639
- Set a limit on the minimum leverage of the algorithm.
640
-
641
- Parameters
642
- ----------
643
- min_leverage : float
644
- The minimum leverage for the algorithm. If not provided there will
645
- be no minimum.
646
- timedelta : pd.Timedelta
647
- The offset from the start date used to enforce a minimum leverage
648
- """
649
-
650
654
def set_max_order_count (max_count , on_error = 'fail' ):
651
655
"""Set a limit on the number of orders that can be placed in a single
652
656
day.
@@ -699,6 +703,17 @@ def set_max_position_size(asset=None, max_shares=None, max_notional=None, on_err
699
703
The maximum value to hold for an asset.
700
704
"""
701
705
706
+ def set_min_leverage (min_leverage , grace_period ):
707
+ """Set a limit on the minimum leverage of the algorithm.
708
+
709
+ Parameters
710
+ ----------
711
+ min_leverage : float
712
+ The minimum leverage for the algorithm.
713
+ grace_period : pd.Timedelta
714
+ The offset from the start date used to enforce a minimum leverage.
715
+ """
716
+
702
717
def set_slippage (us_equities = None , us_futures = None ):
703
718
"""Set the slippage models for the simulation.
704
719
0 commit comments