Hello folks… after a few failed attempts of my own, I’m hoping someone would be able to help with setting up a screener that scans for the arrow conditions of the PRC Super Arrow indicator found in the PRC library here and also attached.
The screener should only show instruments that have the most recent closed candle display the signal, whether long or short.
Thank you, and any assistance would be much appreciated.
Not tested the below version, but should work! 🙂
//PRC_Super Arrow Indicator | indicator
//24.10.2019
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
//converted from MT4 code
// --- settings
FasterMovingAverage = 5
SlowerMovingAverage = 200
RSIPeriod = 12
MagicFilterPeriod = 14
BollingerbandsPeriod = 20
BollingerbandsShift = 0
BollingerbandsDeviation = 1.6
BullsPowerPeriod = 50
BearsPowerPeriod = 50
// --- end of settings
ima12 = average[FasterMovingAverage,1]
ima28 = average[FasterMovingAverage,1][1]
ima20 = average[SlowerMovingAverage,1]
ima36 = average[SlowerMovingAverage,1][1]
irsi44 = RSI[RSIPeriod](CLOSE)
irsi52 = RSI[RSIPeriod](CLOSE)[1]
ibullspower=high-average[bullspowerperiod,1]
ibearspower=low-average[bearspowerperiod,1]
ibullspower60 = iBullsPower
ibullspower68 = iBullsPower[1]
ibearspower76 = iBearsPower
ibearspower84 = iBearsPower[1]
ibandsup=average[bollingerbandsperiod][bollingerbandsshift]+std[bollingerbandsperiod](close)[bollingerbandsshift]*bollingerbandsdeviation
ibandsdn=average[bollingerbandsperiod][bollingerbandsshift]-std[bollingerbandsperiod](close)[bollingerbandsshift]*bollingerbandsdeviation
ibands152=ibandsup
ibands160=ibandsdn
ibands168=ibandsup[1]
ibands176=ibandsdn[1]
hh = highest[MagicFilterPeriod](high)
ll = highest[MagicFilterPeriod](low)
ld92=0
ld100=0
for i = 1 to MagicFilterPeriod do
if high[i]=hh then
ld92=i
endif
if low[i]=ll then
ld100=i
endif
if ld92>0 and ld100>0 then
break
endif
next
Ld108 = 100 - 100.0 * ((Ld92 - 0.0) / 10.0)
Ld116 = 100 - 100.0 * ((Ld100 - 0.0) / 10.0)
if (Ld108 = 0.0) then
Ld108 = 0.0000001
endif
if (Ld116 = 0.0) then
Ld116 = 0.0000001
endif
Ld124 = Ld108 - Ld116
if (Ld124 >= 0.0) then
Gi148 = 1 //true
Gi168 = 0 //false
else
if (Ld124 < 0.0) then
Gi148 = 0 //false
Gi168 = 1 //true
endif
endif
if (Close > ibands152 and Close[1] >= ibands168) then
Gi144 = 0
Gi164 = 1
endif
if (Close < ibands160 and Close[1] <= ibands176) then
Gi144 = 1
Gi164 = 0
endif
if (ibullspower60 > 0.0 and ibullspower68 > ibullspower60) then
Gi140 = 0
Gi160 = 1
endif
if (ibearspower76 < 0.0 and ibearspower84 < ibearspower76) then
Gi140 = 1
Gi160 = 0
endif
if (irsi44 > 50.0 and irsi52 < 50.0) then
Gi136 = 1
Gi156 = 0
endif
if (irsi44 < 50.0 and irsi52 > 50.0) then
Gi136 = 0
Gi156 = 1
endif
if (ima12 > ima20 and ima28 < ima36) then
Gi132 = 1
Gi152 = 0
endif
if (ima12 < ima20 and ima28 > ima36) then
Gi132 = 0
Gi152 = 1
endif
signal=0
if (Gi132 and Gi136 and Gi144 and Gi140 and Gi148 and Gi172 <> 1) then
//drawarrowup(barindex,Low - 1.3 * std[14]) coloured(0,255,0)
signal=1
Gi172 = 1
endif
if (Gi152 and Gi156 and Gi164 and Gi160 and Gi168=0 and Gi172 <> 2) then
//drawarrowdown(barindex,High + 1.3 * std[14]) coloured(255,0,0)
Gi172 = 2
signal=-1
endif
screener[signal<>0](signal)
Thank you Nicolas,
Your dedication to this site never ceases to amaze. I can also now easily also see where I went wrong with my attempts.
Thanks again,
Boston.