OPEN-SOURCE SCRIPT

Internal Pivot Pattern [LuxAlgo]

12 301
The Internal Pivot Pattern indicator is a novel method allowing traders to detect pivots without excessive delay on the chart timeframe, by using the lower timeframe data from a candle.

It features custom colors for candles and zigzag lines to help identify trends. A dashboard showing the accuracy of the pattern is also included.

🔶 USAGE

snapshot

We define a pivot as the occurrence where the middle candle over a specific interval (for example, the most recent 21 bars) is the highest (pivot high) or the lowest (pivot low). This method commonly allows for identifying swing highs/lows on a trader's chart; however, this pattern can only be identified after a specific number of bars has been formed, rendering this pattern useless for real-time detection of swing highs/lows.

snapshot

This indicator uses a different approach, removing the need to wait for candles to form on the user chart; instead, we check the lower timeframe data of the current candle and evaluate for the presence of a pivot given the internal data, effectively providing pivot confirmation at the candle close.

An internal pivot low pattern is indicative of a potential uptrend, while an internal pivot high is indicative of a potential downtrend.

Candles are colored based on the last internal pivot detected, with blue candle colors indicating that the most recent internal pivot is a pivot low, indicating an uptrend, while an orange candle color indicates that the most recent internal pivot is a pivot high, indicating a downtrend.

🔹 Timeframes

snapshot

The timeframe setting allows controlling the amount of lower timeframe data to consider for the internal pivot detection. This setting must be lower than the user's chart timeframe.

Using a timeframe significantly lower than the user chart timeframe will evaluate a larger amount of data for the pivot detection, making it less frequent, while using a timeframe closer to the chart timeframe can make the internal pivot detection more frequent, and more prone to false positives.

🔹 Accuracy Dashboard

snapshot

The Accuracy Dashboard allows evaluating how accurate the detected patterns are as a percentage, with a pattern being judged accurate if subsequent patterns are detected higher or lower than a previous one.

For example, an internal pivot low is judged accurate if the following internal pivot is higher than it, indicating that higher highs have been made.

This dashboard can be useful to determine the timeframe setting to maximize the respective internal pivot accuracy.

🔶 SETTINGS

  • Timeframe: Timeframe for detecting internal swings
  • Accuracy Dashboard: Enable or disable the Accuracy Dashboard.


🔹 Style

  • Internal Pivot High: Color of the dot displayed upon the detection of an internal pivot high
  • Internal Pivot Low: Color of the dot displayed upon the detection of an internal pivot low
  • Zig-Zag: Color of the zig-zag segments connecting each internal pivot
  • Candles: Enable candle coloring, with control over the color of the candles highlighting the detected trend

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.