Statistics: Posted by Jimmy — Wed May 08, 2024 7:33 pm — Replies 1923 — Views 1647238
Code: Select all
//PRC_SSL Hybrid | indicator//version = 0//31.01.24//Iván González @ www.prorealcode.com//Sharing ProRealTime knowledge///////////////DEFAULT PARAMETERS//////////////////////////////////////atrlen = 14 mult = 1.0smoothing=2 //(Average type. Default WMA)showcandleviolation=1 //(Boolean)showcolor=1 //(Boolean)showSSL2=1 //(Boolean)ssl1Type = 7 //(Average type. Default HMA)len = 60ssl2Type = 7 //(Average type. Default HMA)len2 = 5 //(Integer)Exittype = 7 //(Average type. Default HMA)len3 = 15 //(Integer)showbaseline = 1 //(Boolean)baselinetype = 7 //(Average type. Default HMA)Usetruerange = 1 //(Boolean)multy = 0.2 //(Decimal)////////////////////////////////////////////////////////////////////atratrlensmoot = average[atrlen,smoothing](TR(close))//atr up/low bandsupperband = atrlensmoot * mult + closelowerband = close - atrlensmoot * mult////Ssl 1emahigh = average[len,ssl1Type](high)emalow = average[len,ssl1Type](low)////Ssl 2mahigh = average[len2,ssl2Type](high)malow = average[len2,ssl2Type](low)////Exitsrc = CustomCloseexithigh = average[len3,ExitType](high)exitlow = average[len3,ExitType](low)////keltner baseline channelbbmc = average[len,baselineType](close)keltma = average[len,baselineType](src)if UseTrueRange thenmyrange = trelsemyrange = high-lowendifrangema = exponentialaverage[len](myrange)upperk = keltma + rangema * multylowerk = keltma - rangema * multy////baseline violation candleopenpos = open*1closepos = close*1difference = abs(closepos-openpos)atrviolation = difference > atrlensmootinrange = upperband > bbmc and lowerband < bbmccandlesizeviolation = atrviolation and inrange//Ssl1 valuesif close > emahigh thenhlv = 1elsif close < emalow thenhlv = -1elsehlv = hlv[1]endifif Hlv < 0 thenssldown = emahighelsessldown = emalowendif//Ssl2 valuesif close > mahigh thenhlv2 = 1elsif close < malow thenhlv2 = -1elsehlv2 = hlv[1]endifif hlv2 < 0 thenssldown2 = mahighelsessldown2 = malowendif//Exit valuesif close > exithigh thenhlv3 = 1elsif close < exitlow thenhlv3 = -1elsehlv3 = hlv3[1]endifif hlv3 < 0 thensslexit = exithighelsesslexit = exitlowendifbasecrosslong = close crosses over sslexitbasecrossshort = sslexit crosses over closeif basecrosslong thencodiff = 1elsif basecrossshort thencodiff = -1elsecodiff = 0endif//////////Colours/////////////////////////////////Barsif close > upperk thenrbar= 0gbar= 195bbar= 255elsif close < lowerk thenrbar=255gbar=0bbar=98elserbar=120gbar=123bbar=134endif//Ssl1if close > ssldown thenrssl1= 0gssl1= 195bssl1= 255elsif close < ssldown thenrssl1= 255gssl1= 0bssl1= 98endif//Exitif codiff > 0 thenrcodiff=0gcodiff=195bcodiff=255elsif codiff < 0 thenrcodiff=255gcodiff=0bcodiff=98endif/////////SSL2 continuation from ATR//////////////atrcrit =0.9upperhalf = atrlensmoot * atrcrit + closelowerhalf = close - atrlensmoot * atrcritbuyinatr = lowerhalf < ssldown2buycont = close > bbmc and close > ssldown2sellinatr = upperhalf > ssldown2sellcont = close < bbmc and close < ssldown2buyatr = buyinatr and buycontsellatr = sellinatr and sellcont//Points colourif buyatr thenrpto = 76gpto = 175bpto = 80elsif sellatr thenrpto = 156gpto = 39bpto = 176elserpto = 200gpto = 200bpto = 200endif///////////////////Plots//////////////////////////////plotshape --> candlesizeviolationif showcandleviolation and candlesizeviolation thendrawtext("♦",barindex,high)coloured(255,255,0)endif//color barsif showcolor thenDRAWCANDLE(open, high, low, close) coloured(rbar,gbar,bbar)endif//Exit Arrowsif codiff > 0 thendrawarrowup(barindex,low-0.1*atrlensmoot)coloured(rcodiff,gcodiff,bcodiff)elsif codiff < 0 thendrawarrowdown(barindex,high+0.1*atrlensmoot)coloured(rcodiff,gcodiff,bcodiff)endif//Ssl2if showSSL2 thendrawpoint(barindex,ssldown2,2)coloured(rpto,gpto,bpto)endif//color BASELINE channelif showbaseline thenColorBetween(lowerk,upperk,rbar,gbar,bbar,30)endifreturn 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"
Statistics: Posted by Intrest 1 — Wed May 08, 2024 7:23 pm — Replies 20418 — Views 5035761
Statistics: Posted by Banzai — Wed May 08, 2024 6:51 pm — Replies 3271 — Views 368228
Statistics: Posted by SijjiN — Wed May 08, 2024 6:41 pm — Replies 4289 — Views 1078870
Statistics: Posted by Jimmy — Wed May 08, 2024 6:25 pm — Replies 412 — Views 143689
Statistics: Posted by ionone — Wed May 08, 2024 6:21 pm — Replies 3836 — Views 1042052
Statistics: Posted by Intrest 1 — Wed May 08, 2024 6:21 pm — Replies 1532 — Views 171454
Statistics: Posted by xard777 — Wed May 08, 2024 5:59 pm — Replies 15159 — Views 3760780
Statistics: Posted by ionone — Wed May 08, 2024 5:50 pm — Replies 4 — Views 347
Statistics: Posted by vvFish — Wed May 08, 2024 5:26 pm — Replies 2819 — Views 167438
Statistics: Posted by macd & rsi — Wed May 08, 2024 5:23 pm — Replies 22 — Views 1890
Statistics: Posted by Abdi — Wed May 08, 2024 5:07 pm — Replies 29 — Views 19781
Statistics: Posted by guner — Wed May 08, 2024 4:38 pm — Replies 1079 — Views 85429
Statistics: Posted by Ogee — Wed May 08, 2024 4:05 pm — Replies 9 — Views 429
Statistics: Posted by macd & rsi — Wed May 08, 2024 4:04 pm — Replies 1133 — Views 161966