1
0
Fork 0

Change marketsim to support orders dataframe as input

master
Felix Martin 2020-10-12 20:07:05 -04:00
parent 5a24622410
commit 61bc03e230
1 changed files with 5 additions and 1 deletions

View File

@ -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.