Exponential profit target
Flags when profit from the chart's first close clears a target that grows with the best profit so far.
ExponentialProfitTarget measures profit from the first close on the chart, which is wired in as its entry and never closed out. It tracks the best profit so far and sets target = base_target × scaling_factor^(best ÷ base_target), so the target climbs as the best profit grows. The output is True on any bar where the current profit is at or above that target. It only reports the flag; it places and closes nothing.
How to read it
- Markers sit on the candles where profit from the first close is at or above the target.
- A run of markers is a stretch above the target; the first marker of a run is the moment profit reached it.
- The target depends on the best profit so far, so it is not a fixed line and moves as the chart makes new highs.
- At the default settings no markers appear on the SPY sample, so the chart looks empty.
What it outputs
- Profit target reached
- True on candles where profit from the first close is at or above the target. Other candles get no marker.
When it fires
On every candle where profit from the first close is at or above the target, so a run of markers is a stretch above the target and its first marker is when it was reached. At the default settings it never fires. At a flat 0.5% level it fired on 25 separate stretches in the sample.
Settings
- base_target
- Starting target as a fraction of the first close (0.005 is 0.5%) and the base of its growth. Raising it lifts the level so it fires less. Zero makes the indicator fail with a divide-by-zero error; negative values fire on most bars.
- scaling_factor
- How fast the target climbs as the best profit grows. At 1.0 the target stays flat. Above about 1.45 with a positive base the target always stays above the best profit, so it never fires. Below that it can fire. Negative values never fired in the sample.
Pitfalls
- Not a real trade: the entry input is wired to the close, so it opens on the first candle and never closes. Profit runs from that candle, so readings depend on where the chart starts.
- With defaults (base 0.05, scaling 1.5) it never fires on the SPY September sample. Above about 1.45 the target always stays above the best profit, and that sample's best gain from the first close was only 1.15%.
- Base 0 raises a ZeroDivisionError on the first bar, so the indicator fails rather than showing a blank chart. A negative scaling factor silently never fires.