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 open-source

Dans le véritable esprit de TradingView, l'auteur de ce script l'a publié en open-source, afin que les traders puissent le comprendre et le vérifier. Bravo à l'auteur! Vous pouvez l'utiliser gratuitement, mais la réutilisation de ce code dans une publication est régie par le règlement. Vous pouvez le mettre en favori pour l'utiliser sur un graphique.

Clause de non-responsabilité

Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.

Vous voulez utiliser ce script sur un graphique ?
//@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)