OPEN-SOURCE SCRIPT

Swing High/Low Pivots Strategy [LV]

The Swing High/Low Pivots Strategy was developed as a counter-momentum trading tool.
The strategy is suitable for any market and the default values used in the input settings menu are set for Bitcoin (best on 15min). These values, expressed in minimum ticks (or pips if symbol is Forex) make this tool perfectly adaptable to every symbol and/or timeframe.
Check tooltips in the settings menu for more details about every user input.

  • STRTEGY ENTRY & EXIT MECHANISMS:
    Trades Entry based on the detection of swing highs and lows for short and long entries respectively, validated by:
    - Limit orders placed after each new pivot level confirmation
    - Moving averages trend filter (if enabled)
    - No active trade currently open
    Trades Exit when the price reaches take-profit or stop-loss level as defined in the settings menu. A double entry/second take-profit level can be enabled for partial exits, with dynamic stop-loss adjustment for the remaining position.


  • Enhanced Trade Precision:
    By limiting entries to confirmed swing high (HH, LH) or swing low (HL, LL) pivot points, the strategy ensures that trades occur at levels of significant price reversals. This precision reduces the likelihood of entering trades in the midst of a trend or during uncertain price action.

  • Risk Management Optimization:
    The strategy incorporates clearly defined stop-loss (SL) and take-profit (TP) levels derived from the pivot points. This structured approach minimizes potential losses while locking in profits, which is critical for consistent performance in volatile markets.

  • Trend Filtering for Better Entry:
    The use of a configurable moving average filter adds a layer of trend validation. This prevents entering trades against the dominant market trend, increasing the probability of success for each trade.

  • Avoidance of Noise:
    The lookback period (length parameter) confirms pivots only after a set number of bars, effectively filtering out market noise and ensuring that entries are based on reliable, well-defined price movements.

  • Adaptability Across Markets:
    The strategy is versatile and can be applied across different markets (Forex, stocks, crypto) due to its dynamic use of ticks and pips converters. It adapts seamlessly to varying price scales and asset types.

  • Dual Quantity Entries:
    The original and optionnal double-entry mechanism allows traders to capture both short-term and extended profits by scaling out of positions. This adaptive approach caters to varying risk appetites and market conditions.

  • Clear Visualization:
    The plotted pivot points, entry limits, SL, and TP levels provide visual clarity, making it easy for traders to track the strategy's behavior and make informed decisions.

  • Automated Execution with Alerts:
    Integrated alerts for both entries and exits ensure timely actions without the need for constant market monitoring, enhancing efficiency. Configurable alert messages are suitable for API use.


Any feedback, comments, or suggestions for improvement are always welcome.
Hope you enjoy!
BTCUSDExponential Moving Average (EMA)HHHLLHLLpivotPivot PointsPivot points and levels

开源脚本

本着真正的TradingView精神,此脚本的作者已将其开源,以便交易者可以理解和验证它。向作者致敬!您可以免费使用它,但在出版物中重复使用此代码受网站规则约束。 您可以收藏它以在图表上使用。

想在图表上使用此脚本?


更多:

免责声明