Bollinger Bands Stochastic RSI Extreme Signal, Conversion code MT4 vers PRT
Forums › ProRealTime forum Français › Support ProBuilder › Bollinger Bands Stochastic RSI Extreme Signal, Conversion code MT4 vers PRT
- This topic has 2 replies, 2 voices, and was last updated 5 months ago by Philouxp.
-
-
06/28/2024 at 11:18 AM #234481
Bonjour,
Serait il possible d’avoir la version PRT de l’indicateur Bollinger Bands Stochastic RSI Extreme Signal de TradingView by Norak SVP?
Lien vers le code ici :
https://www.tradingview.com/script/KGYEY6k6-Bollinger-Bands-Stochastic-RSI-Extreme-Signal/
L’indicateur combine la bande de Bollinger avec un RSI stochastique et marque un signal buy or sell via une flèche verte ou rouge. Ce qui visuellement est appréciable car permet 1 gain de temps lorsque l’on souhaite combiner ces 2 indicateurs.
123456789<span class="Y2IQFc" lang="fr">(Haussier)Une bougie se ferme au-dessus de la bande de Bollinger supérieureLa bougie suivante se ferme dans la bande de Bollinger supérieureLe RSI Stochastic est inférieur au seuil fixé (10 par défaut)(Baissier)Une bougie se ferme en dessous de la bande de Bollinger inférieureLa bougie suivante se ferme dans la bande de Bollinger inférieureLe RSI Stochastic est au dessus du seuil fixé (90 par défaut)</span>Voici le code:
//@version=4
study(shorttitle=”BBSR Extreme”, title=”Bollinger Bands Stochastic RSI Extreme Signal”, overlay=true, resolution=””)//General Inputs
src = input(close, title=”Source”)
offset = input(0, “Offset”, type = input.integer, minval = -500, maxval = 500)//Bollinger Inputs
length = input(20, title=”Bollinger Band Length”, minval=1)
mult = input(2.0, minval=0.001, maxval=50, title=”StdDev”)//Bollinger Code
basis = sma(src, length)
dev = mult * stdev(src, length)
upper = basis + dev
lower = basis – dev
plot(basis, “BB Basis”, color=#872323, offset = offset)
p1 = plot(upper, “BB Upper”, color=color.teal, offset = offset)
p2 = plot(lower, “BB Lower”, color=color.teal, offset = offset)
fill(p1, p2, title = “BB Background”, color=#198787, transp=95)//Stoch Inputs
smoothK = input(3, “K”, minval=1)
smoothD = input(3, “D”, minval=1)
lengthRSI = input(14, “RSI Length”, minval=1)
lengthStoch = input(14, “Stochastic Length”, minval=1)upperlimit = input(90, “Upper Limit”, minval=0.01)
lowerlimit = input(10, “Upper Limit”, minval=0.01)//Stochastic Code
rsi1 = rsi(src, lengthRSI)
k = sma(stoch(rsi1, rsi1, rsi1, lengthStoch), smoothK)
d = sma(k, smoothD)//Evaluation
Bear = close[1] > upper[1] and close < upper
and k[1] > upperlimit and d[1] > upperlimit
Bull = close[1] < lower[1] and close > lower
and k[1] < lowerlimit and d[1] < lowerlimit//Plots
plotshape(Bear, style=shape.triangledown, location=location.abovebar,
color=color.red, size=size.tiny)
plotshape(Bull, style=shape.triangleup, location=location.belowbar,
color=color.green, size=size.tiny)// Alert Functionality
alertcondition(Bear or Bull, title=”Any Signal”, message=”{{exchange}}:{{ticker}}” + ” {{interval}}” + ” BB Stochastic Extreme!”)
alertcondition(Bear, title=”Bearish Signal”, message=”{{exchange}}:{{ticker}}” + ” {{interval}}” + ” Bearish BB Stochastic Extreme!”)
alertcondition(Bull, title=”Bullish Signal”, message=”{{exchange}}:{{ticker}}” + ” {{interval}}” + ” Bullish BB Stochastic Extreme!”)D’avance merci!!
06/28/2024 at 4:03 PM #234497Bonjour, ici vous avez le code :
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152//--------------------------------------------------------------------////PRC_BB Stochastic RSI//version = 0//28.06.24//Iván González @ www.prorealcode.com//Sharing ProRealTime knowledge//--------------------------------------------------------------------////-----Inputs---------------------------------------------------------//src=close//---Bollinger Bands inputslength=20 //Bollinger Band Lengthmult=2 //StdDev//---Stochastic RSI inputssmoothK=3 //KsmoothD=3 //DlengthRSI=14 //RSI lengthlengthStoch=14 //Stochastic Lengthupperlimit=90 //overbought levellowerlimit=10 //oversold level//---Drawing inputscolorbands=1 //boolean//True=1 False=0showsignals=1 //boolean//True=1 False=0//--------------------------------------------------------------------////-----Bollinger Bands Calculation------------------------------------//basis=average[length](src)dev=mult*std[length](src)upper=basis+devlower=basis-dev//--------------------------------------------------------------------////-----Stochastic RSI Calculation-------------------------------------//rsi1=rsi[lengthRSI](src)maxrsi=highest[lengthStoch](rsi1)minrsi=lowest[lengthStoch](rsi1)osc=(rsi1-minrsi)/(maxrsi-minrsi)*100k=average[smoothK](osc)d=average[smoothD](k)//--------------------------------------------------------------------////-----Signals--------------------------------------------------------//bear=close[1]>upper[1] and close<upper and k[1]>upperlimit and d[1]>upperlimitbull=close[1]<lower[1] and close>lower and k[1]<lowerlimit and d[1]<lowerlimitif bear and showsignals thendrawtext("▼",barindex,high+0.25*averagetruerange[14](close))coloured("red")elsif bull and showsignals thendrawtext("▲",barindex,low-0.25*averagetruerange[14](close))coloured("green")endif//--------------------------------------------------------------------////-----Color bands----------------------------------------------------//if colorbands thencolorbetween(upper,lower,"teal",50)endif//--------------------------------------------------------------------//return basis as "SMA" coloured(135,35,35), upper as "BB top"coloured("teal"),lower as "BB bot"coloured("teal")07/01/2024 at 8:18 PM #234669 -
AuthorPosts
Find exclusive trading pro-tools on