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
//
//=/===============/=//=/===============/=//=/ Indicator Range Trend
//
RxUP = 0
GxUP = 153
BxUP = 255
RxDOWN = 102
GxDOWN = 102
BxDOWN = 102
//
//=/===============/=//=/===============/=//=/ 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)
Limitt = (close+TrendFast)/2
//
//=/===============/=//=/===============/=//=/ Trend Color
//
//=/ Trend Fast Color Settings
if upward > 0 and TrendFast > TrendFast[1] then
cr = RxUP
cg = GxUP
cb = BxUP
ct = 250
elsif downward > 0 and TrendFast < TrendFast[1] then
cr = RxDOWN
cg = GxDOWN
cb = BxDOWN
ct = 250
elsif upward > 0 and TrendFast = TrendFast[1] then
cr = RxUP
cg = GxUP
cb = BxUP
ct = 100
elsif downward > 0 and TrendFast = TrendFast[1] then
cr = RxDOWN
cg = GxDOWN
cb = BxDOWN
ct = 100
endif
//
//=/===============/=//=/===============/=//=/ Candle
//
//=/ Bullish Conditions 1P
UP1 = upward > 0
UP2 = close > TrendFast
UP3 = close > TrendLong
UP4 = close > TrendMedium
UP5 = TrendFast > TrendFast[1]
UP6 = TrendLong > TrendLong[1]
UP7 = TrendMedium > TrendMedium[1]
UP8 = low =< Limitt
UP9 = close > MID4
BullishConditions1P = UP1 and UP2 and UP3 and UP4 and UP5 and UP6 and UP7 and UP8 and UP9
//=/ Bullish Conditions 1PS
UPS1 = upward > 0
UPS2 = close > TrendFast
UPS3 = close > TrendLong
UPS4 = close > TrendMedium
UPS5 = TrendFast > TrendFast[1]
UPS6 = TrendLong > TrendLong[1]
UPS7 = TrendMedium > TrendMedium[1]
UPS8 = low > Limitt
UPS9 = Limitt => MID4
UPS10 = close > MID4
BullishConditions1PS = UPS1 and UPS2 and UPS3 and UPS4 and UPS5 and UPS6 and UPS7 and UPS8 and UPS9 and UPS10
//=/ 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]
U8 = low > Limitt
U9 = close > MID4
BullishConditions1 = U1 and U2 and U3 and U4 and U5 and U6 and U7 and U8 and U9
//=/ 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]
UX8 = low > Limitt
UX9 = close > MID4
BullishConditions2 = UX1 and UX2 and UX3 and UX4 and UX5 and UX6 and UX7 and UX8 and UX9
//=/ 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]
UXX8 = low > Limitt
UXX9 = close > MID4
BullishConditions3 = UXX1 and UXX2 and UXX3 and UXX4 and UXX5 and UXX6 and UXX7 and UXX8 and UXX9
//=//=//
//=/ Bearish Conditions 1P
EP1 = downward > 0
EP2 = close < TrendFast
EP3 = close < TrendLong
EP4 = close < TrendMedium
EP5 = TrendFast < TrendFast[1]
EP6 = TrendLong < TrendLong[1]
EP7 = TrendMedium < TrendMedium[1]
EP8 = high => Limitt
EP9 = close < MID11
BearishConditions1P = EP1 and EP2 and EP3 and EP4 and EP5 and EP6 and EP7 and EP8 and EP9
//=/ Bearish Conditions 1PS
EPS1 = downward > 0
EPS2 = close < TrendFast
EPS3 = close < TrendLong
EPS4 = close < TrendMedium
EPS5 = TrendFast < TrendFast[1]
EPS6 = TrendLong < TrendLong[1]
EPS7 = TrendMedium < TrendMedium[1]
EPS8 = high < Limitt
EPS9 = Limitt =< MID11
EPS10 = close < MID11
BearishConditions1PS = EPS1 and EPS2 and EPS3 and EPS4 and EPS5 and EPS6 and EPS7 and EPS8 and EPS9 and EPS10
//=/ 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]
E8 = high < Limitt
E9 = close < MID11
BearishConditions1 = E1 and E2 and E3 and E4 and E5 and E6 and E7 and E8 and E9
//=/ 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]
EX8 = high < Limitt
EX9 = close < MID11
BearishConditions2 = EX1 and EX2 and EX3 and EX4 and EX5 and EX6 and EX7 and EX8 and EX9
//=/ 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]
EXX8 = high < Limitt
EXX9 = close < MID11
BearishConditions3 = EXX1 and EXX2 and EXX3 and EXX4 and EXX5 and EXX6 and EXX7 and EXX8 and EXX9
//=/ Candle Color Settings
if BullishConditions1P then
br = RxUP
bg = GxUP
bb = BxUP
tz = 250
elsif BullishConditions1PS then
br = RxUP
bg = GxUP
bb = BxUP
tz = 250
elsif BullishConditions1 then
br = RxUP
bg = GxUP
bb = BxUP
tz = 185
elsif BullishConditions2 then
br = RxUP
bg = GxUP
bb = BxUP
tz = 125
elsif BullishConditions3 then
br = RxUP
bg = GxUP
bb = BxUP
tz = 100
//=//=//
elsif BearishConditions1P then
br = RxDOWN
bg = GxDOWN
bb = BxDOWN
tz = 250
elsif BearishConditions1PS then
br = RxDOWN
bg = GxDOWN
bb = BxDOWN
tz = 250
elsif BearishConditions1 then
br = RxDOWN
bg = GxDOWN
bb = BxDOWN
tz = 185
elsif BearishConditions2 then
br = RxDOWN
bg = GxDOWN
bb = BxDOWN
tz = 125
elsif BearishConditions3 then
br = RxDOWN
bg = GxDOWN
bb = BxDOWN
tz = 100
//=//=//
else
br = 204
bg = 204
bb = 204
tz = 180
endif
drawcandle(open,high,low,close) coloured(br,bg,bb,tz)
//
//=/===============/=//=/===============/=//=/ Visual
//
//=/ Visual Settings
MIDX1 = (hiband-TrendFast)/8
MID1 = (TrendFast+MIDX1)
MID2 = (MID1+MIDX1)
MID3 = (MID2+MIDX1)
MID4 = (MID3+MIDX1)
MID5 = (MID4+MIDX1)
MID6 = (MID5+MIDX1)
MID7 = (MID6+MIDX1)
MIDX2 = (TrendFast-loband)/8
MID8 = (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"