Following the creation of the Range Filter indicator coded by Nicolas, I wished to re-adapt the code to make it available on PRT 10.3
I find this indicator particularly interesting, I wanted to add a filter to the Range Filter ‘-‘.
As an external variable, you will find the values corresponding to the color code to modify it as you wish via a site with a color code.
IV
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 |
// //=/===============/=//=/===============/=//=/ Indicator Range Trend // // RxUP = 0 // GxUP = 153 // BxUP = 255 // RxDOWN = 102 // GxDOWN = 102 // BxDOWN = 102 // RxRange = 199 // RxRange = 29 // RxRange = 29 // //=/===============/=//=/===============/=//=/ Range // //=/ Range Settings once rngfilt=close if barindex>max(14,27) then rngscale=max(1,min(rngscale,7)) scale = 2.618*average[14,1](abs(close-close[1])) endif r=average[27,1](scale) hh=close ll=close if 1<>1 then hh=high ll=low endif if 1=1 then if hh>rngfilt[1] then if (hh-r)<rngfilt[1] then rngfilt=rngfilt[1] else rngfilt=hh-r endif elsif (ll+r)>rngfilt[1] then rngfilt=rngfilt[1] else rngfilt=ll+r endif else if hh>=rngfilt[1]+r then rngfilt=(rngfilt[1]) + (abs(hh - (rngfilt[1]))/r)*r elsif ll<=rngfilt[1]-r then rngfilt=(rngfilt[1]) - (abs(ll - (rngfilt[1]))/r)*r else rngfilt=rngfilt[1] endif endif hiband = rngfilt + r loband = rngfilt - r if rngfilt>rngfilt[1] then upward=1 downward=0 endif if rngfilt<rngfilt[1] then upward=0 downward=1 endif TrendFast = rngfilt TrendMedium = Average[2](rngfilt) TrendLong = Average[4](rngfilt) // //=/===============/=//=/===============/=//=/ Trend Color // //=/ Trend Fast Color Settings if upward and TrendFast > TrendFast[1] then cr = RxUP cg = GxUP cb = BxUP ct = 250 elsif downward and TrendFast < TrendFast[1] then cr = RxDOWN cg = GxDOWN cb = BxDOWN ct = 250 elsif TrendFast = TrendFast[1] then cr = RxRange cg = GxRange cb = BxRange ct = 250 endif // //=/===============/=//=/===============/=//=/ Candle // //=/ Bullish Conditions 1 U1 = upward > 0 U2 = close > TrendFast U3 = close > TrendLong U4 = close > TrendMedium U5 = TrendFast > TrendFast[1] U6 = TrendLong > TrendLong[1] U7 = TrendMedium > TrendMedium[1] BullishConditions1 = U1 and U2 and U3 and U4 and U5 and U6 and U7 //=/ Bullish Conditions 2 UX1 = upward > 0 UX2 = close > TrendFast UX3 = close > TrendLong UX4 = close > TrendMedium UX5 = TrendFast = TrendFast[1] UX6 = TrendLong > TrendLong[1] UX7 = TrendMedium > TrendMedium[1] BullishConditions2 = UX1 and UX2 and UX3 and UX4 and UX5 and UX6 and UX7 //=/ Bullish Conditions 3 UXX1 = upward > 0 UXX2 = close > TrendFast UXX3 = close > TrendLong UXX4 = close > TrendMedium UXX5 = TrendFast = TrendFast[1] UXX6 = TrendLong > TrendLong[1] UXX7 = TrendMedium = TrendMedium[1] BullishConditions3 = UXX1 and UXX2 and UXX3 and UXX4 and UXX5 and UXX6 and UXX7 //=//=// //=/ Bearish Conditions 1 E1 = downward > 0 E2 = close < TrendFast E3 = close < TrendLong E4 = close < TrendMedium E5 = TrendFast < TrendFast[1] E6 = TrendLong < TrendLong[1] E7 = TrendMedium < TrendMedium[1] BearishConditions1 = E1 and E2 and E3 and E4 and E5 and E6 and E7 //=/ Bearish Conditions 2 EX1 = downward > 0 EX2 = close < TrendFast EX3 = close < TrendLong EX4 = close < TrendMedium EX5 = TrendFast = TrendFast[1] EX6 = TrendLong < TrendLong[1] EX7 = TrendMedium < TrendMedium[1] BearishConditions2 = EX1 and EX2 and EX3 and EX4 and EX5 and EX6 and EX7 //=/ Bearish Conditions 3 EXX1 = downward > 0 EXX2 = close < TrendFast EXX3 = close < TrendLong EXX4 = close < TrendMedium EXX5 = TrendFast = TrendFast[1] EXX6 = TrendLong < TrendLong[1] EXX7 = TrendMedium = TrendMedium[1] BearishConditions3 = EXX1 and EXX2 and EXX3 and EXX4 and EXX5 and EXX6 and EXX7 //=/ Candle Color Settings if BullishConditions1 then br = RxUP bg = GxUP bb = BxUP tz = 250 elsif BullishConditions2 then br = RxUP bg = GxUP bb = BxUP tz = 200 elsif BullishConditions3 then br = RxUP bg = GxUP bb = BxUP tz = 150 //=//=// elsif BearishConditions1 then br = RxDOWN bg = GxDOWN bb = BxDOWN tz = 250 elsif BearishConditions2 then br = RxDOWN bg = GxDOWN bb = BxDOWN tz = 200 elsif BearishConditions3 then br = RxDOWN bg = GxDOWN bb = BxDOWN tz = 150 //=//=// else br = 204 bg = 204 bb = 204 tz = 150 endif drawcandle(open,high,low,close) coloured(br,bg,bb,tz) // //=/===============/=//=/===============/=//=/ Visual // //=/ Visual Settings MIDX1 = (hiband-rngfilt)/3 MID1 = (rngfilt+MIDX1) MID2 = (MID1+MIDX1) MIDX2 = (rngfilt-loband)/3 MID3 = (rngfilt-MIDX2) MID4 = (MID3-MIDX2) // //=/===============/=//=/===============/=//=/ End // return TrendFast coloured (cr,cg,cb,ct) style(line,2) as "Trend Fast" , MID1 coloured (RxDOWN,GxDOWN,BxDOWN,30) style(line,1) as "MID1" , MID2 coloured (RxUP,GxUP,BxUP,30) style(line,1) as "MID2" , MID3 coloured (RxDOWN,GxDOWN,BxDOWN,30) style(line,1) as "MID3" , MID4 coloured (RxUP,GxUP,BxUP,30) style(line,1) as "MID4" , hiband coloured (RxUP,GxUP,BxUP,30) style(line,1) as "Hiband" , loband coloured (RxUP,GxUP,BxUP,30) style(line,1) as "Loband" |
Share this
No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.
ProRealTime ITF files and other attachments :PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials
Hello Iv mcm Where are gx range and bx range . How IT is it is not running
How do you use it in trading,,,
Hello, please download the ITF directly
Indeed, copying and pasting code gives an error, to correct the error you have to replace the first lines of the code by this one
RxUP = 0
GxUP = 153
BxUP = 255
RxDOWN = 102
GxDOWN = 102
BxDOWN = 102
RxRange = 199
GxRange = 29
BxRange = 29
The use of this indicator is however logical, it gives you potential movement departures depending on the break of the dynamic range.
On the other hand, the use of this indicator alone is not recommended, you must know how to trace your support and resistance zones to know if your signal is not likely to be distorted by a technical level.
Waiting for the indicator to turn white again to indicate a range is not a good idea either, you need to know where to go before you even get into position.
IV
The updated version (v2) is available to download and discuss in this forum thread: https://www.prorealcode.com/topic/trend-impulse-with-range-filter-v2/
Thank you IV Mcm for sharing your indicators.
Thanks Nicolas