Skip to content
All library documents

Using Perfect Profit as a Theoretical Trading Benchmark

Article Quant Q&A · Author: Jarro

Summary

The document asks how to calculate the maximum theoretical return from a historical price series when trades can be made with perfect knowledge of future prices. The proposed inputs include the series, a constant fee per trade, initial capital, and whether short selling is allowed; the desired outputs are total profit and the ideal entry and exit points. The response points to the concept of perfect profit: the hypothetical result of buying at each market valley and selling at each subsequent top across a historical period.

This is a measure of theoretical market potential, not an achievable strategy. The response notes that the measure grows over the test period by construction. It does not provide an algorithm, explain how to incorporate fees or shorts, or specify how to identify valleys and tops, so it offers a framing concept rather than a complete calculation method. Any comparison with a real strategy must account for the benchmark's impossible foresight.

Key ideas

  • Perfect profit estimates the historical gains available to a trader with foreknowledge of price swings.
  • The proposed calculation includes trading fees and may allow either long positions alone or long and short positions.
  • The idealized benchmark buys at valleys and sells at tops.
  • Perfect profit is unattainable in practice and grows over the historical test period by construction.
  • The response does not explain a fee-aware algorithm or define how turning points are selected.

Tags

Full text
# Finding maximum profit on 'ideal' trading with fees


# Finding maximum profit on 'ideal' trading with fees












To properly develop my trading strategies I need to find a way to calculate maximum theoretical income made from trading time series with perfect accuracy (i.e. trading while holding 'crystal ball' and knowing future) with given trading fees.

So, let's say formally, I'm looking for an algorithm, at which..

Input data:

- Historical time series 'T' (may be stock/asset/index/whatever tradeable)

- Fee rates (constant % per each trade)

- Initial capital (I don't think positions will depend on it though)

- bool:short positions available (optional, only long if not)

Output data:

- Theoretical maximum profit made up of trading 'T'

- Every long and short 'ideal' position (and their closings, of course) made up of such algorithm

## Answer by babelproofreader (score 3, accepted)

https://quant.stackexchange.com/a/37556

The book Modeling Maximum Trading Profits with C++: New Trading and Money Management Concepts covers exactly what you're trying to do, based on the idea of Robert Pardo's "perfect profit" described thus:

"Perfect profit is a theoretical measure of market potential. It is the total profit produced by buying at every valley and selling at every top that occurs during a historical period of market history. This is obviously impossible in practice, therefore the name perfect profit. Because of the method of calculation, perfect profit will constantly grow from the beginning of the historical test period to its end. (p. 204)"

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.