Project 5: Marketsim


compute_portvals(orders_file=’./orders/orders.csv’, start_val=1000000, commission=9.95, impact=0.005)

Computes the portfolio values.

  • orders_file (str or file object) – Path of the order file or the file object
  • start_val (int) – The starting value of the portfolio
  • commission (float) – The fixed amount in dollars charged for each transaction (both entry and exit)
  • impact (float) – The amount the price moves against the trader compared to the historical data at each transaction

the result (portvals) as a single-column dataframe, containing the value of the portfolio for each trading day in the first column from start_date to end_date, inclusive.

Return type



Helper function to test code