PRC SSL hybrid
Forums › ProRealTime forum Français › Support ProBuilder › PRC SSL hybrid
- This topic has 0 replies, 1 voice, and was last updated 3 days ago by ARLEQUIN49.
-
-
01/02/2025 at 5:29 PM #242085
Bonjour à tous,
Est ce que quelqu’un serait faire une petite modification sur l’indicateur PRC SSL Hybrid en modifiant le SSL2 qui est en darwpoint à l’origine pour le mettre en drawligne continue comme c’est possible sur Tradingview.
voici le code PRT:
//PRC_SSL Hybrid | indicator
//version = 0
//31.01.24
//Iván González @ http://www.prorealcode.com
//Sharing ProRealTime knowledge
///////////////DEFAULT PARAMETERS//////////////////////////////////////
//atrlen = 14 (Integer)
//mult = 1 (Decimal)
//smoothing=2 (Average type. Default WMA)
//showcandleviolation=true (Boolean)
//showcolor=true (Boolean)
//showSSL2=true (Boolean)
//ssl1Type = 7 (Average type. Default HMA)
//len = 60 (Integer)
//ssl2Type = 7 (Average type. Default HMA)
//len2 = 5 (Integer)
//Exittype = 7 (Average type. Default HMA)
//len3 = 15 (Integer)
//showbaseline = true (Boolean)
//baselinetype = 7 (Average type. Default HMA)
//Usetruerange = true (Boolean)
//multy = 0.2 (Decimal)
//////////////////////////////////////////////////////////////////
//atr
atrlensmoot = average[atrlen,smoothing](TR(close))//atr up/low bands
upperband = atrlensmoot * mult + close
lowerband = close – atrlensmoot * mult////Ssl 1
emahigh = average[len,ssl1Type](high)
emalow = average[len,ssl1Type](low)////Ssl 2
mahigh = average[len2,ssl2Type](high)
malow = average[len2,ssl2Type](low)////Exit
src = CustomClose
exithigh = average[len3,ExitType](high)
exitlow = average[len3,ExitType](low)////keltner baseline channel
bbmc = average[len,baselineType](close)
keltma = average[len,baselineType](src)
if UseTrueRange then
myrange = tr
else
myrange = high-low
endifrangema = exponentialaverage[len](myrange)
upperk = keltma + rangema * multy
lowerk = keltma – rangema * multy////baseline violation candle
openpos = open*1
closepos = close*1
difference = abs(closepos-openpos)
atrviolation = difference > atrlensmoot
inrange = upperband > bbmc and lowerband < bbmc
candlesizeviolation = atrviolation and inrange//Ssl1 values
if close > emahigh then
hlv = 1
elsif close < emalow then
hlv = -1
else
hlv = hlv[1]
endifif Hlv < 0 then
ssldown = emahigh
else
ssldown = emalow
endif//Ssl2 values
if close > mahigh then
hlv2 = 1
elsif close < malow then
hlv2 = -1
else
hlv2 = hlv[1]
endifif hlv2 < 0 then
ssldown2 = mahigh
else
ssldown2 = malow
endif//Exit values
if close > exithigh then
hlv3 = 1
elsif close < exitlow then
hlv3 = -1
else
hlv3 = hlv3[1]
endifif hlv3 < 0 then
sslexit = exithigh
else
sslexit = exitlow
endifbasecrosslong = close crosses over sslexit
basecrossshort = sslexit crosses over closeif basecrosslong then
codiff = 1
elsif basecrossshort then
codiff = -1
else
codiff = 0
endif//////////Colours//////////////////////////////
///Bars
if close > upperk then
rbar= 0
gbar= 255
bbar= 0
elsif close < lowerk then
rbar=255
gbar=0
bbar=98
else
rbar=160
gbar=160
bbar=160
endif//Ssl1
if close > ssldown then
rssl1= 0
gssl1= 195
bssl1= 255
elsif close < ssldown then
rssl1= 255
gssl1= 0
bssl1= 98
endif//Exit
if codiff > 0 then
rcodiff=0
gcodiff=195
bcodiff=255
elsif codiff < 0 then
rcodiff=255
gcodiff=0
bcodiff=98
endif/////////SSL2 continuation from ATR//////////////
atrcrit =0.9
upperhalf = atrlensmoot * atrcrit + close
lowerhalf = close – atrlensmoot * atrcrit
buyinatr = lowerhalf < ssldown2
buycont = close > bbmc and close > ssldown2
sellinatr = upperhalf > ssldown2
sellcont = close < bbmc and close < ssldown2
buyatr = buyinatr and buycont
sellatr = sellinatr and sellcont
//Points colour
if buyatr then
rpto = 0
gpto = 255
bpto = 0
elsif sellatr then
rpto = 255
gpto = 51
bpto = 51
else
rpto = 255
gpto = 255
bpto = 255
endif///////////////////Plots////////////////////////////
//plotshape –> candlesizeviolation
if showcandleviolation and candlesizeviolation then
drawtext(“E”,barindex,high)coloured(255,255,0)
endif
//color bars
if showcolor then
DRAWCANDLE(open, high, low, close) coloured(rbar,gbar,bbar)
endif
//Exit Arrows
if codiff > 0 then
drawarrowup(barindex,low-0.1*atrlensmoot)coloured(rcodiff,gcodiff,bcodiff)
elsif codiff < 0 then
drawarrowdown(barindex,high+0.1*atrlensmoot)coloured(rcodiff,gcodiff,bcodiff)
endif
//Ssl2
if showSSL2 then
drawpoint(barindex,ssldown2,2)coloured(rpto,gpto,bpto)
endif
//color BASELINE channel
if showbaseline then
ColorBetween(lowerk,upperk,rbar,gbar,bbar,100)
endif
return showbaseline*bbmc as “baseline” coloured(rbar,gbar,bbar),showbaseline*upperk as “up line” coloured(rbar,gbar,bbar), showbaseline*lowerk as “low line” coloured(rbar,gbar,bbar),ssldown as “SSL1” coloured(rbar,gbar,bbar), upperband as “+ATR”, lowerband as “-ATR” -
AuthorPosts