As of yesterday there was some issue with the trend definition which you're more clear now so hope you can define the conditions. If the conditions are evaluated for double variable it means for all past bars also the new values will be invoked & that is the basic reason for same region being plotted for all data, so you're getting region as per current trend. That's why I suggested you to convert your double to series & compare the series @ currentbar so your old regions will be unaffected by new trend.
Consider below logic:-
if( rsi[0] > (avg[0] + Band[0] ))
<up region>
else if( rsi[0] < (avg[0] + Band[0] ))
<dn region>
else if( Math.Abs(rsi[0] - avg[0]) == Band[0] )
<nl region>
And be sure to add currentbar index to region tag so you get all regions plotted.
Hope it helps.
Comment