RicardoSantos

[RS]Monthly Dynamic Range Levels (Fibonaci) V0

Monthly fibonaci range analysis and system
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("[RS]Monthly Dynamic Range Levels (Fibonaci) V0", overlay=true)
Optional_TimeFrame = input('M')

M_HIGH = security(tickerid, Optional_TimeFrame, high)
M_OPEN = security(tickerid, Optional_TimeFrame, open)
M_LOW = security(tickerid, Optional_TimeFrame, low)

H_RANGE = M_HIGH-M_OPEN
L_RANGE = M_OPEN-M_LOW

H_236 = M_HIGH - H_RANGE * 0.236
H_382 = M_HIGH - H_RANGE * 0.382
H_500 = M_HIGH - H_RANGE * 0.500
H_618 = M_HIGH - H_RANGE * 0.618
H_764 = M_HIGH - H_RANGE * 0.764

L_236 = M_LOW + L_RANGE * 0.236
L_382 = M_LOW + L_RANGE * 0.382
L_500 = M_LOW + L_RANGE * 0.500
L_618 = M_LOW + L_RANGE * 0.618
L_764 = M_LOW + L_RANGE * 0.764

plot(M_HIGH, color=M_HIGH != M_HIGH[1] ?na:black, style=line, linewidth=1)

plot(H_236, color=H_236 != H_236[1] ?na:gray, style=line, linewidth=1)
plot(H_382, color=H_382 != H_382[1] ?na:black, style=line, linewidth=1)
plot(H_500, color=H_500 != H_500[1] ?na:red, style=line, linewidth=1)
plot(H_618, color=H_618 != H_618[1] ?na:black, style=line, linewidth=1)
plot(H_764, color=H_764 != H_764[1] ?na:gray, style=line, linewidth=1)

plot(M_OPEN, color=M_OPEN != M_OPEN[1] ?na:blue, style=line, linewidth=2)

plot(L_236, color=L_236 != L_236[1] ?na:gray, style=line, linewidth=1)
plot(L_382, color=L_382 != L_382[1] ?na:black, style=line, linewidth=1)
plot(L_500, color=L_500 != L_500[1] ?na:red, style=line, linewidth=1)
plot(L_618, color=L_618 != L_618[1] ?na:black, style=line, linewidth=1)
plot(L_764, color=L_764 != L_764[1] ?na:gray, style=line, linewidth=1)

plot(M_LOW, color=M_LOW != M_LOW[1] ?na:black, style=line, linewidth=1)

SHOW_MA = input(false)
MA_SRC = input(hlc3)
MA_LENGTH = input(21)

_MA = ema(MA_SRC, MA_LENGTH)
plot(not SHOW_MA ? na : _MA, color=teal, linewidth=2)

SHOW_SIGNALS = input(true)

BUYX(_F) => cross(_F, MA_SRC) and rising(_MA, 1)
SELX(_F) => cross(_F, MA_SRC) and falling(_MA, 1)

SEL_SIGNAL = SELX(H_236) or SELX(H_382) or SELX(H_500) or SELX(H_618) or SELX(H_764) or
        SELX(L_236) or SELX(L_382) or SELX(L_500) or SELX(L_618) or SELX(H_764)

BUY_SIGNAL = BUYX(H_236) or BUYX(H_382) or BUYX(H_500) or BUYX(H_618) or BUYX(H_764) or
        BUYX(L_236) or BUYX(L_382) or BUYX(L_500) or BUYX(L_618) or BUYX(H_764)

plotshape(not SHOW_SIGNALS ? na : SEL_SIGNAL ? M_HIGH : na, style=shape.labeldown, location=location.absolute, text='-', color=maroon, textcolor=white, transp=0)
plotshape(not SHOW_SIGNALS ? na : BUY_SIGNAL ? M_LOW : na, style=shape.labelup, location=location.absolute, text='+', color=green, textcolor=white, transp=0)