### Stock Portfolio Organizer

The ultimate porfolio management solution.

Shares, Margin, CFD's, Futures and Forex
EOD and Realtime
Dividends and Trust Distributions
And Much More ....

#1 Selling Amibroker Plugin featuring:

Neural Networks
And Much More ....
Find Out More Here

### RSI Closing value by Alvarez for Amibroker (AFL) c62 5 months ago Amibroker (AFL)

Rating:
Tags:
amibroker, oscillator, rsi

Determines the closing value of a stock need to reach a particular RSI value
function ReverseRSI(nLen, rsiTarget)

### Indicator / Formula

```// Provided as is by www.AlvarezQuantTrading.com

///////////////////  Reverse RSI Calculator  ////////////////////////
// Determines the closing value of a stock need to reach a particular RSI value
function ReverseRSI(nLen, rsiTarget)
{
gain = Max(C-Ref(C,-1), 0);
loss = -Min(C-Ref(C,-1), 0);

rsGain = IIf(BarIndex() < nLen-1,Null,
IIf(BarIndex()==nLen-1, MA(gain, nLen), gain));
rsLoss = IIf(BarIndex() < nLen-1,Null,
IIf(BarIndex()==nLen-1, MA(Loss,nLen), Loss));

rsGain = AMA(rsGain, 1/nLen);
rsLoss = AMA(rsLoss, 1/nLen);

RSIcalc = IIf(BarIndex()<nLen-1, Null, 100*rsGain/(rsGain+rsLoss));

targetPrice = IIf( (rsiTarget < RSI(nLen)),
C-100*(((nLen-1)*rsGain)/rsiTarget)+((nLen-1)*rsGain)+((nLen-1)*rsLoss),
C+((rsiTarget/(100-rsiTarget)*((nLen-1)*rsLoss))-((nLen-1)*rsGain))
);

return targetPrice;
}

Filter = TRUE ;

1.

Hello c62
This AFL shows nothing. All blank.
Would you please tell how to use it.
Thanks.

2.

It’s an exploration only. No chart.

3.

hey man thanks for the code.. can you guide me how to plot the rsi using this formula and can we apply the range of rsi here ?