Pivot Detective Indicator v1.0

Overview of Features

The Pivot Detective is an indicator that simply highlights the waves of the market by identifying the pivot highs and pivot lows by using shapes and zigzag lines.

What makes this indicator unique is that you do not have to specify the number of bars to the left or right side of the pivots ( aka pivot strength), nor do you need to specify percent deviation for filtering the zigzag (1)lines. Thus, the indicator will monitor price action and keep track of pivot high and low prices and implements a common trend analysis algorithm to determine when the trend has reversed to confirm the pivot price and begin tracking the next pivot price. The tolerance of the trend reversal can be configured to be strict or loose depending on your preference.

Be aware that this indicator does not determine key levels of price like support (S1, S2, etc.) and resistance (R1, R2, etc.) levels that are found in the traditional Pivot Points indicators (2).

Usage Information

The indicator can be applied to any chart at any time frame. It is very customizable where you can add or change various chart elements to help you enhance your interpretation of the price action trend reversals at the pivots . You can specify the pivot shapes, colors, and visibility as well as zigzag line thickness, color, and visibility. You can adorn the pivot shapes with any combination of price, rate of change percentage, and pivot trend using HH/LH/LL/HL text as well as control the coloring schemes for the in-progress pivot . The size of the text can also be customized.

Be aware that this indicator makes use of lines and labels which are limited to 500 lines and 500 labels, so if traverse far into the history, they will not appear because they have reached these limits and were removed by the chart's rendering engine.

Lastly, you can define "any alert() function call" messages on the "New Pivot High Point" and "New Point Low Point" events. These alerts provide custom placeholders that can be used in the messages, which are: {{exchange}}, {{ticker}}, {{currency}}, {{new_pivot_point_price}}, and {{new_pivot_point_roc}}


1. Chen, James. (2021 March 15). Zig Zag Indicator . Received from http:
2. Mitchell, Cory. (2021 April 30). Pivot Points . Received from http:
Notas de Lançamento: v1.0.1 - Patch Release

New features & fixes in this release:

  • Added "Trend Direction" data point to the Data Window. A value of 1 means the indicator is detecting an uptrend; a value of -1 means the indicator is detecting a downtrend.
  • Fixed a defect where the price was setting the decimal precision to the tenth position. The new decimal precision is up to the hundred millionth position if it has a significant digit.
  • Fixed a defect where the text color of the data points in the Data Window were black in TradingView's dark-mode theme, thus making it extremely hard to read.
Notas de Lançamento: v1.0.2 - Patch Release

New features & fixes in this release:

  • Added price difference to the rate of change option. Thus, the label has been change from "% RoC" to "Δ(%) Change".
  • Added new "{{new_pivot_point_diff}}" placeholder to the "New Pivot High Point Message" and "New Pivot Low Point Message" inputs.
  • Added new "New Pivot Point Diff" data point to the Data Window.
  • Fixed a defect with the In-Progress pivot label displaying the incorrect "HH/LH/LL/HL" trend.
Script protegido
Este script é publicado como de código fechado e você pode usá-lo livremente. Você pode favoritá-lo para utilizá-lo em um gráfico. Você não pode visualizar ou modificar seu código fonte.
Quer usar esse script no gráfico?


Excellent script, thanks for your work!. It's very simple to use and it works just perfect. I'm wondering if it's possible for you to add a new input for the source. Instead of being the bar's close price it could be any other indicator's output or simply hlc3 or hlc4. Thank you.
prosum_solutions rodrigo.aprieto
@rodrigo.aprieto, thanks for the comment. I appreciate the accolades. Your request is interesting because I'm trying to understand how it would fit into the current algorithm. Currently, the indicator is not tracking the close price, but rather the highs and lows and adjusting the pivot markers when new highs and new lows are detected. Once a trend change is confirmed, it will confirm the pivot price and move to tracking the most recent pivot price. I'll investigate the possibility of adding source and how it can integrate with the algorithm and let you know if it will be possible. Thanks again, for the comment.
rodrigo.aprieto prosum_solutions
@prosum_solutions, thank you for answering. In that case I'm afraid it should be two variables. High source and Low source. By default they should equal to High and Low values. But we could change it to be the high and low of other script result or financial instrument. I was interesting to find out the pivot moments in a pair in combination with higher pivots in either longs or shorts. Combining these values including abnormal volume we might have potential pivots for entry/exit points for both longs and shorts.
Great script. Can you share the source?
@Dozza, I agree
@Dozza, Thanks for asking, but I can't share it because I will be using the code in my next version 3 of the QFL indicator/Strategy which is private and invite-only.
Are the updates applied automatically to the indicator if i am using on my charts or manual input is required. This indicator is amazing. Stay Blessed!
prosum_solutions flyingskill
@flyingskill, That's a good question because I'm not 100% sure. From my experience in troubleshooting, I believe you have to delete the indicator and then add it back on from the "Indicators & Strategies" dialog box. You should see the Version text box say "v1.0.1". Also, thanks for the praise on the indicator. I appreciate it very much. Good luck!
+1 Resposta
I love its simplicity. I also recommend showing the trend type at a glance (uptrend, downtrend, sideways). Easily done since you already have the trend plotted.
@vaidab, Same! 👍