Eminaest

Eminaest Pivots V2

Simple Pivot Points plotting script.

You can choose to plot Daily, Weekly and Monthly Pivot Points. Separate or two of them or all together.
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 ?
study(title="Eminaest Pivots V2", shorttitle="EPiPo", overlay=true)
//timeframe = input("D", type=resolution)
da = input(true, title="Show Daily Pivots?")
we = input(true, title="Show Weekly Pivots?")
mo = input(true, title="Show Monthly Pivots?")
//l3 = input(false, title="Show R3 & S3?")

//Daily
sopen = security(tickerid, "D", open [1])
shigh = security(tickerid, "D", high [1])
slow = security(tickerid, "D", low [1])
sclose = security(tickerid, "D", close [1])

//weekly
wopen = security(tickerid, "W", open [1])
whigh = security(tickerid, "W", high [1])
wlow = security(tickerid, "W", low [1])
wclose = security(tickerid, "W", close [1])

//Monthly
mopen = security(tickerid, "M", open [1])
mhigh = security(tickerid, "M", high [1])
mlow = security(tickerid, "M", low [1])
mclose = security(tickerid, "M", close [1])

//Color
scolor=sopen != sopen[1] ? na : black
scolor1=sopen != sopen[1] ? na : red
scolor2=sopen != sopen[1] ? na : green

wcolor=wopen != wopen[1] ? na : black
wcolor1=wopen != wopen[1] ? na : red
wcolor2=wopen != wopen[1] ? na : green

mcolor=mopen != mopen[1] ? na : black
mcolor1=mopen != mopen[1] ? na : red
mcolor2=mopen != mopen[1] ? na : green

//Pivot Calculation
//Daily
pivot = (shigh + slow + sclose) / 3
r1 = (pivot + pivot) - slow
s1 = (pivot + pivot) - shigh 
r2 = pivot + (shigh - slow)
s2 = pivot - (shigh - slow)
r3 = r1 + (shigh - slow)
s3 = s1 - (shigh - slow)

//Weekly
wpivot = (whigh + wlow + wclose) / 3
wr1 = wpivot + (wpivot - wlow)
ws1 = wpivot - (whigh - wpivot) 
wr2 = wpivot + (whigh - wlow) 
ws2 = wpivot - (whigh - wlow) 
wr3 = wr1 + (whigh - wlow)
ws3 = ws1 - (whigh - wlow)

//Monthly
mpivot = (mhigh + mlow + mclose) / 3
mr1 = mpivot + (mpivot - mlow)
ms1 = mpivot - (mhigh - mpivot) 
mr2 = mpivot + (mhigh - mlow) 
ms2 = mpivot - (mhigh - mlow) 
mr3 = mr1 + (mhigh - mlow)
ms3 = ms1 - (mhigh - mlow)

//Plotting lines
//Daily
plot(da and pivot ? pivot : na, color=scolor, style=circles)
plot(da and s1 ? s1 : na, color=scolor1,style=circles)
plot(da and s2 ? s2 : na, color=scolor1,style=circles)
plot(da and s3 ? s3 : na, color=scolor1,style=circles)
plot(da and r1 ? r1 : na, color=scolor2,style=circles)
plot(da and r2 ? r2 : na, color=scolor2,style=circles)
plot(da and r3 ? r3 : na, color=scolor2,style=circles)

//Weekly
plot(we and wpivot ? wpivot : na, color=wcolor, linewidth=1)
plot(we and ws1 ? ws1 : na, color=wcolor1, linewidth=1)
plot(we and ws2 ? ws2 : na, color=wcolor1, linewidth=1)
plot(we and ws3 ? ws3 : na, color=wcolor1, linewidth=1)
plot(we and wr1 ? wr1 : na, color=wcolor2, linewidth=1)
plot(we and wr2 ? wr2 : na, color=wcolor2, linewidth=1)
plot(we and wr3 ? wr3 : na, color=wcolor2, linewidth=1)

//Monthly
plot(mo and mpivot ? mpivot : na, color=mcolor, linewidth=2)
plot(mo and ms1 ? ms1 : na, color=mcolor1, linewidth=2)
plot(mo and ms2 ? ms2 : na, color=mcolor1, linewidth=2)
plot(mo and ms3 ? ms3 : na, color=mcolor1, linewidth=2)
plot(mo and mr1 ? mr1 : na, color=mcolor2, linewidth=2)
plot(mo and mr2 ? mr2 : na, color=mcolor2, linewidth=2)
plot(mo and mr3 ? mr3 : na, color=mcolor2, linewidth=2)