Here is the code translated from Pinescript into ProRealTime. You have to change the src variable to inject any type of value, in this version it is the Close.
//PRC_Cycle Channel Oscillator | indicator 03.03.2020
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
//converted from pinescript
// --- settings
sclt = 10 //Short Cycle Length
mclt = 30 //Medium Cycle Length
scm = 1.0 //Short Cycle Multiplier
mcm = 3.0 //Medium Cycle Multiplier
// --- end of settings
src=customclose //Source
once scl = round(sclt/2)
once mcl = round(mclt/2)
mascl=wilderaverage[scl](src)
mamcl=wilderaverage[mcl](src)
scmoff = scm*averagetruerange[scl]
mcmoff = mcm*averagetruerange[mcl]
once scl2=round(scl/2)
once mcl2=round(mcl/2)
sct = mascl[scl2]+ scmoff
scb = mascl[scl2]- scmoff
mct = mamcl[mcl2]+ mcmoff
mcb = mamcl[mcl2]- mcmoff
scmm=(sct+scb)/2
omed=(scmm-mcb)/(mct-mcb)
oshort=(src-mcb)/(mct-mcb)
if omed >=1 then
drawsegment(barindex,1,barindex,omed) coloured(128,0,128)
endif
if omed <=0 then
drawsegment(barindex,0,barindex,omed) coloured(128,0,128)
endif
if oshort >=1 then
drawsegment(barindex,1,barindex,oshort) coloured(128,0,128)
endif
if oshort <=0 then
drawsegment(barindex,0,barindex,oshort) coloured(128,0,128)
endif
return 1.0 coloured(168,168,168) as "UpperLine", 0.5 coloured(168,168,168) as "MidLine", 0.0 coloured(168,168,168) as "LowerLine",oshort coloured(255,0,0) style(line,2) as "FastOsc",omed coloured(0,255,0) style(line,2) as "SlowOsc"
//plot(omed>=1.0?omed:na, histbase=1.0, style=histogram, color=purple, linewidth=2, title="MediumCycleOB")
//plot(omed<=0.0?omed:na, histbase=0.0, style=histogram, color=purple, linewidth=2, title="MediumCycleOS")
//plot(oshort>=1.0?oshort:na, histbase=1.0, style=histogram, color=purple, linewidth=2, title="ShortCycleOB")
//plot(oshort<=0.0?oshort:na, histbase=0.0, style=histogram, color=purple, linewidth=2, title="ShortCycleOS"