Skip to content

Commit

Permalink
ENH: changed get_open_orders to context.blotter.open_orders
Browse files Browse the repository at this point in the history
  • Loading branch information
EmbarAlmog committed Jun 14, 2018
1 parent a49fcf1 commit 255b848
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions catalyst/examples/arbitrage_with_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
from catalyst.api import (
record,
order,
symbol,
get_open_orders
symbol
)
from catalyst.exchange.utils.stats_utils import get_pretty_stats
from catalyst.utils.run_algo import run_algorithm
Expand Down Expand Up @@ -200,12 +199,11 @@ def handle_data(context, data):
for exchange in context.trading_pairs:
asset = context.trading_pairs[exchange]

orders = get_open_orders(asset)
if orders:
if asset in context.blotter.open_orders:
log.info(
'found {order_count} open orders on {exchange_name} '
'skipping bar until all open orders execute'.format(
order_count=len(orders),
order_count=len(context.blotter.open_orders(asset)),
exchange_name=exchange.name
)
)
Expand Down

0 comments on commit 255b848

Please sign in to comment.