Skip to content
All library documents

Pivot-Level Breakout Strategy for Long Entries and Breakdown Exits

Article TradingView scripts

Summary

This strategy tracks confirmed pivot highs and lows using configurable left- and right-bar lookbacks. It enters a long position when the closing price rises above the previous bar’s stored pivot high, and closes all positions when price falls below the previous pivot low. Short entry logic is present only as a commented-out line, so the active strategy is long-only. Bar colors distinguish prices above the high pivot, below the low pivot, and between those levels.

The script includes adjustable start and stop dates for backtesting and alert conditions for bullish breakouts and bearish breakdowns. The accompanying description says the approach is intended to work best in trending conditions, but provides no performance statistics or market-specific evaluation. Pivot confirmation depends on future bars within the chosen right-side lookback, and the code uses zero commission and full equity sizing in its stated strategy settings. Those assumptions, along with the selected date range and instrument, limit how directly a backtest would translate to live trading.

Key ideas

  • A long entry is triggered when the close exceeds the prior stored pivot high.
  • The active exit closes positions when the close falls below the prior stored pivot low.
  • Pivot levels are based on user-configurable bars on both sides of a local extreme.
  • The script includes date-bounded backtesting and separate breakout and breakdown alerts.
  • Short selling is not active in the supplied strategy logic, and no performance evidence is reported.

Tags

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