diff --git a/marketsim/marketsim.py b/marketsim/marketsim.py index 50d2c41..aac6468 100644 --- a/marketsim/marketsim.py +++ b/marketsim/marketsim.py @@ -92,7 +92,11 @@ def handle_order(date, order, holding, prices, commission, impact): def compute_portvals(orders_file, start_val=1000000, commission=9.95, impact=0.005): - orders = read_orders(orders_file) + if isinstance(orders_file, pd.DataFrame): + orders = orders_file + else: + orders = read_orders(orders_file) + start_date, end_date, symbols = get_order_book_info(orders) # Tickers in the orderbook over the date_range in the order book.