PROTECTED SOURCE SCRIPT

PivotBuilder

158
Overview

PivotBuilder is a versatile trading tool that allows traders to create up to eight pivot lines, calculated using moving averages and standard deviation offsets, for enhanced market analysis and trade signal generation. These pivot lines work in conjunction with a trigger line to generate long and short signals based on user-defined parameters.

Key features:

  • Build strategies based on interaction between a moving average and any one or more of the 8 pivot lines - all fully configurable.
  • Customizable moving average types for pivot and trigger lines (SMA, EMA, VWMA).
  • Optional global pivot line configuration to simplify parameter adjustments.
  • Signal persistence options: signals can last for only one bar or until the opposite signal is issued.
  • Strategy visualization on chart.
  • Ideal for intraday and swing traders seeking dynamic support/resistance analysis and related strategies.


Key Concepts:

Customizable Pivot Lines

  • Create up to eight pivot lines with individually adjustable lengths, moving average types, and standard deviation offsets.
  • Optionally enable or disable signal generation for each pivot line.


Global Pivot Line Settings

  • Use a single global length for all pivot lines with one input for quicker configuration.


Signal Persistence

  • Choose between signals lasting only for the current bar or remaining active until the opposite signal is issued.


Chart Highlighting

  • Green background: Long signal is active.
  • Red background: Short signal is active.


Alerts
  • Configure alerts for signals via email, Discord, pop-ups, or sound using TradingView's native alert function.


Input Parameters


Global Settings:

  • Use Global Length for Pivot Lines: Enable this to apply a single length value to all pivot lines.
  • Global Pivot Line Length: The length to apply when the global setting is enabled.


Signal Mode:

  • Signal Mode: Select how long signals persist.
  • One Bar Only: Signals last only for the current bar.
  • Until Opposite Signal: Signals remain active until the opposite signal is triggered.


Trigger Line:

  • Trigger Line Moving Average Length: Set the length of the moving average for the trigger line.
  • Trigger Line MA Type: Choose the moving average type (Simple - SMA, Exponential - EMA, Volume-Weighted - VWMA).


Pivot Lines:
  • Each of the eight pivot lines has the following configurable settings:
  • Length: Define the moving average length. Overrides the global length if global settings are disabled.
  • MA Type: Choose between Simple - SMA, Exponential - EMA, Volume-Weighted - VWMA.
  • Standard Deviation: Set the standard deviation offset for the pivot line.
  • Enable Signal: Turn signal generation on/off for the specific pivot line.


Example Strategy on Nasdaq Futures (NQ, 1-minute Chart)


istantanea

Long Signal:
A long signal is generated when:
  • The trigger line crosses above Pivot Line, Pivot Line 2, Pivot Line 3, and Pivot Line 4.


Short Signal:
A short signal is generated when:
  • The trigger line crosses below Pivot Line, Pivot Line 2, Pivot Line 3, and Pivot Line 4.


Configuration Example:


Global Settings:

Use Global Length for Pivot Lines: Disabled (to allow individual lengths for each pivot line).
Signal Mode: Until Opposite Signal (signals persist until the opposite signal is triggered).
Trigger Line:
Trigger Line Moving Average Length: 5.
Trigger Line MA Type: EMA (Exponential Moving Average).

Pivot Line 1:
Length: 20.
MA Type: EMA (Exponential Moving Average).
Standard Deviation: 0.25.
Enable Signal: True.

Pivot Line 2:
Length: 50.
MA Type: EMA (Exponential Moving Average).
Standard Deviation: -0.5.
Enable Signal: True.

Pivot Line 3:
Length: 50.
MA Type: EMA (Exponential Moving Average).
Standard Deviation: 1.
Enable Signal: True.

Pivot Line 4:
Length: 40.
MA Type: EMA (Exponential Moving Average).
Standard Deviation: 2.0.
Enable Signal: True.

Set Pivot Lines 5-8 disabled.

Signals:

Green Highlight: Indicates a long signal is active.
Red Highlight: Indicates a short signal is active.

Alerts
PivotBuilder allows you to set alerts for long or short signals. Here’s how to set them up in TradingView:

  1. Add the Indicator: Attach PivotBuilder to your chart.
  2. Open Alert Menu: Right-click on the chart and select Add Alert.
  3. Condition: Choose your symbol (e.g., NQ) and select PivotBuilder.
  4. Alert Options:
    Crossing: Choose if you want to be alerted for "long" or "short" signals.
    Notifications: Configure alerts via:
    Email: Receive email alerts when signals are triggered.
    Webhook: Set up Discord notifications via webhooks.
    Pop-ups: Show an on-screen alert in TradingView.
    Sound: Play a sound when a signal is issued.
    Create: Save the alert.


Signal Persistence: How It Works

PivotBuilder gives you control over how long signals remain active:

One Bar Only:
  • Signals are active for the current bar only.
  • At the close of the bar, signals reset automatically.

Until Opposite Signal:

  • A long signal remains active until a short signal is triggered and vice versa.
  • Useful for trend-following strategies.


Development Roadmap
Future updates for PivotBuilder will include:
  • New Moving Average Types: Expand the available moving average options for both the pivot and trigger lines. Planned additions include, Weighted Moving Average (WMA), Hull Moving Average (HMA), Least Squares Moving Average (LSMA), and more.
  • Dynamic Volume Filtering: Add volume-based conditions to validate signals during periods of high market activity, filtering out low-liquidity signals.
  • Incorporation of Support/Resistance Calculations: Integrate traditional and alternative methods of support and resistance calculations into pivot lines such as Fibonacci retracements, Average True Range (ATR), volume-profile based support.
  • Automated trading via Strategy companion add-on.

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.