calculate_naive_profitability#

API documentation for tradeexecutor.state.statistics.calculate_naive_profitability Python function.

calculate_naive_profitability(total_equity_series, look_back=None, start_at=None, end_at=None)[source]#

Calculate the profitability as value at end - value at start.

Warning

This method assumes there are no deposits or redemptions. See tradeexecutor.visual.equity_curve for more advanced profit calculations.

Parameters:
  • total_equity – As received from get_portfolio_statistics_dataframe()

  • total_equity_series (Series) –

  • look_back (Optional[Timedelta]) –

  • start_at (Optional[Timestamp]) –

  • end_at (Optional[Timestamp]) –

Returns:

Tuple (Profitability as %, duration of the sample period). (None, None) if we cannot calculate anything yet.

Return type:

Tuple[Optional[float], Optional[Timedelta]]