Trend Impulse with Range Filter V2
Forums › ProRealTime English forum › ProBuilder support › Trend Impulse with Range Filter V2
- This topic has 3 replies, 3 voices, and was last updated 4 years ago by ullle73.
-
-
11/02/2020 at 10:33 AM #149120
Hello,
Today, I publish the V2 of the previous indicator.
This one is very similar to the first one however, it includes more precise calculations.
I chose to take the same sequence of the graph so that you can compare the two images.The notable effects are the detection of the ranges, they are done much earlier.
The entry points or pulse points remain the same, which means that the indicator is not seen with a secondary filter, but rather an adjustment in terms of precision.The external variable remains the same and the use of the same
IV
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333////=/===============/=//=/===============/=//=/ Indicator Range Trend//RxUP = 0GxUP = 153BxUP = 255RxDOWN = 102GxDOWN = 102BxDOWN = 102////=/===============/=//=/===============/=//=/ Range////=/ Range Settingsonce rngfilt=closeif barindex>max(14,27) thenrngscale=max(1,min(rngscale,7))scale = 2.618*average[14,1](abs(close-close[1]))endifr=average[27,1](scale)hh=closell=closeif 1<>1 thenhh=highll=lowendifif 1=1 thenif hh>rngfilt[1] thenif (hh-r)<rngfilt[1] thenrngfilt=rngfilt[1]elserngfilt=hh-rendifelsif (ll+r)>rngfilt[1] thenrngfilt=rngfilt[1]elserngfilt=ll+rendifelseif hh>=rngfilt[1]+r thenrngfilt=(rngfilt[1]) + (abs(hh - (rngfilt[1]))/r)*relsif ll<=rngfilt[1]-r thenrngfilt=(rngfilt[1]) - (abs(ll - (rngfilt[1]))/r)*relserngfilt=rngfilt[1]endifendifhiband = rngfilt + rloband = rngfilt - rif rngfilt>rngfilt[1] thenupward=1downward=0endifif rngfilt<rngfilt[1] thenupward=0downward=1endifTrendFast = rngfiltTrendMedium = Average[2](rngfilt)TrendLong = Average[4](rngfilt)Limitt = (close+TrendFast)/2////=/===============/=//=/===============/=//=/ Trend Color////=/ Trend Fast Color Settingsif upward > 0 and TrendFast > TrendFast[1] thencr = RxUPcg = GxUPcb = BxUPct = 250elsif downward > 0 and TrendFast < TrendFast[1] thencr = RxDOWNcg = GxDOWNcb = BxDOWNct = 250elsif upward > 0 and TrendFast = TrendFast[1] thencr = RxUPcg = GxUPcb = BxUPct = 100elsif downward > 0 and TrendFast = TrendFast[1] thencr = RxDOWNcg = GxDOWNcb = BxDOWNct = 100endif////=/===============/=//=/===============/=//=/ Candle////=/ Bullish Conditions 1PUP1 = upward > 0UP2 = close > TrendFastUP3 = close > TrendLongUP4 = close > TrendMediumUP5 = TrendFast > TrendFast[1]UP6 = TrendLong > TrendLong[1]UP7 = TrendMedium > TrendMedium[1]UP8 = low =< LimittUP9 = close > MID4BullishConditions1P = UP1 and UP2 and UP3 and UP4 and UP5 and UP6 and UP7 and UP8 and UP9//=/ Bullish Conditions 1PSUPS1 = upward > 0UPS2 = close > TrendFastUPS3 = close > TrendLongUPS4 = close > TrendMediumUPS5 = TrendFast > TrendFast[1]UPS6 = TrendLong > TrendLong[1]UPS7 = TrendMedium > TrendMedium[1]UPS8 = low > LimittUPS9 = Limitt => MID4UPS10 = close > MID4BullishConditions1PS = UPS1 and UPS2 and UPS3 and UPS4 and UPS5 and UPS6 and UPS7 and UPS8 and UPS9 and UPS10//=/ Bullish Conditions 1U1 = upward > 0U2 = close > TrendFastU3 = close > TrendLongU4 = close > TrendMediumU5 = TrendFast > TrendFast[1]U6 = TrendLong > TrendLong[1]U7 = TrendMedium > TrendMedium[1]U8 = low > LimittU9 = close > MID4BullishConditions1 = U1 and U2 and U3 and U4 and U5 and U6 and U7 and U8 and U9//=/ Bullish Conditions 2UX1 = upward > 0UX2 = close > TrendFastUX3 = close > TrendLongUX4 = close > TrendMediumUX5 = TrendFast = TrendFast[1]UX6 = TrendLong > TrendLong[1]UX7 = TrendMedium > TrendMedium[1]UX8 = low > LimittUX9 = close > MID4BullishConditions2 = UX1 and UX2 and UX3 and UX4 and UX5 and UX6 and UX7 and UX8 and UX9//=/ Bullish Conditions 3UXX1 = upward > 0UXX2 = close > TrendFastUXX3 = close > TrendLongUXX4 = close > TrendMediumUXX5 = TrendFast = TrendFast[1]UXX6 = TrendLong > TrendLong[1]UXX7 = TrendMedium = TrendMedium[1]UXX8 = low > LimittUXX9 = close > MID4BullishConditions3 = UXX1 and UXX2 and UXX3 and UXX4 and UXX5 and UXX6 and UXX7 and UXX8 and UXX9//=//=////=/ Bearish Conditions 1PEP1 = downward > 0EP2 = close < TrendFastEP3 = close < TrendLongEP4 = close < TrendMediumEP5 = TrendFast < TrendFast[1]EP6 = TrendLong < TrendLong[1]EP7 = TrendMedium < TrendMedium[1]EP8 = high => LimittEP9 = close < MID11BearishConditions1P = EP1 and EP2 and EP3 and EP4 and EP5 and EP6 and EP7 and EP8 and EP9//=/ Bearish Conditions 1PSEPS1 = downward > 0EPS2 = close < TrendFastEPS3 = close < TrendLongEPS4 = close < TrendMediumEPS5 = TrendFast < TrendFast[1]EPS6 = TrendLong < TrendLong[1]EPS7 = TrendMedium < TrendMedium[1]EPS8 = high < LimittEPS9 = Limitt =< MID11EPS10 = close < MID11BearishConditions1PS = EPS1 and EPS2 and EPS3 and EPS4 and EPS5 and EPS6 and EPS7 and EPS8 and EPS9 and EPS10//=/ Bearish Conditions 1E1 = downward > 0E2 = close < TrendFastE3 = close < TrendLongE4 = close < TrendMediumE5 = TrendFast < TrendFast[1]E6 = TrendLong < TrendLong[1]E7 = TrendMedium < TrendMedium[1]E8 = high < LimittE9 = close < MID11BearishConditions1 = E1 and E2 and E3 and E4 and E5 and E6 and E7 and E8 and E9//=/ Bearish Conditions 2EX1 = downward > 0EX2 = close < TrendFastEX3 = close < TrendLongEX4 = close < TrendMediumEX5 = TrendFast = TrendFast[1]EX6 = TrendLong < TrendLong[1]EX7 = TrendMedium < TrendMedium[1]EX8 = high < LimittEX9 = close < MID11BearishConditions2 = EX1 and EX2 and EX3 and EX4 and EX5 and EX6 and EX7 and EX8 and EX9//=/ Bearish Conditions 3EXX1 = downward > 0EXX2 = close < TrendFastEXX3 = close < TrendLongEXX4 = close < TrendMediumEXX5 = TrendFast = TrendFast[1]EXX6 = TrendLong < TrendLong[1]EXX7 = TrendMedium = TrendMedium[1]EXX8 = high < LimittEXX9 = close < MID11BearishConditions3 = EXX1 and EXX2 and EXX3 and EXX4 and EXX5 and EXX6 and EXX7 and EXX8 and EXX9//=/ Candle Color Settingsif BullishConditions1P thenbr = RxUPbg = GxUPbb = BxUPtz = 250elsif BullishConditions1PS thenbr = RxUPbg = GxUPbb = BxUPtz = 250elsif BullishConditions1 thenbr = RxUPbg = GxUPbb = BxUPtz = 185elsif BullishConditions2 thenbr = RxUPbg = GxUPbb = BxUPtz = 125elsif BullishConditions3 thenbr = RxUPbg = GxUPbb = BxUPtz = 100//=//=//elsif BearishConditions1P thenbr = RxDOWNbg = GxDOWNbb = BxDOWNtz = 250elsif BearishConditions1PS thenbr = RxDOWNbg = GxDOWNbb = BxDOWNtz = 250elsif BearishConditions1 thenbr = RxDOWNbg = GxDOWNbb = BxDOWNtz = 185elsif BearishConditions2 thenbr = RxDOWNbg = GxDOWNbb = BxDOWNtz = 125elsif BearishConditions3 thenbr = RxDOWNbg = GxDOWNbb = BxDOWNtz = 100//=//=//elsebr = 204bg = 204bb = 204tz = 180endifdrawcandle(open,high,low,close) coloured(br,bg,bb,tz)////=/===============/=//=/===============/=//=/ Visual////=/ Visual SettingsMIDX1 = (hiband-TrendFast)/8MID1 = (TrendFast+MIDX1)MID2 = (MID1+MIDX1)MID3 = (MID2+MIDX1)MID4 = (MID3+MIDX1)MID5 = (MID4+MIDX1)MID6 = (MID5+MIDX1)MID7 = (MID6+MIDX1)MIDX2 = (TrendFast-loband)/8MID8 = (TrendFast-MIDX2)MID9 = (MID8-MIDX2)MID10 = (MID9-MIDX2)MID11 = (MID10-MIDX2)MID12 = (MID11-MIDX2)MID13 = (MID12-MIDX2)MID14 = (MID13-MIDX2)////=/===============/=//=/===============/=//=/ End//return TrendFast coloured (cr,cg,cb,ct) style(line,2) as "Trend Fast" , MID1 coloured (RxDOWN,GxDOWN,BxDOWN,15) style(line,1) as "MID1" , MID2 coloured (RxDOWN,GxDOWN,BxDOWN,15) style(line,1) as "MID2" , MID3 coloured (RxDOWN,GxDOWN,BxDOWN,15) style(line,1) as "MID3" , MID4 coloured (RxDOWN,GxDOWN,BxDOWN,15) style(line,1) as "MID4" , MID5 coloured (RxUP,GxUP,BxUP,15) style(line,1) as "MID5" , MID6 coloured (RxUP,GxUP,BxUP,15) style(line,1) as "MID6" , MID7 coloured (RxUP,GxUP,BxUP,15) style(line,1) as "MID7" , MID8 coloured (RxDOWN,GxDOWN,BxDOWN,15) style(line,1) as "MID8" , MID9 coloured (RxDOWN,GxDOWN,BxDOWN,15) style(line,1) as "MID9" , MID10 coloured (RxDOWN,GxDOWN,BxDOWN,15) style(line,1) as "MID10" , MID11 coloured (RxDOWN,GxDOWN,BxDOWN,15) style(line,1) as "MID11" , MID12 coloured (RxUP,GxUP,BxUP,15) style(line,1) as "MID12" , MID13 coloured (RxUP,GxUP,BxUP,15) style(line,1) as "MID13" , MID14 coloured (RxUP,GxUP,BxUP,15) style(line,1) as "MID14" , hiband coloured (RxUP,GxUP,BxUP,15) style(line,1) as "Hiband" , loband coloured (RxUP,GxUP,BxUP,15) style(line,1) as "Loband" , Limitt coloured (cr,cg,cb,ct) style(line,1) as "Limit"1 user thanked author for this post.
11/02/2020 at 10:41 AM #149271Thanks for sharing. I added the link to this forum thread in your first version of the indicator in the library: Trend Impulse with Range Filter
1 user thanked author for this post.
11/02/2020 at 8:24 PM #149323La V3
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331////=/===============/=//=/===============/=//=/ Indicator Range Trend//RxUP = 0GxUP = 153BxUP = 255RxDOWN = 102GxDOWN = 102BxDOWN = 102RxRange = 204GxRange = 204BxRange = 204RxForce = 199GxForce = 19BxForce = 19RangeScale = 2.338////=/===============/=//=/===============/=//=/ Range////=/ Range Settingsonce RRange=closeif barindex>max(14,27) thenRNGScale=max(1,min(RNGScale,7))scale = RangeScale*average[14,1](abs(close-close[1]))//2.338endifr = average[27,1](scale)HH = closeLL = closeif 1 <> 1 thenHH = highLL = lowendifif 1 = 1 thenif HH > RRange[1] thenif (HH-R) < RRange[1] thenRRange = RRange[1]elseRRange = (HH-R)endifelsif (LL+R) > RRange[1] thenRRange = RRange[1]elseRRange = (LL+R)endifelseif HH >= (RRange[1]+R) thenRRange = (RRange[1]) + (abs (HH - (RRange[1]) )/ R)*Relsif LL <= (RRange[1]-R) thenRRange = (RRange[1]) - (abs (LL - (RRange[1]) )/ R)*RelseRRange = RRange[1]endifendifUpRange = RRange + RDwRange = RRange - Rif RRange > RRange[1] thenupward = 1downward = 0endifif RRange < RRange[1] thenupward = 0downward = 1endifTrend = RRangeTrendMedium = average[2](Trend)TrendLong= average[3](Trend)ForceINT = (close+Trend)/2MidPLH = Trend + (UpRange - Trend)/2MidPLB = Trend - (Trend - DwRange)/2////=/===============/=//=/===============/=//=/ Trend Color////=/ Trend Color Settingsif upward > 0 and Trend > Trend[1] thenUPTrend = 1DWTrend = 0cr = RxUPcg = GxUPcb = BxUPct = 250elsif downward > 0 and Trend < Trend[1] thenUPTrend = 0DWTrend = 1cr = RxDOWNcg = GxDOWNcb = BxDOWNct = 250elsif upward > 0 and Trend = Trend[1] thenUPTrend = 0DWTrend = 0cr = RxUPcg = GxUPcb = BxUPct = 250elsif downward > 0 and Trend = Trend[1] thenUPTrend = 0DWTrend = 0cr = RxDOWNcg = GxDOWNcb = BxDOWNct = 250endif////=/===============/=//=/===============/=//=/ ForceINT Color////=/ ForceINT Color Settingsif upward > 0 and ForceINT => MID4 thenfr = RxForcefg = GxForcefb = BxForceft = 250elsif downward > 0 and ForceINT =< MID11 thenfr = RxForcefg = GxForcefb = BxForceft = 250elsif upward > 0 and ForceINT < MID4 thenfr = RxUPfg = GxUPfb = BxUPft = 250elsif downward > 0 and ForceINT > MID11 thenfr = RxDOWNfg = GxDOWNfb = BxDOWNft = 250endif////=/===============/=//=/===============/=//=/ Candle////=/ Bullish Conditions 1UP1 = UpWard > 0UP2 = UPTrend > 0UP3 = low =< ForceINTBullishConditions1 = UP1 and UP2 and UP3//=/ Bullish Conditions 2UPX1 = UpWard > 0UPX2 = UPTrend > 0UPX3 = low > ForceINTBullishConditions2 = UPX1 and UPX2 and UPX3//=/ Bullish Conditions 3UPXX1 = UpWard > 0UPXX2 = Trend = Trend[1]UPXX3 = TrendMedium > TrendMedium[1]UPXX4 = close > MidPLHBullishConditions3 = UPXX1 and UPXX2 and UPXX3 and UPXX4//=/ Bullish Conditions 4UPXXX1 = UpWard > 0UPXXX2 = Trend = Trend[1]UPXXX3 = TrendMedium = TrendMedium[1]UPXXX4 = TrendLong > TrendLong[1]UPXXX5 = close > MidPLHBullishConditions4 = UPXXX1 and UPXXX2 and UPXXX3 and UPXXX4 and UPXXX5//=/ Bullish Conditions RUPR1 = UpWard > 0UPR2 = Close < TrendBullishConditionsR = UPR1 and UPR2//=//=////=/ Bearish Conditions 1EP1 = DownWard > 0EP2 = DWTrend > 0EP3 = high => ForceINTBearishConditions1 = EP1 and EP2 and EP3//=/ Bearish Conditions 2EPX1 = DownWard > 0EPX2 = DWTrend > 0EPX3 = high < ForceINTBearishConditions2 = EPX1 and EPX2 and EPX3//=/ Bearish Conditions 3EPXX1 = DownWard > 0EPXX2 = Trend = Trend[1]EPXX3 = TrendMedium < TrendMedium[1]EPXX4 = close < MidPLBBearishConditions3 = EPXX1 and EPXX2 and EPXX3 and EPXX4//=/ Bearish Conditions 4EPXXX1 = DownWard > 0EPXXX2 = Trend = Trend[1]EPXXX3 = TrendMedium = TrendMedium[1]EPXXX4 = TrendLong < TrendLong[1]EPXXX5 = close < MidPLBBearishConditions4 = EPXXX1 and EPXXX2 and EPXXX3 and EPXXX4 and EPXXX5//=/ Bearish Conditions REPR1 = DownWard > 0EPR2 = Close > TrendBearishConditionsR = EPR1 and EPR2//=/ Candle Color Settingsif BullishConditions1 thenR = RxUPG = GxUPB = BxUPT = 250elsif BullishConditions2 thenR = RxUPG = GxUPB = BxUPT = 200elsif BullishConditions3 thenR = RxUPG = GxUPB = BxUPT = 200elsif BullishConditions4 thenR = RxUPG = GxUPB = BxUPT = 200elsif BullishConditionsR thenR = RxRangeG = GxRangeB = BxRangeT = 150//=//=//elsif BearishConditions1 thenR = RxDOWNG = GxDOWNB = BxDOWNT = 250elsif BearishConditions2 thenR = RxDOWNG = GxDOWNB = BxDOWNT = 200elsif BearishConditions3 thenR = RxDOWNG = GxDOWNB = BxDOWNT = 200elsif BearishConditions4 thenR = RxDOWNG = GxDOWNB = BxDOWNT = 200elsif BearishConditionsR thenR = RxRangeG = GxRangeB = BxRangeT = 150//=//=//elseR = 204G = 204B = 204T = 250endifdrawcandle(open,high,low,close) coloured(R,G,B,T)////=/===============/=//=/===============/=//=/ End//////=/===============/=//=/===============/=//=/ Visual////=/ Visual SettingsMIDX1 = (UpRange-Trend)/8MID1 = (Trend+MIDX1)MID2 = (MID1+MIDX1)MID3 = (MID2+MIDX1)MID4 = (MID3+MIDX1)MID5 = (MID4+MIDX1)MID6 = (MID5+MIDX1)MID7 = (MID6+MIDX1)MIDX2 = (Trend-DwRange)/8MID8 = (Trend-MIDX2)MID9 = (MID8-MIDX2)MID10 = (MID9-MIDX2)MID11 = (MID10-MIDX2)MID12 = (MID11-MIDX2)MID13 = (MID12-MIDX2)MID14 = (MID13-MIDX2)return Trend coloured (cr,cg,cb,ct) style(line,2) as "Trend", ForceINT coloured (fr,fg,fb,ft) style(line,1) as "ForceINT", UpRange coloured (RxUP,GxUP,BxUP,15) style(line,1) as "UpRange", DwRange coloured (RxUP,GxUP,BxUP,15) style(line,1) as "DwRange", MID1 coloured (RxUP,GxUP,BxUP,150) style(line,1) as "MID1", MID2 coloured (RxUP,GxUP,BxUP,130) style(line,1) as "MID2", MID3 coloured (RxUP,GxUP,BxUP,110) style(line,1) as "MID3", MID4 coloured (RxUP,GxUP,BxUP,90) style(line,1) as "MID4", MID5 coloured (RxUP,GxUP,BxUP,70) style(line,1) as "MID5", MID6 coloured (RxUP,GxUP,BxUP,50) style(line,1) as "MID6", MID7 coloured (RxUP,GxUP,BxUP,30) style(line,1) as "MID7", MID8 coloured (RxDOWN,GxDOWN,BxDOWN,150) style(line,1) as "MID8", MID9 coloured (RxDOWN,GxDOWN,BxDOWN,130) style(line,1) as "MID9", MID10 coloured (RxDOWN,GxDOWN,BxDOWN,110) style(line,1) as "MID10", MID11 coloured (RxDOWN,GxDOWN,BxDOWN,90) style(line,1) as "MID11", MID12 coloured (RxDOWN,GxDOWN,BxDOWN,70) style(line,1) as "MID12", MID13 coloured (RxDOWN,GxDOWN,BxDOWN,50) style(line,1) as "MID13", MID14 coloured (RxDOWN,GxDOWN,BxDOWN,30) style(line,1) as "MID14"11/08/2020 at 11:52 AM #149828 -
AuthorPosts
Find exclusive trading pro-tools on