ChartArt

Rounded Weekly Pivot (by ChartArt)

Trade with the trend. This is an overlay indicator which shows the weekly pivot (rounded) either as line or circle drawing, select-able by the user. The width of the pivot line (or circle) overlay is also adjustable.

In addition the bars can be colored by the trend, depending if the close price is above or below both the weekly and monthly pivots. If the close price is neither above or below both the weekly and monthly pivot prices the trend color is neutral blue.

The weekly pivot indicator with the optional setting that the pivot price is drawn as circles instead of a line:

And here with the pivot drawing disabled, showing only the pivot bar trend color
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?
//@version=2
study("Rounded Weekly Pivot (by ChartArt)",overlay=true,shorttitle="CA_-_Weekly_Pivot")

// ChartArt's Rounded Weekly Pivot Overlay Indicator
//
// Version 1.0
// Idea by ChartArt on December 5, 2015.
//
// This is an overlay indicator which shows
// the weekly pivot (rounded) either as
// line or circle drawing, select-able by
// the user. The width of the line is also
// adjustable.
//
// In addition the bars can be colored by the
// trend, depending if the current close price
// is above or below both the weekly and monthly
// pivot prices. If the close price is neither
// above or below both the weekly and monthly
// pivot prices the trend color is neutral blue.
//
// List of my work: 
// https://www.tradingview.com/u/ChartArt/


// Input
switch1=input(true, title="Show Weekly Pivot?")
switch2=input(true, title="Draw Weekly Pivot as Line?")
pivotlinewidth = input(3, minval=1, title="Line Width of Weekly Pivot")
switch3=input(true, title="Enable Bar Color?")

// Calculation
roundedweeklypivot = round ( security(tickerid,"W", hlc3[1]) )
monthlypivot = security(tickerid,"M", hlc3[1])
linestyle=switch2?line:circles

// Colors
weeklypivotcolor = close > roundedweeklypivot and close > monthlypivot ? green : close < roundedweeklypivot and close < monthlypivot ? red : blue
weeklypivotbgcolor = close > roundedweeklypivot and close > monthlypivot ? green : close < roundedweeklypivot and close < monthlypivot ? red : blue

// Output
plot(switch1?roundedweeklypivot:na, color=gray, title="Pivot", style = linestyle, linewidth = pivotlinewidth,transp=0)
barcolor(switch3?weeklypivotcolor:na)