Hidden Redirect Link

Profit Maximizer (PMax)


Hidden Redirect Link
Loading...

PMax (Profit Maximizer) is a trend-following indicator that plots a moving average and an ATR-based trailing stop on the price chart. It shows trend direction and marks a Buy when the moving average crosses above the PMax line and a Sell when it crosses below. Because the stop distance is measured in ATR, the line adapts to market volatility instead of using a fixed percentage.

How PMax is calculated

  1. A moving average of the selected source (HL2 by default) gives the center line.
  2. The stop sits at Multiplier × ATR below that average in an uptrend and above it in a downtrend, and it only moves in the direction of the trend.
  3. When the moving average closes beyond the opposite stop, the direction flips and the PMax line jumps to the other side.
  4. The area between the moving average and PMax is shaded green in an uptrend and red in a downtrend.

Default settings

  • Source: HL2
  • ATR Length: 10
  • ATR Multiplier: 3.0
  • Moving average: EMA, length 10
  • ATR method: Wilder (RMA); switch it off to use the SMA of True Range
  • Normalize ATR: off
  • Signals: moving average / PMax crossings on, price / PMax crossings off
  • Moving average types: SMA, EMA, WMA, TMA, VAR, WWMA, ZLEMA, TSF

How to tune it

  • A higher multiplier or a longer ATR gives a wider stop, fewer signals and fewer whipsaws, but later entries.
  • A lower multiplier reacts faster and suits short timeframes, at the cost of more false flips in ranges.
  • Turn on Normalize ATR to scale the distance by price, which helps when comparing very different price levels.
  • Create platform alerts on the moving average and PMax lines to be notified on a cross.

PMax vs a classic SuperTrend

  • Center line: PMax uses a moving average with 8 selectable types; SuperTrend uses HL2.
  • Stop distance: both use Multiplier × ATR.
  • Signal: PMax signals when the moving average crosses the PMax line; SuperTrend signals when price closes beyond its band.

Limitations

PMax is a lagging, trend-following tool. In sideways markets it flips often and produces losing signals, and a signal on the last bar can change until that bar closes. Combine it with market structure, volume or a higher-timeframe filter.

About this version

Indie port for TakeProfit of the open-source Pine Script v4 indicator published on TradingView in February 2021. The logic follows the original: moving average, ATR trailing stop, direction flip and crossing signals. Values were compared with TradingView on the same candles and matched. The two long/short highlighter fills of the original are merged into one color-switching fill, and TradingView alertcondition() is replaced by platform alerts. Last updated: October 2026.

Credits

Original indicator: Profit Maximizer (PMax) by KivancOzbilgic, TradingView. © KivancOzbilgic. Original licensed under the Mozilla Public License 2.0 (https://mozilla.org/MPL/2.0/). This is an independent Indie port of the published open-source script.

Risk warning

This indicator is a technical analysis tool for educational and informational purposes, not financial advice or a trading recommendation. Signals are calculated from past prices, can lag, repeat and fail, and do not guarantee future results. Trading financial instruments, especially with leverage, involves a high risk of loss. Test any settings on history and a demo account first, and never risk money you cannot afford to lose.

Tags: trend, trendfollowing, trailingstop, atr, movingaverage, pmax, signals, buysell, ema, volatility, crypto, forex Image: not needed


Comments

loading