Analysis, metrics, and historical PnL between historical trades

I’d like to calculate strategy metrics, e.g. Sharpe Ratio or Profit Factor, based on PnL received from each trade. Existing endpoints don’t provide PnL for each trade or the difference between entry and exit price.

  • API for current positions has PnL, entry and exit price, but there is no history of past trades
  • API for historical orders doesn’t have an exit price, so can’t calculate PnL
  • API for portfolio history shows PnL only for predefined time frames, e.g. minute bars and skips trades

Is there a way or workaround to calculate list of historical PnL based on past trades?