The Fukuiz Trend indicator, originally published on TradingView, combines two well-known techniques into a single clean oscillator: a dual-RSI trend filter and an automated divergence detector. Instead of using a single 14-period RSI and guessing which reading matters, Fukuiz layers a fast RSI (25 periods) over a slow one (100 periods) and paints the space between them with a color that reveals the dominant regime at a glance.
Underneath, the indicator scans the fast RSI for pivot highs and lows and automatically draws bullish and bearish divergence lines against price — a task most traders do manually and inconsistently. The result is a momentum oscillator that simultaneously tells you the trend direction and flags potential reversal signals without cluttering the chart.
A single RSI is a momentum reading over a single timeframe. Its main weakness is obvious: the same 70/30 thresholds behave very differently depending on whether the market is trending or ranging. In a strong uptrend, RSI(14) can stay above 70 for weeks; in a range, the same level means exhaustion.
The dual-RSI approach sidesteps the threshold problem by using relative momentum instead of absolute levels:
The core signal is the relationship between them:
bullish = fast_RSI > slow_RSI
bearish = fast_RSI < slow_RSI
When the fast RSI sits above the slow RSI, recent momentum is stronger than the prevailing regime — that’s a bullish bias, regardless of the absolute RSI level. The indicator fills the space between the two lines with color (blue/purple when bullish, red/pink when bearish), producing an immediate visual read of the current regime.
This construction is resilient: instead of asking “is RSI above 70?” (which lies in trends), it asks “is short-term momentum outpacing the broader momentum?” — a question that behaves consistently across trending and ranging conditions.
The divergence engine works on pivots of the RSI series, confirmed with a right-look-ahead of 5 bars (lbR = 5). A pivot low is identified when the RSI printed a local minimum 5 bars ago that was lower than anything in the lbL bars before it. The same logic, mirrored, detects pivot highs.
Once two consecutive pivot lows (or highs) have been located, the indicator evaluates the classical divergence condition:
Bullish divergence:
Bearish divergence:
When all three conditions hold, the indicator draws an arrow (green for bullish, red for bearish) at the RSI pivot and connects the two oscillator pivots with a line — making the divergence explicit and hard to miss.
| Feature | Behaviour |
|---------|-----------|
| Fast RSI | Length 25, recent momentum |
| Slow RSI | Length 100, regime momentum |
| Regime fill | Colored band between the two RSIs |
| Bullish divergence | RSI HL + price LL (5–60 bars apart) |
| Bearish divergence | RSI LH + price HH (5–60 bars apart) |
| Reference bands | Fixed 30 / 50 / 70 |
| Parameter | Default | Description |
|-----------|---------|-------------|
| `len` | 25 | Fast RSI length |
| `len2` | 100 | Slow RSI length |
| `src` | close | RSI source price |
| `lbR` | 5 | Right lookback for pivot confirmation |
| `lbL` | 5 | Left lookback for pivot validation |
| `rangeUpper` | 60 | Max bars between pivots for valid divergence |
| `rangeLower` | 5 | Min bars between pivots for valid divergence |
| `showdiv` | 1 | Toggle divergence drawings (1 = show) |
Shorter len/len2 ratios (e.g. 14/50) make the regime fill more reactive; longer ratios (25/200) produce more stable regime reads with fewer false regime flips. The 5–60 bar divergence window is a sensible default — widening it catches more divergences but also more noise.
The ProBuilder translation preserves the full logic of the original Pine Script. Two details worth mentioning:
//------------------------------------------------------------------------//
//PRC_RSI Fukuiz Trend
//version = 0
//30.05.24
//Iván González @ www.prorealcode.com
//Sharing ProRealTime knowledge
//------------------------------------------------------------------------//
//-----Inputs-------------------------------------------------------------//
//-----RSI
len=25
len2=100
src=close
//-----Pivots
lbR=5//lookback Right
lbL=lbR//lookback Left
//-----Divergences
rangeUpper=60
rangeLower=5
showdiv=1
//------------------------------------------------------------------------//
//------------------------------------------------------------------------//
srcUp=max(close-close[1],0)
srcDw=-min(close-close[1],0)
alpha=1/len
if barindex=len then
up=average[len](srcup)
dw=average[len](srcdw)
else
up=alpha*srcup+(1-alpha)*up[1]
dw=alpha*srcdw+(1-alpha)*dw[1]
endif
alpha2=1/len2
if barindex=len2 then
up2=average[len2](srcup)
dw2=average[len2](srcdw)
else
up2=alpha2*srcup+(1-alpha2)*up2[1]
dw2=alpha2*srcdw+(1-alpha2)*dw2[1]
endif
if dw=0 then
myrsi=100
elsif up=0 then
myrsi=0
else
myrsi=100-100/(1+up/dw)
endif
if dw2=0 then
myrsi2=100
elsif up2=0 then
myrsi2=0
else
myrsi2=100-100/(1+up2/dw2)
endif
//------------------------------------------------------------------------//
//------------------------------------------------------------------------//
bullish=myrsi>myrsi2
bearish=myrsi<myrsi2
//------------------------------------------------------------------------//
//-----Pivots High-Low ---------------------------------------------------//
osc=rsi[len](src)
src1=osc
//------------------------------------------------------------------------//
//-----pivots low
if src1 > src1[lbR] and lowest[lbR](src1) > src1[lbR] and src1[lbR] < lowest[lbL](src1)[lbR+1] then
$pl[z+1]=src1[lbR]
$plx[z+1]=barindex[lbR]
$priceL[z+1]=low[lbR]
z=z+1
endif
//-----pivots high
if src1 < src1[lbR] and highest[lbR](src1)<src1[lbR] and src1[lbR]>highest[lbL](src1)[lbR+1] then
$ph[t+1]=src1[lbR]
$phx[t+1]=barindex[lbR]
$priceH[t+1]=high[lbR]
t=t+1
endif
//-----New Pivot found
plfound=z<>z[1]
phfound=t<>t[1]
//------------------------------------------------------------------------//
//-----Divergences--------------------------------------------------------//
//-----Bullish Divergences
oscHL = $pl[z]>$pl[max(0,z-1)] and (barindex-$plx[max(0,z-1)])<=rangeUpper and (barindex-$plx[max(0,z-1)])>=rangeLower
priceLL = $priceL[z]<$priceL[max(0,z-1)]
bullcond = plfound and oscHL and priceLL
if bullcond and showdiv then
drawarrowup(barindex[lbR],osc[lbR]-3)coloured("green")
drawsegment($plx[max(0,z-1)],$pl[max(0,z-1)],$plx[z],$pl[z])coloured("green")
endif
//-----Bearish Divergences
oscLH = $ph[t]<$ph[max(0,t-1)] and (barindex-$phx[max(0,t-1)])<=rangeUpper and (barindex-$phx[max(0,t-1)])>=rangeLower
priceHH = $priceH[t]>$priceH[max(0,t-1)]
bearCond = phfound and oscLH and priceHH
if bearCond and showdiv then
drawarrowdown(barindex[lbR],osc[lbR]+3)coloured("red")
drawsegment($phx[max(0,t-1)],$ph[max(0,t-1)],$phx[t],$ph[t])coloured("red")
endif
//------------------------------------------------------------------------//
//-----Plot bands---------------------------------------------------------//
bandDw=30
bandMd=50
bandUp=70
//-----Colours------------------------------------------------------------//
if bullish then
r=102
g=51
b=255
rr=51
gg=204
bb=255
elsif bearish then
r=255
g=51
b=51
rr=255
gg=51
bb=102
endif
colorbetween(myrsi,myrsi2,r,g,b,50)
//------------------------------------------------------------------------//
return myrsi as "RSI Short"coloured(r,g,b)style(line,2),myrsi2 as "RSI Long"coloured(rr,gg,bb)style(line,2),bandDw as "Lower Band"coloured("orange")style(dottedline),bandUp as"Upper Band"coloured("orange")style(dottedline),bandMd as "Middle Band"coloured("orange")style(dottedline)