Change marketsim to support orders dataframe as input
parent
5a24622410
commit
61bc03e230
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue