JohnBaron

Clone Pivots. Oct_2023

JohnBaron Updated   
Conceptually very simple.

The all time high or low of the chart (this indicator can be used with non-price sources as well), is used to divide the price pane continuously by 2.

For example the first pivot is (All Time High + All Time Low)/2.

From this point the price chart is further divided by 2.

The user can set the depth of division, and the lines for depth are only shown around the price.

About clone pivots.
- they can be used for ladder trading
- they are based on the range of the stock or instrument price

An alternative is available to use Fib divisions rather than simple divide by 2 method.

Labels may be placed with price or without. And depth of labelling is also an option.

Clone pivots at 50% tend to work very well with price structures - give it a try and see if it helps your trading!

Pine source uses UDTs, Methods, Arrays and Maps.
Release Notes:
This update includes
- more ability to modify the appearance of labels
- tooltips and better organization of the settings dialog
- better documentation of the source
- rewritten to leverage the speed of maps vs arrays
Release Notes:
Some major updates for the community:
  1. tightened up the script to speed processing in an number of areas
  2. updated the drawing method so no change in levels only changes the coordinates
  3. added more comments to the source script
  4. added the ability to show labels only for median levels
  5. updated the settings to be more self explanatory
Release Notes:
Minor Update to limit label and line drawing to visible high and low of the chart. There were some cases when auto size was set where the line drawing was causing chart compression.
Release Notes:
This update to:
  • use symbol all time high and all time low regardless of the chart timeframe
  • adds a switch to turn on or off limiting lines to visible chart range

Some more notes on how to trade it and settings.

Traders would use clone pivots:

as a ladder for scaling in and out of a position
set TP's or potential entries at levels


The Setup allows for the source of high and low to be from a non-price source such as an oscillator. The last source input is used to setup up the levels closest to the price and keep the line clutter to a minimum on the chart.

There is also another switch to keep line clutter down - it will only display levels in the visible range of the pane. At times TV auto scale will scale all the drawn lines into the pane and that causes problems - these seems intermittent so a switch is available to help with that.

Labels have a whole set of options available, from placement on the level line, to how they are presented (above, center or below the line) to the size of the font. There is also a choice to use price vs just ratio on the label.

If the level depth is set to N, to reduce potential clutter labels can be turned off at a specified depth and another choice just to label the median or 50% line at lower depths.

In terms of pine a few techniques are used:

UDT and Methods
Maps
Drawing objects, lines and labels.


The script is optimized to reduce the loop lengths and reduce redrawing all lines and labels to only when necessary and otherwise update the coordinates.

I hope this is useful to the community for both it's trading value and pine techniques used.
Release Notes:
Quick fix for applying to indicators with negative values or no long term historical values.
Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

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.

Want to use this script on a chart?