mickes

Trendzones

Hi all!

This indicator plots trendlines. These lines are not plotted as traditional lines, but are instead zones. This is useful if you think that trend lines are more of an area of importance than a line.

It does so by finding pivots and connecting two of them if they have not been broken (more about that later) in-between the pivots.

These trend zones can be used as support/resistance that the price can react to.

• The first trendline is drawn between the high/low of the first and second pivot.
• The second trendline's first point is at the open/close of the pivot (either the first pivot or the second one) that has the smallest difference between the high/low and the nearest open/close. The same difference (between the high/low and the open/close) is then subtracted from the other pivot's high/low. This creates a point at the other pivot bar. A trendline is then drawn between the points.

This creates two trendlines and a zone between the two trendlines. This zone is the one kept and is shown by the script.

You can define the pivot lengths used to find trend zones (defaults to 3/3). You can also define the number of pivots to look back for, to find trend zones and the number of active zones, both of these defaults to 3. You can also choose to let the script create new zones based on time ("Oldest") or the zone that is furthest away in price, this defaults to be based on time but it can be useful for letting the script remove the one which is furthest away in price. Another useful setting is the one called "Cross source". This defines the price that has to cross the trend zone to make it invalid (broken). This defaults to "Close", i.e. the bar has to close on the "wrong side" of the trend zone.

The current zones are shown with an extension to the right, but you can also choose to keep the previous lines (without extension). Please note that kept zones are only the ones that are broken, not the replaced ones. I.e. the zones that are kept are the ones that are crossed by the user defined "cross source" (defaults to the closing/current price of the bar).

Hope this makes sense, let me know if you have any questions.

Best of trading luck!
Script de código abierto

Siguiendo el verdadero espíritu de TradingView, el autor de este script lo ha publicado en código abierto, para que los traders puedan entenderlo y verificarlo. ¡Un hurra por el autor! Puede utilizarlo de forma gratuita, aunque si vuelve a utilizar este código en una publicación, debe cumplir con lo establecido en las Normas internas. Puede añadir este script a sus favoritos y usarlo en un gráfico.

Exención de responsabilidad

La información y las publicaciones que ofrecemos, no implican ni constituyen un asesoramiento financiero, ni de inversión, trading o cualquier otro tipo de consejo o recomendación emitida o respaldada por TradingView. Puede obtener información adicional en las Condiciones de uso.

¿Quiere utilizar este script en un gráfico?